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

Error while reading GFF file #52

Open
mnshgl0110 opened this issue Jun 9, 2023 · 7 comments
Open

Error while reading GFF file #52

mnshgl0110 opened this issue Jun 9, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@mnshgl0110
Copy link
Member

mnshgl0110 commented Jun 9, 2023

#50 (comment)

Thank you very much/ Actually there were an empty line (sorry for the inconveniences).

However, now I get a new error:
track - WARNING - Reading GFF file Dtol_annotation_genes_polished.gff. Overlapping transcripts would be plotted as such without any filtering.
Traceback (most recent call last):
File "/home/bogaerts/miniconda3/bin/plotsr", line 4, in
import('pkg_resources').run_script('plotsr==0.5.3', 'plotsr')
File "/home/bogaerts/miniconda3/lib/python3.9/site-packages/pkg_resources/init.py", line 662, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/home/bogaerts/miniconda3/lib/python3.9/site-packages/pkg_resources/init.py", line 1466, in run_script
exec(script_code, namespace, namespace)
File "/home/bogaerts/miniconda3/lib/python3.9/site-packages/plotsr-0.5.3-py3.9.egg/EGG-INFO/scripts/plotsr", line 6, in
File "/home/bogaerts/miniconda3/lib/python3.9/site-packages/plotsr-0.5.3-py3.9.egg/plotsr/main.py", line 55, in main
File "/home/bogaerts/miniconda3/lib/python3.9/site-packages/plotsr-0.5.3-py3.9.egg/plotsr/plotsr.py", line 257, in plotsr
File "/home/bogaerts/miniconda3/lib/python3.9/site-packages/plotsr-0.5.3-py3.9.egg/plotsr/func.py", line 729, in readtrack
File "/home/bogaerts/miniconda3/lib/python3.9/site-packages/plotsr-0.5.3-py3.9.egg/plotsr/func.py", line 699, in readdata
File "/home/bogaerts/miniconda3/lib/python3.9/site-packages/plotsr-0.5.3-py3.9.egg/plotsr/func.py", line 688, in _readgff
AttributeError: 'NoneType' object has no attribute 'keys'

Thank you in advance.

@m-bogaerts

@mnshgl0110
Copy link
Member Author

It seems that there is some issue in the formatting of the GFF file. Could you please compare your input GFF with the example GFF. Also, ensure that the transcripts have 'mrna' and 'cds' elements.

@m-bogaerts
Copy link

Hello again,

Thank you for your response, however y still have the same issue. I checked the example GFF file and I think it is very similar so I am not sure which could be the issue. I leave here some lines of m GFF file:

chr1 Liftoff exon 15251069 15251169 . - . ID=exon-XR_006747185.1-1;Parent=rna-XR_006747185.1;Dbxref=GeneID:123678035,Genbank:XR_006747185.1;experiment=COORDINATES: polyA evidence [ECO:0006239];gbkey=misc_RNA;gene=LOC123678035;product=protein disulfide-isomerase-like%2C transcript variant X2;transcript_id=XR_006747185.1;extra_copy_number=0
chr1 Liftoff gene 15253501 15258586 . - . ID=gene-LOC123677994;Dbxref=GeneID:123677994;Name=LOC123677994;gbkey=Gene;gene=LOC123677994;gene_biotype=protein_coding;coverage=1.0;sequence_ID=1.0;valid_ORFs=1;extra_copy_number=0;copy_num_ID=gene-LOC123677994_0
chr1 Liftoff mRNA 15253501 15258586 . - . ID=rna-XM_045614755.1;Parent=gene-LOC123677994;Dbxref=GeneID:123677994,Genbank:XM_045614755.1;Name=XM_045614755.1;experiment=COORDINATES: polyA evidence [ECO:0006239];gbkey=mRNA;gene=LOC123677994;model_evidence=Supporting evidence includes similarity to: 14 Proteins%2C 4 long SRA reads%2C and 100%25 coverage of the annotated genomic feature by RNAseq alignments%2C including 51 samples with support for all annotated introns;product=protein disulfide-isomerase A5;transcript_id=XM_045614755.1;matches_ref_protein=True;valid_ORF=True;extra_copy_number=0

Thank you in advance.

@mnshgl0110
Copy link
Member Author

Difficult to say what are the issues with the GFF. I assume you have ensured that genes have mrna and cds elements. Also, remove any empty lines from the GFF.

@asan-emirsaleh
Copy link

Hello! I faced the same issue too.

Overlapping transcripts would be plotted as such without any filtering.
Traceback (most recent call last):
  File "/home/asan/miniconda3/envs/syri-env/bin/plotsr", line 6, in <module>
    main(sys.argv[1:])
  File "/home/asan/miniconda3/envs/syri-env/lib/python3.8/site-packages/plotsr/scripts/plotsr.py", line 334, in main
    plotsr(args)
  File "/home/asan/miniconda3/envs/syri-env/lib/python3.8/site-packages/plotsr/scripts/plotsr.py", line 276, in plotsr
    tracks = readtrack(TRACKS, chrlengths)
  File "/home/asan/miniconda3/envs/syri-env/lib/python3.8/site-packages/plotsr/scripts/func.py", line 857, in readtrack
    t.readdata(chrlengths)
  File "/home/asan/miniconda3/envs/syri-env/lib/python3.8/site-packages/plotsr/scripts/func.py", line 827, in readdata
    self._readgff(chrlengths)
  File "/home/asan/miniconda3/envs/syri-env/lib/python3.8/site-packages/plotsr/scripts/func.py", line 816, in _readgff
    k = list(model.keys())[0]
AttributeError: 'NoneType' object has no attribute 'keys'

There is no empty line in the gff.

@novigit
Copy link

novigit commented Apr 26, 2024

I also got the same error message @asan-emirsaleh but I was able to resolve it. In my case, the features I was trying to load were rRNA features. Simply replacing the rRNA with mrna resolved the issue for me.

@mnshgl0110 is it possible to allow more featuretypes in future releases?

@mnshgl0110
Copy link
Member Author

@asan-emirsaleh Is your issue resolved?

@novigit Yes, theoretically that is possible. The tricky part is to find time to do that. Nevertheless, it would be great if you could list which feature types would be useful.

@novigit
Copy link

novigit commented Apr 29, 2024

I'd say with rRNA, tRNA, exon, mRNA, CDS and gene you'd cover most common featuretypes

@mnshgl0110 mnshgl0110 added the enhancement New feature or request label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants