ConesaLab / SQANTI3

Tool for the Quality Control of Long-Read Defined Transcriptomes
GNU General Public License v3.0
197 stars 48 forks source link

Modify write_collapsed_GFF_with_CDS in sqanti3_qc.py #331

Open sbresnahan opened 1 week ago

sbresnahan commented 1 week ago

Suggestion to modify if ...:break statements in write_collapsed_GFF_with_CDS which compare interval start and end coordinates to ensure calls to Interval() do not throw AssertionError: start must be less than end. Current statements do not necessarily ensure that values given to Interval() are appropriate, for example, if exon coordinates are outside the predicted CDS start and end coordinates.

Context: running SQANTI3 with GTF produced by bambu was exiting with this error after classifying isoforms:

Traceback (most recent call last):
  File "sqanti3_qc.py", line 2578, in <module>
    main()
  File "sqanti3_qc.py", line 2561, in main
    run(args)
  File "sqanti3_qc.py", line 1880, in run
    write_collapsed_GFF_with_CDS(isoforms_info, corrGTF, corrGTF+'.cds.gff')
  File "sqanti3_qc.py", line 420, in write_collapsed_GFF_with_CDS
    r.cds_exons = [Interval(s, min(e,exon.end))]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "lib/bx/intervals/intersection.pyx", line 293, in bx.intervals.intersection.Interval.__init__
AssertionError: start must be less than end