bxlab / metaWRAP

MetaWRAP - a flexible pipeline for genome-resolved metagenomic data analysis
MIT License
389 stars 189 forks source link

When running metabat2: Segmentation fault #217

Open luanxiao opened 5 years ago

luanxiao commented 5 years ago

hello, handsome friend, When I run the binning module with “metawrap binning -o INITIAL_BINNING -t 24 -a ASSEMBLY/final_assembly.fasta --maxbin2 --metabat2 --run-checkm reads/*.fastq”,segmentation fault appeared. I try everything include re-install conda envs or check samtools, however it does not work. There was no problem with the previous days, but this happens after we reinstalling the debian system recently, but running maxbin is fine. I asked the server administrator, but they don't know how to fix it. So I hope to get some suggestions from you, The metawrap version is MetaWRAP v=1.2.1 and i think is the latest version. really thank you very much!

Here is the error list,

[bam_sort_core] merging from 0 files and 24 in-memory blocks...

########################################################################################################################
#####                                               RUNNING METABAT2                                               #####
########################################################################################################################

------------------------------------------------------------------------------------------------------------------------
-----                                          making contig depth file...                                         -----
------------------------------------------------------------------------------------------------------------------------

Output depth matrix to INITIAL_BINNING/work_files/metabat_depth.txt
Output matrix to INITIAL_BINNING/work_files/metabat_depth.txt
Opening 14 bams
Consolidating headers
Processing bam files
Thread 1 finished: BC402.bam with 34711591 reads and 27245255 readsWellMapped
Thread 11 finished: E452.bam with 33489724 reads and 26143859 readsWellMapped
Thread 0 finished: BC401.bam with 36995172 reads and 24446635 readsWellMapped
Thread 12 finished: Sludge1.bam with 34395145 reads and 20048804 readsWellMapped
Thread 10 finished: E451.bam with 43745232 reads and 34584007 readsWellMapped
Thread 7 finished: E432.bam with 42485676 reads and 33769520 readsWellMapped
Thread 9 finished: E442.bam with 46252566 reads and 36930826 readsWellMapped
Thread 5 finished: E422.bam with 36051916 reads and 27718019 readsWellMapped
Thread 6 finished: E431.bam with 41483437 reads and 32449501 readsWellMapped
Thread 8 finished: E441.bam with 41300183 reads and 32819313 readsWellMapped
Thread 4 finished: E421.bam with 44567883 reads and 34806129 readsWellMapped
Thread 3 finished: E412.bam with 41605642 reads and 31529725 readsWellMapped
Thread 13 finished: Sludge2.bam with 34579075 reads and 19890118 readsWellMapped
Thread 2 finished: E411.bam with 40954290 reads and 30629697 readsWellMapped
Creating depth matrix file: INITIAL_BINNING/work_files/metabat_depth.txt
Closing most bam files
Closing last bam file
Finished

------------------------------------------------------------------------------------------------------------------------
-----                                       Starting binning with metaBAT2...                                      -----
------------------------------------------------------------------------------------------------------------------------

MetaBAT 2 (v2.12.1) using minContig 1500, minCV 1.0, minCVSum 1.0, maxP 95%, minS 60, and maxEdges 200. 
/home/xiao/opt/anaconda2/envs/metawrap2/bin/metawrap-modules/binning.sh: line 295: 30654 Segmentation fault      metabat2 -i ${out}/work_files/assembly.fa -a ${out}/work_files/metabat_depth.txt -
:
ursky commented 5 years ago

Interesting. I have never seen this error from metaBAT... Could you open an issue on their page to see if they can provide some insight? The metaWRAP wrapper appears to be working correctly.

luanxiao commented 5 years ago

Thankyou for kind reply it. I have searched the problem they met about the “segmentation fault”, many of them due to the early version of metawrap and due to the samtools of server, but never of the issues occurred in the newest version 1.2.1 of metawrap. In fact, metabat and maxbin are working fine before we reinstall the server's linux system, except for concoct's openblas problem. So I suspect if there's some kind of access permission such as memory is missing. However, Our administrators also don't know how to solve it. The only tools we can ues is maxbin now. Really looking forward to the new version to see ifcan solve the problems we encountered before. Thanks again!

ursky commented 5 years ago

The openblas problem has been solved by me and the concoct developer previously. Have a look at https://github.com/BinPro/CONCOCT/issues/232.

luanxiao commented 5 years ago

Yes, concoct work normally. Thank for kind help!

RolandWirth commented 4 years ago

Hi all! I have the same problem like "luanxiao". Metawrap don't want to make done the binning process with metabat because of segmantation error. This problem occured after reinstallation of our server. Is there any solution for this? Thank you!

zzjl20 commented 3 years ago

Hi dear friend. I got same mistake as luanxiao. But mine is metabat2 stop working. The weird thing is I use same enviroument run concoct, maxbin, just replace by --concoct --maxbin, they successed. According to the workflow chart, the metaBAT2 need depth.txt and .fasta as input. I checked both of them, no problem. I also checked BinPro/CONCOCT#232., not a help. Any sugguestion is welcome.

command:

nohup metawrap binning -o /NGS/ACHQ/Binning/Initial/metabat2 -t 32 -a /NGS/ACHQ/Assemble/final_assembly.fasta --metaba2 /NGS/ACHQ/Read_QC/final_pure_reads_*.fastq &

result:


[bam_sort_core] merging from 32 files and 32 in-memory blocks...

########################################################################################################################
#####                                               RUNNING METABAT2                                               #####
########################################################################################################################

------------------------------------------------------------------------------------------------------------------------
-----                                          making contig depth file...                                         -----
------------------------------------------------------------------------------------------------------------------------

Output depth matrix to /NGS/ACHQ/Binning/work_files/metabat_depth.txt
Output matrix to /NGS/ACHQ/Binning/work_files/metabat_depth.txt
Opening 1 bams
Consolidating headers
Processing bam files
Thread 0 finished: ACHQ.bam with 90827001 reads and 26380778 readsWellMapped
Creating depth matrix file: /NGS/ACHQ/Binning/work_files/metabat_depth.txt
Closing most bam files
Closing last bam file
Finished

------------------------------------------------------------------------------------------------------------------------
-----                                       Starting binning with metaBAT2...                                      -----
------------------------------------------------------------------------------------------------------------------------

MetaBAT 2 (v2.12.1) using minContig 1500, minCV 1.0, minCVSum 1.0, maxP 95%, minS 60, and maxEdges 200. 
/NGS/soft/metaWRAP/bin/metawrap-modules/binning.sh: line 296:  4655 Segmentation fault      metabat2 -i ${out}/work_files/assembly.fa -a ${out}/work_files/metabat_depth.txt -o ${out}/metabat2_bins/bin -m $metabat_len -t $threads --unbinned

************************************************************************************************************************
*****                              Something went wrong with running MetaBAT2. Exiting                             *****
************************************************************************************************************************

real    90m58.218s
user    556m41.946s
sys 1m41.809s
famiji commented 1 year ago

i met the same question, if you have any way to solve it, please let me know

cberta11 commented 9 months ago

Hello, if you were trying to run this on WSL and getting a sigfault from MetaBat2 both in metaWRAP and stand-alone, I think I might have a solution worth trying. WSL does not include zsyscall, a type of legacy system call memory (I am not a computer scientist. I study viruses so forgive me if this is explained poorly). You can check if this is true for your VM by running $cat /proc/self/maps You are looking for an address with a frankly excessive amount of "f"s and [vsyscall]. MetaBat2 calls on this memory, and this was causing a SIGSEGV error for me (according to GDB). I fixed this by editing the .wslconfig file (path C/users/<>/.wslconfig) to include the lines: "# Settings apply across all Linux distros running on WSL 2 [wsl2]"

"# Sets additional kernel parameters, in this case enabling older Linux base images such as Centos 6 kernelCommandLine = vsyscall=emulate"

This fixed the segfault issue for me in both metaWRAP and stand alone MetaBat2. Hope this is helpful, Joe