Skip to content

Commit

Permalink
Cleared a debug message
Browse files Browse the repository at this point in the history
  • Loading branch information
lucventurini committed Oct 15, 2018
1 parent ca951c2 commit 24476e6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
10 changes: 8 additions & 2 deletions Mikado/preparation/annotation_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ def load_from_gff(shelf_name,
to_ignore = set()

for row in gff_handle:
if row.is_transcript is True or row.feature == "match":
if row.feature == "protein":
continue
elif row.is_transcript is True or row.feature == "match":
if label != '':
row.id = "{0}_{1}".format(label, row.id)
row.source = label
Expand Down Expand Up @@ -364,12 +366,14 @@ def load_from_gff(shelf_name,
row.transcript = ["{0}_{1}".format(label, tid) for tid in row.transcript]

parents = row.transcript[:]
to_delete = set()
for tid in parents:

if tid in found_ids:
__raise_redundant(tid, gff_handle.name, label)
elif tid in to_ignore:
continue
if tid not in exon_lines:
if tid not in exon_lines and tid in transcript2genes:
exon_lines[tid] = dict()
exon_lines[tid]["attributes"] = row.attributes.copy()
if label:
Expand All @@ -382,6 +386,8 @@ def load_from_gff(shelf_name,
exon_lines[tid]["tid"] = tid
exon_lines[tid]["parent"] = transcript2genes[tid]
exon_lines[tid]["strand_specific"] = strand_specific
elif tid not in exon_lines and tid not in transcript2genes:
continue
else:
if "exon_number" in row.attributes:
del row.attributes["exon_number"]
Expand Down
6 changes: 3 additions & 3 deletions Mikado/preparation/checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ def create_transcript(lines,
lines["tid"])
# logger.exception(exc)
transcript_object = None
except exceptions.InvalidTranscript:
logger.info("Discarded generically invalid transcript %s",
lines["tid"])
except exceptions.InvalidTranscript as exc:
logger.info("Discarded generically invalid transcript %s, exception: %s",
lines["tid"], exc)
transcript_object = None
except KeyboardInterrupt:
raise KeyboardInterrupt
Expand Down
12 changes: 6 additions & 6 deletions Mikado/tests/test_system_calls.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ def test_prepare_with_cds(self):
with self.subTest(fname=fname, strip=strip):
self.conf["prepare"]["files"]["gff"] = [fname]
args.json_conf["prepare"]["strip_cds"] = strip
prepare.prepare(args, self.logger)
self.assertTrue(os.path.exists(os.path.join(self.conf["prepare"]["files"]["output_dir"],
"mikado_prepared.fasta")))
fa = pyfaidx.Fasta(os.path.join(self.conf["prepare"]["files"]["output_dir"],
"mikado_prepared.fasta"))
prepare.prepare(args, logger=self.logger)
fasta = os.path.join(self.conf["prepare"]["files"]["output_dir"], "mikado_prepared.fasta")
self.assertTrue(os.path.exists(fasta))
if strip is True or (strip is False and fname == ann_gff3):
self.assertGreater(os.stat(fasta).st_size, 0)
fa = pyfaidx.Fasta(fasta)
self.assertEqual(len(fa.keys()), 2)
else:
self.assertEqual(len(fa.keys()), 0)
self.assertEqual(os.stat(fasta).st_size, 0)
# Now verify that no model has CDS
gtf = os.path.join(self.conf["prepare"]["files"]["output_dir"], "mikado_prepared.gtf")
models = dict()
Expand Down
2 changes: 2 additions & 0 deletions Mikado/transcripts/transcriptchecker.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ def check_strand(self):
canonical_counter["+"])

elif canonical_counter["-"] > 0:
self.logger.debug("Transcript %s only has negative splice junctions, (%s), reversing.",
self.id, canonical_counter)
self.reverse_strand()
self.reversed = True

Expand Down

0 comments on commit 24476e6

Please sign in to comment.