def test_no_landmark(self): """Landmark is missing on this chromosome / stramd.""" xlinks = make_file_from_list([ ['chrX', '22', '23', '.', '3', '+'], ]) distances, total_cdna = rnamaps.compute_distances( self.landmarks, xlinks, 'exon-intron') self.assertEqual(total_cdna, 3) self.assertEqual(distances, {})
def test_basic(self): xlinks = make_file_from_list([ ['chr1', '12', '13', '.', '3', '+'], ]) distances, total_cdna = rnamaps.compute_distances( self.landmarks, xlinks, 'exon-intron') self.assertEqual(total_cdna, 3) self.assertEqual(distances, { 'chr1__+__10__G1': { 2: 3 }, })
def test_size_limit(self): xlinks = make_file_from_list([ ['chr1', '22', '23', '.', '3', '+'], ['chr2', '222', '223', '.', '1', '+'], ]) distances, total_cdna = rnamaps.compute_distances( self.landmarks, xlinks, 'exon-intron') self.assertEqual(total_cdna, 4) self.assertEqual(distances, { 'chr1__+__20__G1': { 2: 3 }, })
def test_chroms_not_mixed(self): xlinks = make_file_from_list([ ['chr1', '12', '13', '.', '3', '+'], ['chr2', '12', '13', '.', '1', '+'], ]) distances, total_cdna = rnamaps.compute_distances( self.landmarks, xlinks, 'exon-intron') self.assertEqual(total_cdna, 4) self.assertEqual(distances, { 'chr1__+__10__G1': { 2: 3 }, 'chr2__+__10__G3': { 2: 1 }, })