Closed lukesarre closed 2 years ago
I think you want rowRanges(bs)
, e.g., if your BSseq object contains 2 loci and you wanted to add the context you could do rowRanges(bs)$context <- c("CA", "CT")
FYI Formally, a BSseq object is a SummarizedExperiment object, so the syntax is the same. If you're not familiar with interacting with SummarizedExperiment objects, then the vignette may help (https://bioconductor.org/packages/release/bioc/vignettes/SummarizedExperiment/inst/doc/SummarizedExperiment.html)
That did the trick, perfect. And the vignette was very helpful Thank you for your help, Luke
Hello,
Thank you very much for developing bsseq, it has been an incredibly useful tool in my research.
I would like to append metadata to the GRanges part of the BSseq object. For example I would like rows to contain their dinucleotide context ("CA", "CT", etc.)
I have tried methods such as:
granges(bs)$metadata = c("CA", "CT"
) andvalues(granges(bs)) = DataFrame(metadata = c("CA", "CT"))
However, both methods give the error:
could not find function "granges<-"
Is it that BSseq objects are restricted from containing metadata? Or perhaps I am missing something more obvious?
Many thanks for your help, and I appreciate the work you have put into this package. Luke