Hi,
Thanks for your answers. I am have the same problem in DEXseq. Firstly, since I don't have the gtf file of honey bee, I use gffread to convert the gff file to the gtf file. however, I had the same problem as shown below: https://support.bioconductor.org/p/96488/
Then, I followed your comment and I convert back gff file:
./gffread -E /Users/LQS/Desktop/Apis_4.5_QS.gtf -o- > /Users/LQS/Desktop/DEXseq_2nd_Apis45.gff3
After that, I stored your perl script in R studio and changed the directory of the input file.
The input file was the one strored in .txt file format and specified the directory of the output gtf file which I want to use for the dexseq_prepare_annotation
I did like this:
open(F,"/Users/LQS/Desktop/DEXseq_2nd_Apis45.txt"); # Input file open(F1,"》/Users/LQS/Desktop/data.gtf"); # Output gtf file
after running: perl XXX.pl I used the data.gtf for the dexseq_annotation_prepare, the same error happened again:
Traceback (most recent call last): File "/pub40/acdguest/Qiushi/scripts/DEXseq_script/dexseq_prepare_annotation.py", line 54, in <module> f.attr['gene_id'] = f.attr['gene_id'].replace( ":", "_" ) KeyError: 'gene_id'
Could you please help me on this?? Many thanks in advance.
Qiushi Liu
gffread -E merged.gtf -o- > merged.gff3
~Chirag.
Looks like you have not tried anything. You could explore very simple ways of achieving it, like using bedtools groupBy
OutPut:
You can tweak around these commands and use pipes or whatever and achieve what you are looking for. If you don't know what a tool or codes given by others is doing, better not to use blindly.
For anyone reading this years after,
gffreadcould infer transcripts but no genes if the genes were not in your original file (eg in the example above). Nowgffreadcan do it properly with the option --keep-genes (updated - git commit from May 19, 2020). So to get both transcripts AND genes, you can run: