Error while smoothing BS-seq data with bsseq
3
0
Entering edit mode
@andreucat91-8929
Last seen 7.3 years ago
Spain

I have a problem when I try to smooth my data with the package bsseq. This data comes from bismark and has been previously loaded to R with read.bismark function without problems. You have the commands I used below:

library("bsseq")
files_chh = list.files(path = ".", pattern = "CHH")
meth <- read.bismark(files_chh, c("P150_1","P150_2","P150_3","P60_1","P60_2","P60_3","PM1","PM2","PM3"))
splitBtSample <- list()
for (x in 1:ncol(meth)) {
  splitBtSample[x] <- BSmooth(meth[,x], mc.cores = 5, verbose = TRUE)
}
[BSmooth] preprocessing ... done in 154.6 sec
[BSmooth] smoothing by 'sample' (mc.cores = 5, mc.preschedule = FALSE)
[BSmooth] smoothing done in 338.3 sec
Error in `colnames<-`(`*tmp*`, value = "P150_1") :
  attempt to set 'colnames' on an object with less than two dimensions

As you can see, an error appears and I am not able to find the origin. Do you have any idea what is going on? I have analysed other data following these commands and all went fine. Raw files seem to be OK.

By the way, do you recommend filtering the data by setting a coverage threshold? How would you do that?

Thank you very much.

bsseq • 1.8k views
ADD COMMENT
0
Entering edit mode
@kasper-daniel-hansen-2979
Last seen 9 months ago
United States
Don't you need double brackets on your splitbySample[x]? But really BSmooth is set up to do what you want, you should just have to do meth = BSmooth(meth, parallelBy = "sample", mc.cores = 5 ) The coverage threshold depends a little on your experiment and the obtained coverage. I have tended to increase my threshold over the last couple of years as depth has gotten bigger, but that is based on trying to be more conservative when I can afford it. Best, Kasper Best, Kasper On Mon, Oct 5, 2015 at 11:56 AM, andreucat91 [bioc] < noreply@bioconductor.org> wrote: > Activity on a post you are following on support.bioconductor.org > > User andreucat91 <https: support.bioconductor.org="" u="" 8929=""/> wrote Question: > Error while smoothing BS-seq data with bsseq > <https: support.bioconductor.org="" p="" 72961=""/>: > > I have a problem when I try to smooth my data with the package *bsseq*. > This data comes from bismark and has been previously loaded to R with > *read.bismark* function without problems. You have the commands I used > below: > > library("bsseq") > files_chh = list.files(path = ".", pattern = "CHH") > meth <- read.bismark(files_chh, c("P150_1","P150_2","P150_3","P60_1","P60_2","P60_3","PM1","PM2","PM3")) > splitBtSample <- list() > for (x in 1:ncol(meth)) { > splitBtSample[x] <- BSmooth(meth[,x], mc.cores = 5, verbose = TRUE) > } > [BSmooth] preprocessing ... done in 154.6 sec > [BSmooth] smoothing by 'sample' (mc.cores = 5, mc.preschedule = FALSE) > [BSmooth] smoothing done in 338.3 sec*Error in `colnames<-`(`*tmp*`, value = "P150_1") : > attempt to set 'colnames' on an object with less than two dimensions* > > As you can see, an error appears and I am not able to find the origin. > > By the way, do you recommend filtering the data by setting a coverage > threshold? How would you do that? > > > > ------------------------------ > > Post tags: bsseq > > You may reply via email or visit Error while smoothing BS-seq data with bsseq >
ADD COMMENT
0
Entering edit mode
@nikolayoskolkov-12968
Last seen 6.9 years ago

Hi Kasper,

I have a similar error from BSmooth that I can not solve:

bismarkBSseq.fit<-BSmooth(bismarkBSseq,mc.cores=1,verbose=TRUE)
[BSmooth] preprocessing ... done in 35.6 sec
[BSmooth] smoothing by 'sample' (mc.cores = 1, mc.preschedule = FALSE)
[BSmooth] smoothing done in 2893.2 sec
Error in `colnames<-`(`*tmp*`, value = c("10D", "21D", "22D", "28D")) :
  attempt to set 'colnames' on an object with less than two dimensions

The BSseq object was prepared in the following way

