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

empty fasta file:'Remapping.fasta'; local variable 'bam_sorted' referenced before assignment #46

Open
FengqingWang0712 opened this issue Jul 16, 2024 · 5 comments

Comments

@FengqingWang0712
Copy link

Hello,
First, thank you for this cool tool.
However, I got this error. It's the latest version by the way. Can you help me with it?
Input files DNA, FASTA:
Remapping.fasta
Warning: Empty fasta file: 'Remapping.fasta'
Warning: All fasta inputs were empty
Total time for call to driver() for forward index: 00:00:00
Error: Encountered internal Bowtie 2 exception (#1)
Command: /bioinf/home/fwang/software/miniconda3/envs/BASALT-1.1.0/bin/bowtie2-build-s --wrapper basic-0 Remapping.fasta Remapping.fasta
Traceback (most recent call last):
File "/bioinf/home/fwang/software/miniconda3/envs/BASALT-1.1.0/bin/S5_Outlier_remover_DL_checkm.py", line 289, in outlier_predictor
os.system('jgi_summarize_bam_contig_depths --outputDepth Re-mapped_depth.txt '+str(bam_sorted))
UnboundLocalError: local variable 'bam_sorted' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/bioinf/home/fwang/software/miniconda3/envs/BASALT-1.1.0/bin/BASALT", line 141, in
BASALT_main_c(assembly_list, datasets, num_threads, lr_list, hifi_list, hic_list, eb_list, ram, continue_mode, functional_module, autobining_parameters, refinement_paramter, max_ctn, min_cpn, pwd, QC_software)
File "/bioinf/home/fwang/software/miniconda3/envs/BASALT-1.1.0/bin/BASALT_main_c.py", line 441, in BASALT_main_c
outlier_remover_main('BestBinset', coverage_matrix_list, datasets, assembly_mo_list, pwd, num_threads)
File "/bioinf/home/fwang/software/miniconda3/envs/BASALT-1.1.0/bin/S5_Outlier_remover_DL_checkm.py", line 452, in outlier_remover_main
A=outlier_predictor(depth_TNF_matrix, contigs_depth, bin_contigs, datasets, num_threads, nx)
File "/bioinf/home/fwang/software/miniconda3/envs/BASALT-1.1.0/bin/S5_Outlier_remover_DL_checkm.py", line 296, in outlier_predictor
os.system('jgi_summarize_bam_contig_depths --outputDepth Re-mapped_depth.txt '+str(bam_sorted))
UnboundLocalError: local variable 'bam_sorted' referenced before assignment

@noddevil4949
Copy link

Hi,

It looks like that there is no fasta file generated in the previous step. Could you please have a check the content in the "BestBinset" folder? If this folder is empty, it means you have either encountered an error at the previous step, or even earlier.

Cheers,
BASALT team

@FengqingWang0712
Copy link
Author

Thank you for your reply.
The "BestBinset" folder is not empty. Actually it includes many refined bins and statistic files with bins' quality.

Best

@noddevil4949
Copy link

Hmm it looks weird. Could you please add my Wechat "noddevil4949" so we can have a look at details?

@Eirwyn-sheen
Copy link

Eirwyn-sheen commented Aug 1, 2024

Hello, I encounter a similar problem. Can you help me?
Order: BASALT -a asm.p_ctg.fasta -hf ~/share/xmc_seq/xmc_hifi_reads.fq.gz -t 60
Input files DNA, FASTA:
Remapping.fasta
Warning: Empty fasta file: 'Remapping.fasta'
Warning: All fasta inputs were empty
Total time for call to driver() for forward index: 00:00:00
Error: Encountered internal Bowtie 2 exception (#1)
Command: /home/wangbx/xxq_xmc/bin/mimcromamba/envs/BASALT/bin/bowtie2-build-s --wrapper basic-0 Remapping.fasta Remapping.fasta
Predicting potential outliers
Judging 1_asm.p_ctg.fasta_100_concoct_genomes.21.fasta
Judging 1_asm.p_ctg.fasta_200_concoct_genomes.29.fasta
Judging 1_asm.p_ctg.fasta_200_concoct_genomes.18.fasta
Judging 1_asm.p_ctg.fasta_200_concoct_genomes.8.fasta
Judging 1_asm.p_ctg.fasta_0.9_maxbin2_genomes.5.fasta
Judging 1_asm.p_ctg.fasta_0.9_maxbin2_genomes.6.fasta
Judging 1_asm.p_ctg.fasta_0.9_maxbin2_genomes.7.fasta
Judging 1_asm.p_ctg.fasta_100_concoct_genomes.22.fasta
Judging 1_asm.p_ctg.fasta_200_concoct_genomes.25.fasta
Re-mapping
Traceback (most recent call last):
File "/home/wangbx/xxq_xmc/bin/mimcromamba/envs/BASALT/bin/S5_Outlier_remover_DL_checkm.py", line 289, in outlier_predictor
os.system('jgi_summarize_bam_contig_depths --outputDepth Re-mapped_depth.txt '+str(bam_sorted))
UnboundLocalError: local variable 'bam_sorted' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/wangbx/xxq_xmc/bin/mimcromamba/envs/BASALT/bin/BASALT", line 141, in
BASALT_main_c(assembly_list, datasets, num_threads, lr_list, hifi_list, hic_list, eb_list, ram, continue_mode, functional_module, autobining_parameters, refinement_paramter, max_ctn, min_cpn, pwd, QC_software)
File "/home/wangbx/xxq_xmc/bin/mimcromamba/envs/BASALT/bin/BASALT_main_c.py", line 441, in BASALT_main_c
outlier_remover_main('BestBinset', coverage_matrix_list, datasets, assembly_mo_list, pwd, num_threads)
File "/home/wangbx/xxq_xmc/bin/mimcromamba/envs/BASALT/bin/S5_Outlier_remover_DL_checkm.py", line 452, in outlier_remover_main
A=outlier_predictor(depth_TNF_matrix, contigs_depth, bin_contigs, datasets, num_threads, nx)
File "/home/wangbx/xxq_xmc/bin/mimcromamba/envs/BASALT/bin/S5_Outlier_remover_DL_checkm.py", line 296, in outlier_predictor
os.system('jgi_summarize_bam_contig_depths --outputDepth Re-mapped_depth.txt '+str(bam_sorted))
UnboundLocalError: local variable 'bam_sorted' referenced before assignment

@mnter
Copy link

mnter commented Jan 4, 2025

Hello,
I have met a similar problem "UnboundLocalError: local variable 'bam_sorted' referenced before assignment".
But in my case, the Remapping.fasta file was indexed successively.
Also, the "BestBinset" folder is not empty.
Has the problem been solved?
Thank you

Total time for backward call to driver() for mirror index: 00:00:23
Renaming Remapping.fasta.3.bt2.tmp to Remapping.fasta.3.bt2
Renaming Remapping.fasta.4.bt2.tmp to Remapping.fasta.4.bt2
Renaming Remapping.fasta.1.bt2.tmp to Remapping.fasta.1.bt2
Renaming Remapping.fasta.2.bt2.tmp to Remapping.fasta.2.bt2
Renaming Remapping.fasta.rev.1.bt2.tmp to Remapping.fasta.rev.1.bt2
Renaming Remapping.fasta.rev.2.bt2.tmp to Remapping.fasta.rev.2.bt2
Traceback (most recent call last):
File "/home/sophy/mambaforge/envs/BASALT/bin/S5_Outlier_remover_DL_checkm.py", line 289, in outlier_predictor
os.system('jgi_summarize_bam_contig_depths --outputDepth Re-mapped_depth.txt '+str(bam_sorted))
UnboundLocalError: local variable 'bam_sorted' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/sophy/mambaforge/envs/BASALT/bin/BASALT", line 141, in
BASALT_main_c(assembly_list, datasets, num_threads, lr_list, hifi_list, hic_list, eb_list, ram, continue_mode, functional_module, autobining_parameters, refinement_paramter, max_ctn, min_cpn, pwd, QC_software)
File "/home/sophy/mambaforge/envs/BASALT/bin/BASALT_main_c.py", line 441, in BASALT_main_c
outlier_remover_main('BestBinset', coverage_matrix_list, datasets, assembly_mo_list, pwd, num_threads)
File "/home/sophy/mambaforge/envs/BASALT/bin/S5_Outlier_remover_DL_checkm.py", line 452, in outlier_remover_main
A=outlier_predictor(depth_TNF_matrix, contigs_depth, bin_contigs, datasets, num_threads, nx)
File "/home/sophy/mambaforge/envs/BASALT/bin/S5_Outlier_remover_DL_checkm.py", line 296, in outlier_predictor
os.system('jgi_summarize_bam_contig_depths --outputDepth Re-mapped_depth.txt '+str(bam_sorted))
UnboundLocalError: local variable 'bam_sorted' referenced before assignment

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

4 participants