Entering edit mode
AishaD
•
0
@aishad-23531
Last seen 4.6 years ago
I have run predictedMeth() on filtered rrbs data. However, I want to pull out the methylation matrix where each row is a region and column is sample. The issue is that the rownames are numeric values rather than positions. I did pull out the coordinates from the predictedMeth object but I am not sure that the order match between the rows of the methylation matrix and coordinates. I want to confirm that they are in the same order and that I am referring each region to the right position on the genome. Below is the code I have used.
> betas <- as.matrix(methLevel(predictedMeth))
> betas[1:2,1:2]
A1 A2
1 1 0.97
2 1 0.98
> coordinates <- as.data.frame(predictedMeth@rowRanges)
> coordinates[1:2,]
seqnames start end width strand cluster.id
1 chr5 3020638 3020638 1 * chr5_1
2 chr5 3020656 3020656 1 * chr5_1
Yes the order is the same.