bismarkBSseq<-read.bismark(files=c("10D_S2_001_bismark_bt2_pe.deduplicated.bismark.cov.gz","21D_S3_001_bismark_bt2_pe.deduplicated.bismark.cov.gz","22D_S4_001_bismark_bt2_pe.deduplicated.bismark.cov.gz","28D_S1_001_bismark_bt2_pe.deduplicated.bismark.cov.gz"),sampleNames=c("10D","21D","22D","28D"),rmZeroCov=TRUE,strandCollapse=FALSE,fileType="cov",mc.cores=1,verbose=TRUE)

What can be wrong with BSmooth?

Best,

Nikolay

 

ADD COMMENT
0
Entering edit mode
@nikolayoskolkov-12968
Last seen 6.9 years ago

And here btw is the BSseq object structure:

  ..@ trans          :function ()  

  ..@ parameters     : list()
  ..@ rowRanges      :Formal class 'GRanges' [package "GenomicRanges"] with 6 slots
  .. .. ..@ seqnames       :Formal class 'Rle' [package "S4Vectors"] with 4 slots
  .. .. .. .. ..@ values         : Factor w/ 191 levels "1","9","20","2",..: 1 2 3 4 5 6 7 8 9 10 ...
  .. .. .. .. ..@ lengths        : int [1:191] 4666694 2402572 1527595 4333907 2652774 1725135 2922224 1178 1652754 1185586 ...
  .. .. .. .. ..@ elementMetadata: NULL
  .. .. .. .. ..@ metadata       : list()
  .. .. ..@ ranges         :Formal class 'IRanges' [package "IRanges"] with 6 slots
  .. .. .. .. ..@ start          : int [1:56822515] 10469 10470 10471 10472 10484 10485 10489 10490 10493 10494 ...
  .. .. .. .. ..@ width          : int [1:56822515] 1 1 1 1 1 1 1 1 1 1 ...
  .. .. .. .. ..@ NAMES          : NULL
  .. .. .. .. ..@ elementType    : chr "integer"
  .. .. .. .. ..@ elementMetadata: NULL
  .. .. .. .. ..@ metadata       : list()
  .. .. ..@ strand         :Formal class 'Rle' [package "S4Vectors"] with 4 slots
  .. .. .. .. ..@ values         : Factor w/ 3 levels "+","-","*": 3
  .. .. .. .. ..@ lengths        : int 56822515
  .. .. .. .. ..@ elementMetadata: NULL
  .. .. .. .. ..@ metadata       : list()
  .. .. ..@ elementMetadata:Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
  .. .. .. .. ..@ rownames       : NULL
  .. .. .. .. ..@ nrows          : int 56822515
  .. .. .. .. ..@ listData       : Named list()
  .. .. .. .. ..@ elementType    : chr "ANY"
  .. .. .. .. ..@ elementMetadata: NULL
  .. .. .. .. ..@ metadata       : list()
  .. .. ..@ seqinfo        :Formal class 'Seqinfo' [package "GenomeInfoDb"] with 4 slots
  .. .. .. .. ..@ seqnames   : chr [1:191] "1" "9" "20" "2" ...
  .. .. .. .. ..@ seqlengths : int [1:191] NA NA NA NA NA NA NA NA NA NA ...
  .. .. .. .. ..@ is_circular: logi [1:191] NA NA NA NA NA NA ...
  .. .. .. .. ..@ genome     : chr [1:191] NA NA NA NA ...
  .. .. ..@ metadata       : list()
  ..@ colData        :Formal class 'DataFrame' [package "S4Vectors"] with 6 slots
  .. .. ..@ rownames       : chr [1:4] "10D" "21D" "22D" "28D"
  .. .. ..@ nrows          : int 4
  .. .. ..@ listData       : Named list()
  .. .. ..@ elementType    : chr "ANY"
  .. .. ..@ elementMetadata: NULL
  .. .. ..@ metadata       : list()
  ..@ assays         :Reference class 'ShallowSimpleListAssays' [package "SummarizedExperiment"] with 1 field
  .. ..$ data: NULL
  .. ..and 14 methods.
  ..@ NAMES          : NULL

ADD COMMENT
0
Entering edit mode

Hi Nikolay,

Did you figure out how to solve this problem?

I got the same situation and I don't know what to do.

Thank you,

Kai

ADD REPLY

Login before adding your answer.

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