Hi All,
I am analyzing DNA methylation of PacBio sequencing data using R-kinetics.
I have two H5 files such as 'control_aligned_reads.cmp.h5' and 'methylation_aligned_reads.cmp.h5'.
Using the R-kinetics, I can generate two density plots for each H5 file, respectively. I attached the scripts what I used at below;
cmpH5_1 <- PacBioCmpH5("../control_aligned_reads.cmp.h5")
cmpH5_2 <- PacBioCmpH5("../methylation_aligned_reads.cmp.h5")
cmpH5a <- lapply(Sys.glob("../control_aligned_reads.cmp.h5"), PacBioCmpH5)
names(cmpH5a) <- sapply(cmpH5a, function(h) basename(dirname(dirname(h@fileName))))
cmpH5b <- lapply(Sys.glob("../methylation_aligned_reads.cmp.h5"), PacBioCmpH5)
names(cmpH5b) <- sapply(cmpH5b, function(h) basename(dirname(dirname(h@fileName))))
plotDensity(lapply(cmpH5a, function(cmpH5_1) {
v <- getIPD(cmpH5_1, sample(1:nrow(cmpH5_1), size = 100))
do.call(c, v)
}), legend = T, log = 'x', xlab = "IPD")
plotDensity(lapply(cmpH5b, function(cmpH5_2) {
v <- getIPD(cmpH5_2, sample(1:nrow(cmpH5_2), size = 100))
do.call(c, v)
}), legend = T, log = 'x', xlab = "IPD")
But, now I am trying to display the two densities of both cmpH5_1 and cmpH5_2 into a density plot. I am not an expert of R yet. Could you please help me how I can figure it out?
Thanks,
Taehee
I am analyzing DNA methylation of PacBio sequencing data using R-kinetics.
I have two H5 files such as 'control_aligned_reads.cmp.h5' and 'methylation_aligned_reads.cmp.h5'.
Using the R-kinetics, I can generate two density plots for each H5 file, respectively. I attached the scripts what I used at below;
cmpH5_1 <- PacBioCmpH5("../control_aligned_reads.cmp.h5")
cmpH5_2 <- PacBioCmpH5("../methylation_aligned_reads.cmp.h5")
cmpH5a <- lapply(Sys.glob("../control_aligned_reads.cmp.h5"), PacBioCmpH5)
names(cmpH5a) <- sapply(cmpH5a, function(h) basename(dirname(dirname(h@fileName))))
cmpH5b <- lapply(Sys.glob("../methylation_aligned_reads.cmp.h5"), PacBioCmpH5)
names(cmpH5b) <- sapply(cmpH5b, function(h) basename(dirname(dirname(h@fileName))))
plotDensity(lapply(cmpH5a, function(cmpH5_1) {
v <- getIPD(cmpH5_1, sample(1:nrow(cmpH5_1), size = 100))
do.call(c, v)
}), legend = T, log = 'x', xlab = "IPD")
plotDensity(lapply(cmpH5b, function(cmpH5_2) {
v <- getIPD(cmpH5_2, sample(1:nrow(cmpH5_2), size = 100))
do.call(c, v)
}), legend = T, log = 'x', xlab = "IPD")
But, now I am trying to display the two densities of both cmpH5_1 and cmpH5_2 into a density plot. I am not an expert of R yet. Could you please help me how I can figure it out?
Thanks,
Taehee