def test_g2x_noncoding_reverse(): """ Do some g. to n. conversion checking for the gene on the reverse strand. """ rna = [2000, 2797, 6405, 6528, 31678, 31750, 47687, 47806, 76448, 76535, 92453, 92554, 123276, 123470, 146090, 146213] cm = Crossmap(rna, [], -1) # Fix for r536: disable the -u and +d convention. # assert cm.tuple2string(cm.g2x(146214)) == '1-u1' assert cm.tuple2string(cm.g2x(146214)) == '-1' assert cm.tuple2string(cm.g2x(146213)) == '1' assert cm.tuple2string(cm.g2x(146089)) == '124+1' # Fix for r536: disable the -u and +d convention. # assert cm.tuple2string(cm.g2x(1999)) == '1624+d1' assert cm.tuple2string(cm.g2x(1999)) == '*1'
def test_g2x_noncoding(): """ Do some g. to n. conversion checking for the gene on the forward strand. """ rna = [5002, 5125, 27745, 27939, 58661, 58762, 74680, 74767, 103409, 103528, 119465, 119537, 144687, 144810, 148418, 149215] cm = Crossmap(rna, [], 1) # Fix for r536: disable the -u and +d convention. # assert cm.tuple2string(cm.g2x(5001)) == '1-u1' assert cm.tuple2string(cm.g2x(5001)) == '-1' assert cm.tuple2string(cm.g2x(5002)) == '1' assert cm.tuple2string(cm.g2x(5126)) == '124+1' # Fix for r536: disable the -u and +d convention. # assert cm.tuple2string(cm.g2x(149216)) == '1624+d1' assert cm.tuple2string(cm.g2x(149216)) == '*1'
def test_cds_one_exon(): """ Test a gene that has a CDS that lies entirely in one exon. """ rna = [1, 80, 81, 3719] cds = [162, 2123] cm = Crossmap(rna, cds, 1) assert cm._Crossmap__crossmapping == [-161, -82, -81, 3558] assert cm.x2g(1, 0) == 162 assert cm.tuple2string(cm.g2x(2123)) == '1962' assert cm.tuple2string(cm.g2x(2124)) == '*1'
def test_cds_start_on_splice_site(): """ Test a gene that has a CDS that starts on an exon splice site. """ rna = [23755059, 23755214, 23777833, 23778028, 23808749, 23808851, 23824768, 23824856, 23853497, 23853617, 23869553, 23869626, 23894775, 23894899, 23898506, 23899304] cds = [23777833, 23898680] cm = Crossmap(rna, cds, 1) assert (cm._Crossmap__crossmapping == [-156, -1, 1, 196, 197, 299, 300, 388, 389, 509, 510, 583, 584, 708, 709, 1507]) assert cm.x2g(1, 0) == 23777833 # Fix for r536: disable the -u and +d convention. # assert cm.tuple2string(cm.g2x(2123)) == '-156-u23752936' # assert cm.tuple2string(cm.g2x(2124)) == '-156-u23752935' assert cm.tuple2string(cm.g2x(2123)) == '-23753092' assert cm.tuple2string(cm.g2x(2124)) == '-23753091'
def test_g2x_reverse(): """ Do some g. to c. conversion checking for the gene on the reverse strand. """ rna = [2000, 2797, 6405, 6528, 31678, 31750, 47687, 47806, 76448, 76535, 92453, 92554, 123276, 123470, 146090, 146213] cds = [76479, 123290] cm = Crossmap(rna, cds, -1) # Fix for r536: disable the -u and +d convention. # assert cm.tuple2string(cm.g2x(146214)) == '-304-u1' assert cm.tuple2string(cm.g2x(146214)) == '-305' assert cm.tuple2string(cm.g2x(146091)) == '-182' assert cm.tuple2string(cm.g2x(146089)) == '-181+1' assert cm.tuple2string(cm.g2x(123291)) == '-1' assert cm.tuple2string(cm.g2x(123290)) == '1' assert cm.tuple2string(cm.g2x(92555)) == '16-1' assert cm.tuple2string(cm.g2x(76479)) == '174' assert cm.tuple2string(cm.g2x(76478)) == '*1' assert cm.tuple2string(cm.g2x(47807)) == '*32-1' assert cm.tuple2string(cm.g2x(47805)) == '*33' # Fix for r536: disable the -u and +d convention. # assert cm.tuple2string(cm.g2x(1999)) == '*1146+d1' assert cm.tuple2string(cm.g2x(1999)) == '*1147'
def test_g2x(): """ Do some g. to c. conversion checking for the gene on the forward strand. """ rna = [5002, 5125, 27745, 27939, 58661, 58762, 74680, 74767, 103409, 103528, 119465, 119537, 144687, 144810, 148418, 149215] cds = [27925, 74736] cm = Crossmap(rna, cds, 1) # Fix for r536: disable the -u and +d convention. # assert cm.tuple2string(cm.g2x(5001)) == '-304-u1' assert cm.tuple2string(cm.g2x(5001)) == '-305' assert cm.tuple2string(cm.g2x(5124)) == '-182' assert cm.tuple2string(cm.g2x(5126)) == '-181+1' assert cm.tuple2string(cm.g2x(27924)) == '-1' assert cm.tuple2string(cm.g2x(27925)) == '1' assert cm.tuple2string(cm.g2x(58660)) == '16-1' assert cm.tuple2string(cm.g2x(74736)) == '174' assert cm.tuple2string(cm.g2x(74737)) == '*1' assert cm.tuple2string(cm.g2x(103408)) == '*32-1' assert cm.tuple2string(cm.g2x(103410)) == '*33' # Fix for r536: disable the -u and +d convention. # assert cm.tuple2string(cm.g2x(149216)) == '*1146+d1' assert cm.tuple2string(cm.g2x(149216)) == '*1147'