murphycj / AGFusion

Python package to annotate and visualize gene fusions.

Home Page:https://www.agfusion.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: iter() returned non-iterator of type

StevenIg opened this issue · comments

Hello,

I want to use AGfusion on STAR-Fusion and FusionCatcher output files.

But i have this error :

"Traceback (most recent call last):
File "/illumina/software/Miniconda2/envs/MyPython27Env/bin/agfusion", line 5, in
cli.main()
File "/illumina/software/Miniconda2/envs/MyPython27Env/lib/python2.7/site-packages/agfusion/cli.py", line 432, in main
for fusion in agfusion.parsersargs.algorithm:
TypeError: iter() returned non-iterator of type 'STARFusion'"

cmd line use :
agfusion batch --file star_fusion_outdir/star-fusion.fusion_candidates.final -a starfusion -o test -g GRCh38 --dbpath /illumina/databases/Human_hg38/agfusion/agfusion.db

Do you have a solution?

Thanks,
Best Regards,

Steven

Steven, I was able to reproduce this is a bug. I patched the code, so go ahead and reinstall from GitHub and let me know if it works for you now.

Hello,

Thanks for your Update.
For any fusion it works well.

But with some fusion I have this error :
_Traceback (most recent call last):
File "/illumina/software/Miniconda2/envs/MyPython27Env/bin/agfusion", line 5, in
cli.main()
File "/illumina/software/Miniconda2/envs/MyPython27Env/lib/python2.7/site-packages/agfusion/cli.py", line 459, in main
args=args
File "/illumina/software/Miniconda2/envs/MyPython27Env/lib/python2.7/site-packages/agfusion/cli.py", line 55, in annotate
noncanonical=args.noncanonical
File "/illumina/software/Miniconda2/envs/MyPython27Env/lib/python2.7/site-packages/agfusion/model.py", line 326, in init
protein_databases=protein_databases,
File "/illumina/software/Miniconda2/envs/MyPython27Env/lib/python2.7/site-packages/agfusion/model.py", line 851, in init
self.predict_effect()
File "/illumina/software/Miniconda2/envs/MyPython27Env/lib/python2.7/site-packages/agfusion/model.py", line 1372, in predict_effect
self._fetch_transcript_cdna()
File "/illumina/software/Miniconda2/envs/MyPython27Env/lib/python2.7/site-packages/agfusion/model.py", line 1208, in fetch_transcript_cdna
self.cdna_5prime = self.transcript1.sequence[0:self.transcript_cdna_junction_5prime]
TypeError: 'NoneType' object has no attribute 'getitem'

Exemple of line :
LINC02044 NEPRO no_protein,lincrna,100K<gap<200K 0 3 3 30 BOWTIE+BLAT;BOWTIE+STAR 3:113143854:- 3:113019706:- ENSG00000243795 ENSG00000163608 TATTTAAGAGCCACCAGCTGGCATTCCTTGCAGATGG
ATTCCAGAAGTCC*CTCCGGTCGCTGGACGTGCTCTCGCGTAGCTCCGCCTTTCGTAAGTCCCC exonic(no-known-CDS)/UTR

Your software doesn't accepte lincrna?

Thanks,

So this is a limitation of one python package dependency, pysensembl. The package does not download the FASTA sequences for non-coding RNAs (e.g. LINC02044), so an error occurs when AGFusion tries to access the sequence information for those genes as shown by this line in your error output:

self.cdna_5prime = self.transcript1.sequence[0:self.transcript_cdna_junction_5prime]

I've been working with the pyensembl authors to try and fix this. For the time being, I've patched in some error handling of this case (but does not fix the issue), so go ahead and reinstall from GitHub.

So latest version of pyensembl fixes the issue (see here: openvax/pyensembl#185). Reinstalling with the latest development version of pyensembl:

git clone git@github.com:hammerlab/pyensembl.git
cd pyensembl
pip install .
pyensembl install --release 84 --species human

Then the following ran successfully

agfusion annotate -g5 ENSG00000243795 -j5 113143854 -g3 ENSG00000163608 -j3 113019706 -g GRCh38 -o test`