Counting methylated and unmethylated CpGs in BSseq reads from bam file
2
0
Entering edit mode
4.8 years ago
johnsonn573 ▴ 10

I have a bismark aligned bam file, and I would like to extract the number of methylated CpGs and the number of unmethylated CpGs for each read in the bam file.

R sequence sequencing • 2.4k views
ADD COMMENT
1
Entering edit mode

I know how to extract methylation calls using bismark. When you use bismark to call methylation, it will give you the number of methylated and unmethylated reads overlapping each CpG site in the genome. But that's not my question.

I want to know all the methylated and unmethylated sites on each read.

For example, the first read in the bam file might overlap 4 CpG sites. I would like to know how many of those CpG sites were methylated and how many were unmethylated.

ADD REPLY
1
Entering edit mode
ADD COMMENT
1
Entering edit mode

Bismark calls methylation values and stores the calls in the XM tag of each read in the BAM file. You can use MethylDackel do this, or you can count the number of 'z' and 'Z' characters for each read (pair) in the BAM

ADD REPLY
0
Entering edit mode

Thank you! This is very helpful!

ADD REPLY
0
Entering edit mode
4.8 years ago
ATpoint 82k

Please read the manual for extraction the methylation calls.

ADD COMMENT
0
Entering edit mode

Yes, I know how to do this, but I am not trying to extract methylation calls. See my other comment.

ADD REPLY

Login before adding your answer.

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