View source: R/asRaggedExperiment.R
asRaggedExperiment | R Documentation |
This seems pretty banal, and in some respects it is, but there are some fiddly bits to computing on segmentations, and this function attempts to ease them. For example, it simply isn't possible to use sparseAssay or disjoinAssay with character, integer, or factor matrices. If all states are represented in all segmentations, this reduces to generating and keeping a state-mapping key in metadata(), then referring to it on the way out of the RaggedExperiment (usually this will employ disjoinSummarizedExperiment to map a bunch of regions across a bunch of segmentation models). Yet another possibility is that each segmentation has a probability for each possible state, and a collection of segmentations would be better stored as a tensor (stack of arrays). This function attempts to finesse the most painful parts of the user experience (based on mine). Irritating problems like missing states can make life difficult, so this function deals with them up-front by enumerating states, then keying them.
asRaggedExperiment(segs, scHMM = FALSE, keycol = "name", to = "state")
segs |
segmentations, usually a GRangesList or GenomicSegmentations |
scHMM |
scChromHMM-like posterior probabilities? (different tricks) |
keycol |
mcols column to find the states that comprise a key ("name") |
to |
what to call this keycol to in the RaggedExperiment? ("state") |
The function will probably be wrapped by a coercion before too much longer.
The 'states' method uses 'key' on RE assays. metadata(RE)$yek, as its name implies, reverses 'key'.
a RaggedExperiment RE, with 'key' and 'yek' in metadata(RE)
states
# some simplified chrY tracks
data(simpleY, package="chromophobe")
asRaggedExperiment(simpleY)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.