BrooksLabUCSC / flair

Full-Length Alternative Isoform analysis of RNA
Other
201 stars 69 forks source link

flair collapse--NameError: name 'blockcount' is not defined #328

Closed ChenOreo closed 4 months ago

ChenOreo commented 4 months ago

What happened? I am getting following error while running collapse

flair collapse -g fasta/Chr2.fa -q bed/Chr2.bed -r filt.GS_all.fq.gz -o result/Chr2/collapse --gtf gtf/Valid_Chr2.gtf --stringent --check_splice --generate_map --annotation_reliant generate

Gives following error: Writing temporary files to /data/01/user151/temp/tmp0ii1y81q/
Making transcript fasta using annotated gtf and genome sequence Traceback (most recent call last): File "/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/site-packages/flair/gtf_to_bed.py", line 108, in if blockcount > 1 and blockstarts[0] > blockstarts[1]: # need to reverse exons NameError: name 'blockcount' is not defined Traceback (most recent call last): File "/data/00/user/user151/miniconda3/envs/flair/bin/flair", line 10, in sys.exit(main()) File "/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/site-packages/flair/flair.py", line 1035, in main status = collapse() File "/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/site-packages/flair/flair.py", line 522, in collapse subprocess.check_call([sys.executable, path+'gtf_to_bed.py', args.f, args.annotated_bed, '--include_gene']) File "/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/data/00/user/user151/miniconda3/envs/flair/bin/python', '/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/site-packages/flair/gtf_to_bed.py', 'gtf/Valid_Chr2.gtf', 'result/Chr2/collapse.annotated_transcripts.bed', '--include_gene']' returned non-zero exit status 1.

I have filtered out non-3 multiples of cds in the GTF file and the transcript and exon grouped with it. Before I filtered, the error and command were as follows:

flair collapse -g fasta/Chr2.fa -q bed/Chr2.bed -r filt.GS_all.fq.gz -o result/Chr2/collapse --gtf 06.1.deal/2.gtf --stringent --check_splice --generate_map --annotation_reliant generate

Writing temporary files to /data/01/user151/temp/tmpz95yg_kc/
Making transcript fasta using annotated gtf and genome sequence Traceback (most recent call last): File "/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/site-packages/flair/gtf_to_bed.py", line 108, in if blockcount > 1 and blockstarts[0] > blockstarts[1]: # need to reverse exons IndexError: list index out of range Traceback (most recent call last): File "/data/00/user/user151/miniconda3/envs/flair/bin/flair", line 10, in sys.exit(main()) File "/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/site-packages/flair/flair.py", line 1035, in main status = collapse() File "/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/site-packages/flair/flair.py", line 522, in collapse subprocess.check_call([sys.executable, path+'gtf_to_bed.py', args.f, args.annotated_bed, '--include_gene']) File "/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/subprocess.py", line 369, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/data/00/user/user151/miniconda3/envs/flair/bin/python', '/data/00/user/user151/miniconda3/envs/flair/lib/python3.10/site-packages/flair/gtf_to_bed.py', '06.1.deal/2.gtf', 'result/Chr2/collapse.annotated_transcripts.bed', '--include_gene']' returned non-zero exit status 1.

ChenOreo commented 4 months ago

![Uploading flair.png…]()

ChenOreo commented 4 months ago

how to solve this error. Thank you!!!

ChenOreo commented 4 months ago

I solved it, I deleted the last gene

Jeltje commented 4 months ago

Thanks! This is actually a bug in Flair, we're working on it. Reordering your input so the last gene has more than one transcript fixes the issue.