示例#1
0
    def test_best_exons_by_p_value(self):
        expected_output = \
"""Gene Symbol	1_1	1_2	2_1	2_2	3_1	3_2	Mean(Cntl)	Mean(siETV4)	Ratio(siETV4 vs. Cntl)	Fold-Change(siETV4 vs. Cntl)	log2FoldChange	p-value	q-value	Less than 4 exons
A1BG	6.93789333333	7.01143	6.88032666667	6.86134333333	6.9543	6.82708666667	6.92417333333	6.89995333333	0.985846333333	-0.350463333333	-0.02422	0.4211846	0.6866338
A1BG-AS1	6.68543666667	6.36481	6.60468333333	6.50084333333	6.54916	6.57107333333	6.61309333333	6.47891333333	0.912662666667	-1.09929666667	-0.134184444667	0.36233172	0.592774133333	*
"""
        fp_out = io.StringIO()
        best_exons(self.fp_in, fp_out, rank_by='p_value')
        output = fp_out.getvalue()
        for obs, exp in zip(output.split(), expected_output.split()):
            ##print("%s, %s" % (obs,exp))
            self.assertEqual(obs, exp)
    def test_best_exons_by_p_value(self):
        expected_output = \
"""Gene Symbol	1_1	1_2	2_1	2_2	3_1	3_2	Mean(Cntl)	Mean(siETV4)	Ratio(siETV4 vs. Cntl)	Fold-Change(siETV4 vs. Cntl)	log2FoldChange	p-value	q-value	Less than 4 exons
A1BG	6.93789333333	7.01143	6.88032666667	6.86134333333	6.9543	6.82708666667	6.92417333333	6.89995333333	0.985846333333	-0.350463333333	-0.02422	0.4211846	0.6866338
A1BG-AS1	6.68543666667	6.36481	6.60468333333	6.50084333333	6.54916	6.57107333333	6.61309333333	6.47891333333	0.912662666667	-1.09929666667	-0.134184444667	0.36233172	0.592774133333	*
"""
        fp_out = cStringIO.StringIO()
        best_exons(self.fp_in,fp_out,rank_by='p_value')
        output = fp_out.getvalue()
        for obs,exp in zip(output.split(),expected_output.split()):
            ##print "%s, %s" % (obs,exp)
            self.assertEqual(obs,exp)
示例#3
0
    def test_best_exons_by_log2_fold_change(self):
        expected_output = \
"""Gene Symbol	1_1	1_2	2_1	2_2	3_1	3_2	Mean(Cntl)	Mean(siETV4)	Ratio(siETV4 vs. Cntl)	Fold-Change(siETV4 vs. Cntl)	log2FoldChange	p-value	q-value	Less than 4 exons
A1BG	6.53146666667	6.58490666667	6.46829	6.62764	6.43243	6.47405666667	6.47739666667	6.56220333333	1.06071	1.06071	0.0848055556667	0.579117833333	0.736739066667
A1BG-AS1	6.68543666667	6.36481	6.60468333333	6.50084333333	6.54916	6.57107333333	6.61309333333	6.47891333333	0.912662666667	-1.09929666667	-0.134184444667	0.36233172	0.592774133333	*
"""
        fp_out = io.StringIO()
        best_exons(self.fp_in, fp_out, rank_by='log2_fold_change')
        output = fp_out.getvalue()
        for obs, exp in zip(output.split(), expected_output.split()):
            ##print("%s, %s" % (obs,exp))
            self.assertEqual(obs, exp)
    def test_best_exons_by_log2_fold_change(self):
        expected_output = \
"""Gene Symbol	1_1	1_2	2_1	2_2	3_1	3_2	Mean(Cntl)	Mean(siETV4)	Ratio(siETV4 vs. Cntl)	Fold-Change(siETV4 vs. Cntl)	log2FoldChange	p-value	q-value	Less than 4 exons
A1BG	6.53146666667	6.58490666667	6.46829	6.62764	6.43243	6.47405666667	6.47739666667	6.56220333333	1.06071	1.06071	0.0848055556667	0.579117833333	0.736739066667
A1BG-AS1	6.68543666667	6.36481	6.60468333333	6.50084333333	6.54916	6.57107333333	6.61309333333	6.47891333333	0.912662666667	-1.09929666667	-0.134184444667	0.36233172	0.592774133333	*
"""
        fp_out = cStringIO.StringIO()
        best_exons(self.fp_in,fp_out,rank_by='log2_fold_change')
        output = fp_out.getvalue()
        for obs,exp in zip(output.split(),expected_output.split()):
            ##print "%s, %s" % (obs,exp)
            self.assertEqual(obs,exp)