This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Coverage information of the read using samtool

Hi, I want to obtain coverage information of the read using samtool. I gave the following command- ./samtools stats -c mappedreversecomp.bam . I got an error "Unable to parse -c mappedreversecomp.bam" Kindly help in identifying the mistake.

Thanks Madhu

alignment

Please validate questions for past answers/comments you have received for your past questions. Up-voting/accepting (green check mark) answers is the correct way of doing this.

Madhu,

Please follow genomax's advice and do the following for your questions:

If an answer was helpful you should upvote it, if the answer resolved your question you should mark it as accepted. Upvote|Bookmark|Accept

2 answers

  • It's samtools, not "samtool"
  • Unless you're operating out of a directory where both the samtools binary and the file mappedreversecomp.bam are both accessible, you're doing it wrong. You should be in the directory that has the BAM file and samtools should be in your $PATH, with you executing samtools stats -c ./mappedreversecomp.bam
  • Please format your question better. Use the code button to your advantage.

If you're using Ubuntu, use sudo apt-get install samtools to install samtools. cd to your directory that has the BAM file and then use the command I mentioned above.

The help is the first place you should look:

$ samtools stats
About: The program collects statistics from BAM files. The output can be visualized using plot-bamstats.
Usage: samtools stats [OPTIONS] file.bam
       samtools stats [OPTIONS] file.bam chr:from-to
Options:
    -c, --coverage <int>,<int>,<int>    Coverage distribution min,max,step [1,1000,1]

Looks like samtools stats is expecting 3 numbers to follow the -c. You didn't put any.

Log in to answer this question.