BrooksLabUCSC / flair

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

TypeError: get_sequence_with_variants() takes 2 positional arguments but 3 were given #263

Closed youyupei closed 11 months ago

youyupei commented 1 year ago

Copy and paste the exact command I tried to run: flair collapse -r test_input/reads.fa -q test_input/test.corrected.bed -g test_input/genome.fa -t 4 --longshot_vcf test_input/longshot.vcf --longshot_bam test_input/longshot.bam --generate_map --temp_dir test_output/temp_collapse --check_splice --annotation_reliant generate -f test_input/annotation.gtf -o test_output/test.collapse

How did you install Flair? conda create -n flair -c conda-forge -c bioconda flair

What happened?

flair collapse -r test_input/reads.fa -q test_input/test.corrected.bed -g test_input/genome.fa -t 4  --longshot_vcf test_input/longshot.vcf --longshot_bam test_input/longshot.bam --generate_map --temp_dir test_output/temp_collapse --check_splice --annotation_reliant generate -f test_input/annotation.gtf -o test_output/test.collapse
Making transcript fasta using annotated gtf and genome sequence
Aligning reads to reference transcripts
Counting supporting reads for annotated transcripts
Setting up unassigned reads for flair-collapse novel isoform detection
Annotated ends extracted from GTF
Read data extracted
Single-exon genes grouped, collapsing
Renaming isoforms using gtf
Aligning reads to first-pass isoform reference
[M::mm_idx_gen::0.003*1.34] collected minimizers
[M::mm_idx_gen::0.005*2.03] sorted minimizers
[M::main::0.005*2.02] loaded/built the index for 41 target sequence(s)
[M::mm_mapopt_update::0.005*1.98] mid_occ = 13
[M::mm_idx_stat] kmer size: 15; skip: 10; is_hpc: 0; #seq: 41
[M::mm_idx_stat::0.005*1.96] distinct minimizers: 2441 (7.95% are singletons); average occurrences: 4.671; average spacing: 5.388; total length: 61441
[M::worker_pipeline::0.576*3.82] mapped 1368 sequences
[M::main] Version: 2.26-r1175
[M::main] CMD: minimap2 -a -t 4 -N 4 test_output/test.collapse.firstpass.fa test_output/test.collapse.unassigned.fasta
[M::main] Real time: 0.577 sec; CPU: 2.201 sec; Peak RSS: 0.020 GB
Filtering isoforms by read coverage
Traceback (most recent call last):
  File "/home/ubuntu/vol_data/miniconda3/envs/flair/lib/python3.10/site-packages/flair/bed_to_sequence.py", line 260, in <module>
    write_sequences(chrom)
  File "/home/ubuntu/vol_data/miniconda3/envs/flair/lib/python3.10/site-packages/flair/bed_to_sequence.py", line 218, in write_sequences
    pulled_seqs = get_sequence_with_variants(entry, seq, name)
TypeError: get_sequence_with_variants() takes 2 positional arguments but 3 were given
Traceback (most recent call last):
  File "/home/ubuntu/vol_data/miniconda3/envs/flair/bin/flair", line 10, in <module>
    sys.exit(main())
  File "/home/ubuntu/vol_data/miniconda3/envs/flair/lib/python3.10/site-packages/flair/flair.py", line 1035, in main
    status = collapse()
  File "/home/ubuntu/vol_data/miniconda3/envs/flair/lib/python3.10/site-packages/flair/flair.py", line 661, in collapse
    subprocess.check_call(to_sequence_cmd)
  File "/home/ubuntu/vol_data/miniconda3/envs/flair/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/ubuntu/vol_data/miniconda3/envs/flair/bin/python', '/home/ubuntu/vol_data/miniconda3/envs/flair/lib/python3.10/site-packages/flair/bed_to_sequence.py', 'test_output/test.collapse.isoforms.bed', 'test_input/genome.fa', 'test_output/test.collapse.isoforms.fa', '--vcf', 'test_input/longshot.vcf', '--isoform_haplotypes', 'test_output/test.collapse.phase_sets.txt', '--vcf_out', 'test_output/test.collapse.flair.vcf']' returned non-zero exit status 1.
make: *** [makefile:48: test-collapse] Error 1

We know it's ugly but we promise it helps us solve problems faster.

What else do we need to know? Go ahead, every bit helps.

Jeltje commented 11 months ago

I just commited a correction for bed_to_sequence.py. It should work if you replace your bed_to_sequence.py with this:

https://raw.githubusercontent.com/BrooksLabUCSC/flair/master/src/flair/bed_to_sequence.py

Unfortunately I don't currently have longshot data to test on. If you can share yours let me know in a comment. Either way, if it still doesn't work please reopen this ticket.

sparthib commented 2 months ago

Hi, I am getting a similar error.

This is my command:

flair collapse -g $REFERENCE_FASTA -f $REFERENCE_GTF -q $bed_file -r $REFERENCE_FASTQ \
--stringent --check_splice --generate_map --annotation_reliant generate --threads 20 \
--longshot_vcf $longshot_output/${sample}.vcf --longshot_bam $longshot_output/${sample}.bam \
-o $collapsed_output 

This is my error:

[M::main] Real time: 20735.606 sec; CPU: 404826.784 sec; Peak RSS: 18.175 GB
Filtering isoforms by read coverage
Traceback (most recent call last):
  File "/users/sparthib/.conda/envs/flair/lib/python3.10/site-packages/flair/bed_to_sequence.py", line 260, in <module>
    write_sequences(chrom)
  File "/users/sparthib/.conda/envs/flair/lib/python3.10/site-packages/flair/bed_to_sequence.py", line 218, in write_sequences
    pulled_seqs = get_sequence_with_variants(entry, seq, name)
TypeError: get_sequence_with_variants() takes 2 positional arguments but 3 were given
Traceback (most recent call last):
  File "/users/sparthib/.conda/envs/flair/bin/flair", line 10, in <module>
    sys.exit(main())
  File "/users/sparthib/.conda/envs/flair/lib/python3.10/site-packages/flair/flair.py", line 1035, in main
    status = collapse()
  File "/users/sparthib/.conda/envs/flair/lib/python3.10/site-packages/flair/flair.py", line 661, in collapse
    subprocess.check_call(to_sequence_cmd)
  File "/users/sparthib/.conda/envs/flair/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/users/sparthib/.conda/envs/flair/bin/python', '/users/sparthib/.conda/envs/flair/lib/python3.10/site-packages/flair/bed_to_sequence.py', '/dcs04/hicks/data/sparthib/retina_lrs/06_quantification/flair2/collapsed_output/hRGC.isoforms.bed', '/dcs04/hicks/data/sparthib/references/genome/GENCODE/GRCh38.p14.genome.fa', '/dcs04/hicks/data/sparthib/retina_lrs/06_quantification/flair2/collapsed_output/hRGC.isoforms.fa', '--vcf', '/dcs04/hicks/data/sparthib/retina_lrs/06_quantification/flair2/longshot_vcfs/hRGC/hRGC.vcf', '--isoform_haplotypes', '/dcs04/hicks/data/sparthib/retina_lrs/06_quantification/flair2/collapsed_output/hRGC.phase_sets.txt', '--vcf_out', '/dcs04/hicks/data/sparthib/retina_lrs/06_quantification/flair2/collapsed_output/hRGC.flair.vcf']' returned non-zero exit status 1.

Any help is appreciated, thanks!