Question: Problem With Mpileup
0
gravatar for virtuouslycan
7.3 years ago by
Taiwan
virtuouslycan0 wrote:

I tried to make a coverage per base figure by processing single_reference.sam file with following commands:; samtools view -bS $1.sam > $1.bam; samtools sort $1.bam > $1.sort.bam; samtools mpileup $1.sort.bam > $1.c; cat $1.c | awk '{FS=" "}{print $2" "$4}' > $1.pileup

However, I received the following notice after running the sh:; [samopen] SAM header is present: 1 sequences.; Usage: samtools sort [-on] [-m <maxMem>] <in.bam> <out.prefix>; [bamheaderread] bgzfcheckEOF: Invalid argument; [bamheaderread] invalid BAM binary header (this is not a BAM file).; sam2bam2pileup.sh: line 4: 24893 Segmentation fault samtools mpileup $1.sort.bam > $1.c

Thanks for your gracious help!

bam samtools sam mpileup • 2.1k views
ADD COMMENTlink modified 7.3 years ago by Anders Bergström60 • written 7.3 years ago by virtuouslycan0
0
gravatar for Anders Bergström
7.3 years ago by
Anders Bergström60 wrote:

Samtools sort doesn't write to standard output, rather it writes to a file for which you specify the name prefix as an argument (samtools will add the ".bam" extension itself):

samtools sort inputFile.bam outputFile

ADD COMMENTlink written 7.3 years ago by Anders Bergström60

Solved. Thank you so much! bow!

ADD REPLYlink written 7.3 years ago by virtuouslycan0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2205 users visited in the last hour