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!
Solved. Thank you so much! bow!