Skip to content

Commit

Permalink
Amended so that only really padded transcripts are padded
Browse files Browse the repository at this point in the history
  • Loading branch information
lucventurini committed Oct 1, 2018
1 parent 069e25a commit 3f1d60c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Mikado/loci/locus.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ def expand_transcript(transcript, new_start, new_end, fai, logger):
transcript.load_orfs(new_orfs)

# Now finalize again
transcript.attributes["padded"] = True
if upstream > 0 or downstream > 0:
transcript.attributes["padded"] = True
transcript.finalize()
return transcript
8 changes: 7 additions & 1 deletion Mikado/tests/locus_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -1934,16 +1934,22 @@ def test_padding(self):
locus.json_conf["pick"]["alternative_splicing"]["ts_max_splices"] = max_splice
locus.pad_transcripts()

if pad_distance == 1000:
if pad_distance != 200:
self.assertEqual(locus["mikado.44G2.1"].end, locus["mikado.44G2.2"].end)
self.assertTrue(locus["mikado.44G2.2"].attributes["padded"])
else:
self.assertFalse(locus["mikado.44G2.1"].attributes.get("padded", False))

self.assertEqual(locus["mikado.44G2.3"].end, locus["mikado.44G2.2"].end)
self.assertEqual(locus["mikado.44G2.4"].end, locus["mikado.44G2.2"].end)

if locus.ts_max_splices == 5:
self.assertEqual(locus["mikado.44G2.4"].end, locus["mikado.44G2.5"].end)
self.assertTrue(locus["mikado.44G2.1"].attributes.get("padded", False))
else:
self.assertNotEqual(locus["mikado.44G2.4"].end, locus["mikado.44G2.5"].end)
self.assertFalse(locus["mikado.44G2.1"].attributes.get("padded", False))

for transcript in locus:
self.assertGreater(locus[transcript].combined_cds_length, 0)
self.assertEqual(locus[transcript].combined_cds_start, cds_coordinates[transcript][0])
Expand Down

0 comments on commit 3f1d60c

Please sign in to comment.