Skip to content

Commit

Permalink
raise an error and stop when we meet a CDS wihtout strand. Fix #42
Browse files Browse the repository at this point in the history
  • Loading branch information
Juke34 committed Oct 7, 2019
1 parent cd60779 commit 5919107
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions EMBLmyGFF3/modules/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,16 @@ def _infer_ORFs(self, feature):

# basic info
strand = self.location.strand
# raise an error if no strand for the CDS. Strand is not mandatory (can be a dot) except for CDS where it has an
# impact on the translation, and to check where is start and stop codon...
if strand == None:
ID=''
for qualifier in self.feature.qualifiers:
if 'id' == qualifier.lower():
ID = "%s" % " ".join(self.feature.qualifiers[qualifier])
break
logging.error('CDS %s does not have any strand! Please check your gff file.' % ID)
sys.exit()

if start_codon.upper() not in codon_table.start_codons:
self.location = self._set_before(self.location)
Expand Down

0 comments on commit 5919107

Please sign in to comment.