Thank you so much for this. I tried to run it but I get a key error which is probably due to my gtf file.
Traceback (most recent call last):
File "/Users/margaretsaha/Desktop/gtf_fixer_to_gffread.py", line 23, in <module>
transcript_size = int(transcript[header])
KeyError: 'Scaffold100'
My gtf file includes scaffolds as well as chromosomes which may complicate this, however my fasta file also has these scaffolds. Is there a workaround where I can just skip the scaffolds or include them?
Here is the first line of my gtf file:
Scaffold100 StringTie transcript 65415 65755 . + . transcript_id "MSTRG.5.1"; gene_id "MSTRG.5"; xloc "XLOC_000001"; class_code "u"; tss_id "TSS1";
Scaffold100 StringTie exon 65415 65755 . + . transcript_id "MSTRG.5.1"; gene_id "MSTRG.5"; exon_number "1";