Skip to content

Commit

Permalink
fix index error
Browse files Browse the repository at this point in the history
  • Loading branch information
raphenya committed Aug 28, 2018
1 parent 947e082 commit 7197e9c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/Base.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ def nudge_strict_to_perfect(self, strict):
orf_dna_sequence_ = ""
orf_end_ = ""
orf_start_ = ""
_partial_protein = ""
# Missing n-terminus or c-terminus
if len(query) < len(reference) and query in reference:
length_nucleotides = (len(reference) - len(strict[s]["match"]))*3
Expand All @@ -290,7 +291,7 @@ def nudge_strict_to_perfect(self, strict):

# check if partial_bases are multiples of 3
if len(partial_bases) % 3 == 0:
# logger.info("Missing part: {}".format(partial_bases))
logger.info("Missing part: [{}]".format(partial_bases))
if strict[s]["orf_strand"] == "-":
# update orf_end
strict[s]["orf_end_possible"] = orf_end_ + 1
Expand All @@ -306,11 +307,12 @@ def nudge_strict_to_perfect(self, strict):
partial_protein = str(Seq(partial_bases, generic_dna).translate(table=11))
# logger.info("Forward strand: {}".format(partial_protein))

# logger.info("Translated protein: {}".format(partial_protein))
logger.info("Translated protein: [{}]".format(partial_protein))
# update start codon to M for all other alternate start codons
_partial_protein = partial_protein[0]
if partial_protein[0] in ["L","M","I","V"]:
_partial_protein = "M"+partial_protein[1:]
if len(_partial_protein) > 0:
_partial_protein = partial_protein[0]
if partial_protein[0] in ["L","M","I","V"]:
_partial_protein = "M"+partial_protein[1:]

combine = _partial_protein + strict[s]["match"]

Expand Down

0 comments on commit 7197e9c

Please sign in to comment.