pdxgx / neoepiscope

predicts neoepitopes from phased somatic mutations detected using tumor/normal DNA-seq data
Other
26 stars 17 forks source link

Transcript.py expressed edit function has list index problems during edits out of interval ranges #3

Closed Boeinco closed 5 years ago

Boeinco commented 5 years ago

Using test_transcript.py in tests (although this is repeatable with own GTF) Mutation is edited to be not in interval sequence. Call to annotated_seq or expressed edit in the ranges around the "mutation" create error.

`

test = TestTranscript() test.setUp() test.transcript <neoepiscope.transcript.Transcript object at 0x1123dae10> trans = test.transcript trans <neoepiscope.transcript.Transcript object at 0x1123dae10> trans.intervals [5246692, 5246955, 5247805, 5248028, 5248158, 5248300] mutloc = 5246980 start = mutloc-33 end = mutloc+32 trans.annotated_seq(start, end) [('CTCCTGGGCA', 'R', [()], 5246956)] start 5246947 trans.edit("ATGCGGGG", mutloc, mutation_type="I") trans.annotated_seq(start, end) Traceback (most recent call last): File "<pyshell#12>", line 1, in trans.annotated_seq(start, end) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/neoepiscope/transcript.py", line 1116, in annotated_seq include_germline=include_germline, File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/neoepiscope/transcript.py", line 783, in expressed_edits if start_index % 2 or pos == intervals[start_index][0]: IndexError: list index out of range `

maryawood commented 5 years ago

Fixed the bug and updated the unit tests with this example