diff --git a/Mikado/parsers/bed12.py b/Mikado/parsers/bed12.py index 0a9a3e428..0b1ca25be 100644 --- a/Mikado/parsers/bed12.py +++ b/Mikado/parsers/bed12.py @@ -687,9 +687,9 @@ def expand(self, sequence, upstream, downstream, expand_orf=False, logger=create old_sequence = sequence[upstream:len(self) + upstream] - self.start_codon = str(old_sequence[self.thick_start + self.phase:self.thick_start + self.phase + 3]).upper() + self.start_codon = str(old_sequence[self.thick_start + self.phase -1 :self.thick_start + self.phase + 2]).upper() # last_codon_start = self.thick_end + ((self.thick_end - self.thick_start + 1 + self.phase) % 3 - 3) - self.stop_codon = str(old_sequence[self.thick_end - 2:self.thick_end + 1]).upper() + self.stop_codon = str(old_sequence[self.thick_end - 3:self.thick_end]).upper() assert 0 < len(self.stop_codon) <= 3, self.stop_codon diff --git a/Mikado/tests/padding_test.bed12 b/Mikado/tests/padding_test.bed12 index 688294603..ccc9575e4 100644 --- a/Mikado/tests/padding_test.bed12 +++ b/Mikado/tests/padding_test.bed12 @@ -1,5 +1,5 @@ -44 1 61560 ID=mikado.44G2.2;coding=True;phase=0 85.0 + 69 61340 0 22 140,119,137,89,218,261,240,141,156,112,160,165,132,72,126,75,168,105,201,87,114,309 0,19637,20638,24654,26061,27238,28273,28974,29420,30474,32004,33291,34188,35466,42587,43055,44730,46583,50405,53556,59448,61250 -44 1 61560 ID=mikado.44G2.3;coding=True;phase=0 79.0 + 69 61340 0 21 140,119,137,89,218,261,240,141,141,112,160,165,132,126,75,168,105,201,87,114,309 0,19637,20638,24654,26061,27238,28273,28974,29435,30474,32004,33291,34188,42587,43055,44730,46583,50405,53556,59448,61250 -44 1 61560 ID=mikado.44G2.4;coding=True;phase=0 72.0 + 69 61340 0 21 140,119,137,89,218,261,240,171,141,112,160,165,132,126,75,168,105,201,87,114,309 0,19637,20638,24654,26061,27238,28273,28944,29435,30474,32004,33291,34188,42587,43055,44730,46583,50405,53556,59448,61250 -44 1 62511 ID=mikado.44G2.1;coding=True;phase=0 85.0 + 69 61340 0 22 140,119,137,89,218,261,240,141,141,112,160,165,132,72,126,75,168,105,201,87,114,1260 0,19637,20638,24654,26061,27238,28273,28974,29435,30474,32004,33291,34188,35466,42587,43055,44730,46583,50405,53556,59448,61250 -44 1 67118 ID=mikado.44G2.5;coding=True;phase=0 83.0 + 69 61340 0 24 140,119,137,89,218,261,240,141,141,112,160,165,132,72,126,75,168,105,201,87,114,1186,59,430 0,19637,20638,24654,26061,27238,28273,28974,29435,30474,32004,33291,34188,35466,42587,43055,44730,46583,50405,53556,59448,61250,63052,66687 +44 1 61560 ID=mikado.44G2.2;coding=True;phase=0 85.0 + 70 61341 0 22 140,119,137,89,218,261,240,141,156,112,160,165,132,72,126,75,168,105,201,87,114,309 0,19637,20638,24654,26061,27238,28273,28974,29420,30474,32004,33291,34188,35466,42587,43055,44730,46583,50405,53556,59448,61250 +44 1 61560 ID=mikado.44G2.3;coding=True;phase=0 79.0 + 70 61341 0 21 140,119,137,89,218,261,240,141,141,112,160,165,132,126,75,168,105,201,87,114,309 0,19637,20638,24654,26061,27238,28273,28974,29435,30474,32004,33291,34188,42587,43055,44730,46583,50405,53556,59448,61250 +44 1 61560 ID=mikado.44G2.4;coding=True;phase=0 72.0 + 70 61341 0 21 140,119,137,89,218,261,240,171,141,112,160,165,132,126,75,168,105,201,87,114,309 0,19637,20638,24654,26061,27238,28273,28944,29435,30474,32004,33291,34188,42587,43055,44730,46583,50405,53556,59448,61250 +44 1 62511 ID=mikado.44G2.1;coding=True;phase=0 85.0 + 70 61341 0 22 140,119,137,89,218,261,240,141,141,112,160,165,132,72,126,75,168,105,201,87,114,1260 0,19637,20638,24654,26061,27238,28273,28974,29435,30474,32004,33291,34188,35466,42587,43055,44730,46583,50405,53556,59448,61250 +44 1 67118 ID=mikado.44G2.5;coding=True;phase=0 83.0 + 70 61341 0 24 140,119,137,89,218,261,240,141,141,112,160,165,132,72,126,75,168,105,201,87,114,1186,59,430 0,19637,20638,24654,26061,27238,28273,28974,29435,30474,32004,33291,34188,35466,42587,43055,44730,46583,50405,53556,59448,61250,63052,66687