Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convert gtf to gff3 #3

Open
nextgenusfs opened this issue Jan 29, 2024 · 3 comments
Open

convert gtf to gff3 #3

nextgenusfs opened this issue Jan 29, 2024 · 3 comments

Comments

@nextgenusfs
Copy link
Owner

Tried to convert a non coding RNA GTF file and failed with:

Traceback (most recent call last):
  File "/bioinfo/apps/all_apps/miniconda3/envs/gtools/bin/gfftk", line 8, in <module>
    sys.exit(main())
  File "/bioinfo/apps/all_apps/miniconda3/envs/gtools/lib/python3.6/site-packages/gfftk/__main__.py", line 22, in main
    convert(args)
  File "/bioinfo/apps/all_apps/miniconda3/envs/gtools/lib/python3.6/site-packages/gfftk/convert.py", line 140, in convert
    debug=args.debug,
  File "/bioinfo/apps/all_apps/miniconda3/envs/gtools/lib/python3.6/site-packages/gfftk/convert.py", line 577, in gtf2gff
    dict2gff3(Genes, output=output)
  File "/bioinfo/apps/all_apps/miniconda3/envs/gtools/lib/python3.6/site-packages/gfftk/gff.py", line 2495, in dict2gff3
    if len(v["go_terms"][i]) > 0:
IndexError: list index out of range

So need to check the dictionary being constructed with GTF and/or put a try/except on the extra annotations....

@YingChen94
Copy link

Hello, I got the same error. Is there a way to fix it? Thanks!

@nextgenusfs
Copy link
Owner Author

Possibly, what does your GTF file look like and where is it from?

@YingChen94
Copy link

YingChen94 commented Oct 19, 2024

The gtf file is the output from BRAKER3 annotation pipeline. The first 10 lines look like this:

chr1	GeneMark.hmm3	gene	63	31891	.	-	.	g1
chr1	GeneMark.hmm3	transcript	63	31891	.	-	.	g1.t1
chr1	GeneMark.hmm3	stop_codon	63	65	.	-	0	transcript_id "g1.t1"; gene_id "g1";
chr1	GeneMark.hmm3	CDS	63	239	.	-	0	transcript_id "g1.t1"; gene_id "g1";
chr1	GeneMark.hmm3	exon	63	239	.	-	0	transcript_id "g1.t1"; gene_id "g1";
chr1	GeneMark.hmm3	mRNA	63	31891	.	-	.	transcript_id "g1.t1"; gene_id "g1";
chr1	GeneMark.hmm3	intron	240	320	.	-	0	transcript_id "g1.t1"; gene_id "g1";
chr1	GeneMark.hmm3	CDS	321	529	.	-	2	transcript_id "g1.t1"; gene_id "g1";
chr1	GeneMark.hmm3	exon	321	529	.	-	2	transcript_id "g1.t1"; gene_id "g1";
chr1	GeneMark.hmm3	intron	530	1730	.	-	1	transcript_id "g1.t1"; gene_id "g1";

I found the solution here: Gaius-Augustus/BRAKER#640. Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants