Extract information of mapped reads bam files
2
0
Entering edit mode
12 weeks ago
sata72 • 0

Hi all, I have a bam files from RRBS data and want to extract these information from them, anyone know how I can get these output (an example is below)?

Thanks in advance,

 Output
  20000 reads; of these:
  20000 (100.00%) were unpaired; of these:
  1247 (6.24%) aligned 0 times
  18739 (93.69%) aligned exactly 1 time
  14 (0.07%) aligned >1 times
  93.77% overall alignment rate
mapped bam alignment • 309 views
ADD COMMENT
1
Entering edit mode
12 weeks ago
bk11 ★ 2.4k

You can use samtools for this. Please check out in this link.

samtools flagstat RRBS_data.bam

ADD COMMENT
0
Entering edit mode
12 weeks ago

No tool produces the exact same stats that you'd get when running the aligner (the output looks to be generated by bowtie )

But there are alternative tools designed to produce stats, for example bamstats

https://github.com/guigolab/bamstats

an output could look like this:

{
    "general": {
        "protocol": "SingleEnd",
        "reads": {
            "total": 101567,
            "unmapped": 7119,
            "mapped": {
                "0": 94448
            },
            "mappings": {
                "ratio": 1,
                "count": 94448
            }
        },
        "pairs": {}
    }
}
ADD COMMENT

Login before adding your answer.

Traffic: 1895 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