Hi,
I'm using BSseq package from BioConductor to analyse WGBS data and identify differentially methylated regions (DMRs) using Bsmooth. Here's what my data looks like :
chr base strand coverage freqC (%) fredC
chr1 3020794 F 2 100.00 2
chr1 3020814 F 2 100.00 2
chr1 3020815 R 7 85.70 5,999
I have 3 samples i'm trying to combine using the combine function included in the Bsseq package but i keep getting this error :
Error in validObject(.Object) : invalid class “SummarizedExperiment” object: nb of cols in 'assay' (2) must equal nb of rows in 'colData' (1)
Here is the script i'm using :
data1<-read.table("1.input", row.names = NULL, col.names = c("chr", "pos", "strand", "Cov", "S", "M"),colClasses = c("character", "integer", "character","integer", "double", "double"))
data2<-read.table("2.input", row.names = NULL, col.names = c("chr", "pos", "strand", "Cov", "S", "M"),colClasses = c("character", "integer", "character","integer", "double", "double"))
data3<-read.table("3.input", row.names = NULL, col.names = c("chr", "pos", "strand", "Cov", "S", "M"),colClasses = c("character", "integer", "character","integer", "double", "double"))
BS1<- BSseq(pos=data1$pos, chr=data1$chr, M = as.matrix(data1$M, ncol = 1),Cov = as.matrix(data1$Cov, ncol = 1,sampleNames = "Ctl_61"))
BS2<- BSseq(pos=data2$pos, chr=data2$chr, M = as.matrix(data2$M, ncol = 1),Cov = as.matrix(data2$Cov, ncol = 1, sampleNames = "Ctl_86"))
BS3<- BSseq(pos=data3$pos, chr=data3$chr, M = as.matrix(data3$M, ncol = 1),Cov = as.matrix(data3$Cov, ncol = 1,sampleNames = "Ctl_89"))
BS <- combine(BS1,BS2,BS3)
Error in validObject(.Object) : invalid class “SummarizedExperiment” object: nb of cols in 'assay' (2) must equal nb of rows in 'colData' (1)
Is it there a problem with the way i've used my data to create the Bsseq objects ?
Thank you for you help !