Exemple #1
0
    def test_difference(self):
        genes = ["G1"]
        conditions = ["T1", "T2", "T3", "T4"]

        expression = np.zeros((1, 4))
        expression[0] = [10, 11, 65, 109]
        pvalues = np.zeros((1, 3))
        pvalues[0] = [0.02, 0.048, 0.0012]

        profile = ExpressionProfile(genes, conditions, expression, pvalues)

        self.assertEqual(profile.differences(), {"G1": [0, 0, 1]})
Exemple #2
0
    def test_difference(self):
        genes = ["G1"]
        conditions = ["T1", "T2", "T3", "T4"]

        expression = np.zeros((1, 4))
        expression[0] = [10, 11, 65, 109]
        pvalues = np.zeros((1, 3))
        pvalues[0] = [0.02, 0.048, 0.0012]

        profile = ExpressionProfile(genes, conditions, expression, pvalues)

        self.assertEqual(profile.differences(), {"G1": [0, 0, 1]})
Exemple #3
0
    def test_export_import(self):
        genes = ["G1"]

        conditions = ["T1", "T2", "T3", "T4"]

        expression = np.zeros((1, 4))
        expression[0] = [10, 11, 65, 109]

        profile = ExpressionProfile(genes, conditions, expression)
        data_frame = profile.data_frame

        new_profile = ExpressionProfile.from_data_frame(data_frame)

        self.assertEqual(profile, new_profile)
Exemple #4
0
    def test_export_import(self):
        genes = ["G1"]

        conditions = ["T1", "T2", "T3", "T4"]

        expression = np.zeros((1, 4))
        expression[0] = [10, 11, 65, 109]

        profile = ExpressionProfile(genes, conditions, expression)
        data_frame = profile.data_frame

        new_profile = ExpressionProfile.from_data_frame(data_frame)

        self.assertEqual(profile, new_profile)
Exemple #5
0
def build_expression_profile():
    warn(
        "The profile is not correct because the picture is black and white (do not use this profile for testing)"
    )
    expression = np.zeros((7, 1))
    expression[0, 0] = .0
    expression[1, 0] = .0
    expression[2, 0] = .0
    expression[3, 0] = .0
    expression[4, 0] = .0
    expression[5, 0] = .0
    expression[6, 0] = .0

    genes = ["G1", "G2", "G3", "G4", "G5", "G6", "G7"]
    conditions = ["Exp"]

    return ExpressionProfile(genes, conditions, expression)
Exemple #6
0
def build_expression_profile():
    expression = np.zeros((4, 3))
    expression[0, 0] = 0.17
    expression[0, 1] = 0.20
    expression[0, 2] = 0.93
    expression[1, 0] = 0.36
    expression[1, 1] = 0.83
    expression[1, 2] = 0.77
    expression[2, 0] = 0.87
    expression[2, 1] = 0.65
    expression[2, 2] = 0.07
    expression[3, 0] = 0.55
    expression[3, 1] = 0.49
    expression[3, 2] = 0.52

    genes = ["Gene2", "Gene3", "Gene6", "Gene7"]
    conditions = ["Exp#1", "Exp#2", "Exp#3"]

    return ExpressionProfile(genes, conditions, expression)