I made an error when using metawrap to binning
2
0
Entering edit mode
12 months ago

my code

metawrap binning -o bin_out -t 24 -m 200 -a all_contig/all_merge.fasta --metabat2 --maxbin2 --concoct all_fastq/*fastq

Error reported as follows

sorting the SRR10492802 alignment file
[bam_sort_core] merging from 24 files and 24 in-memory blocks...
[E::sam_hdr_sanitise] Malformed SAM header at line 2
samtools sort: failed to read header from "bin_out/work_files/tmp-samtools.0000.bam"
somthing  went wrong with sortin the alignments
Exiging

There is the header of sam file.

$samtools view -H SRR10492802.sam|head -10
@SQ SN:k141_390421 LN:651
@SQ SN:k141_39985 LN:538
@SQ SN:k141_334641 LN:682
@SQ SN:k141_55776 LN:692
@SQ SN:k141_39781 LN:589
@SQ SN:k141_450722 LN:843
@SQ SN:k141_563831 LN:707
@SQ SN:k141_350441 LN:651
@SQ SN:k141_270821 LN:1427
@SQ SN:k141_111552 LN:779

Request answers for me how to solve the problem. Thank you very much.

metagenome binning metawrap • 936 views
ADD COMMENT
0
Entering edit mode
12 months ago
mixiaoluo88 ▴ 10

It appears that the file "bin_out/work_files/tmp-samtools.0000.bam" is broked or empty. You should use ls -lh to check the file size, not "SRR10492802.sam".

Additionally, you can try rerunning the command without the "--concoct" option, because concoct often performs poorly.

ADD COMMENT
0
Entering edit mode

Thanks for the suggestion, but removing -concoct doesn't seem to solve the problem

ADD REPLY
0
Entering edit mode

You should post some log file to help me understand your situation. By the way, have you checked the size of "bin_out/work_files/tmp-samtools.0000.bam"? If the binning process has stopped, you should remove the tmp file before start a new mission.

ADD REPLY
0
Entering edit mode

The paragraph at the end of the log file may be the problem

[M::mem_pestat] skip orientation RR as there are not enough pairs
[M::mem_pestat]skip orientation FF
[M::mem_pestat]skip orientation RF
[main] Version:0.7.17-r1188
[main] CMD : bwa mem -v 1 -t 24 bin_out/work_files/assembly.fa all_fastq/SRR10492802_1.fastq all_fastq/SRR10492802_2.fastq
[main]Real time:6587.072 sec; CPU: 143464.657 sec
sorting the SRR10492802 alignment file
[bam_sort_core] merging from 24 files and 24 in-memory blocks...
[E::sam_hdr_sanitise] Malformed SAM header at line 2
samtools sort: failed to read header from "bin_out/work_files/tmp-samtools.0000.bam"
somthing  went wrong with sortin the alignments
Exiging

Also, I checked the output file and did not find the presence of the tmp-samtools.0000.bam file, which appears to be a temporary file that seems to have been cleaned after the software interruption

ADD REPLY
0
Entering edit mode
12 months ago

Check that the bam file exists at

bin_out/work_files/tmp-samtools.0000.bam

Also check the file has a header

samtools view -H bin_out/work_files/tmp-samtools.0000.bam

And it looks ok - you'll need to read the package docs there.

ADD COMMENT
0
Entering edit mode

Also, I checked the output file and did not find the presence of the tmp-samtools.0000.bam file, which appears to be a temporary file that seems to have been cleaned after the software interruption

ADD REPLY

Login before adding your answer.

Traffic: 1696 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6