Hi
how to convert soap2 output to SAM file. Their was perl script soap2sam.pl, is not working it generating a truncated SAM file. Is their a way to do it ?
Hi
how to convert soap2 output to SAM file. Their was perl script soap2sam.pl, is not working it generating a truncated SAM file. Is their a way to do it ?
It looks like soap2sam.pl
is generating a SAM without the header. If you can obtain a reference fasta, then you can add the header using
samtools -bT reference.fa SRR2052405.soap.sam > SRR2052405.bam
.
The -b
option is what changes it to bam, so remove that if you need to stay in SAM for some reason.
If you can't use a reference fasta, then what do you need from this SAM file? Because you can still extract a lot of information from a headerless SAM file, without relying on samtools view.
The correct samtools command is: samtools view -b -T reference.fa SRR2052405.soap.sam > SRR2052405.bam.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Share the exact commands
After generating the SRR2052405.soap I converted to sam using soap2sam.pl
1) soap2sam.pl SRR2052405.soap > SRR2052405.soap.sam
2) samtools view SRR2052405.soap.sam [E::sam_parse1] missing SAM header [W::sam_read1] Parse error at line 1 [main_samview] truncated file.
3) samtools view -u SRR2052405.soap.sam | samtools sort -@ 10 -T /tmp/SRR2052405.soap.sam.sort -o SRR2052405.soap.sort.bam [E::sam_parse1] missing SAM header [W::sam_read1] Parse error at line 1 [main_samview] truncated file.