chapmanb / bcbb

Incubator for useful bioinformatics code, primarily in Python and R
http://bcbio.wordpress.com
609 stars 243 forks source link

fix crashes when parsing gtf files which contain gene lines #126

Closed DavyCats closed 5 years ago

DavyCats commented 5 years ago

simple_parse fails for gtf files containing "flat features" (lines with neither a transcript_id nor an id field). Since these are not accounted for in the if/elif statements, the else clause will be run and since assert "directive" in rec will be false, an error is raised. I don't see a reason why the simple_parse function would not return these features, so to fix it I simply added an additional clause which yields them.