Search
Question: motifMatrix input object type, confused VRange and GRange
0
2.4 years ago by
solo777310
solo777310 wrote:

motif-functions {SomaticSignatures}

Usage

motifMatrix(vr, group = "sampleNames", normalize = TRUE)
Arguments

vr
GRanges object [required]

But, the example from the manual shows

Examples

data(sca_motifs_tiny)

motifMatrix(sca_motifs_tiny, group = "study")

However, sca_motifs is a VRange object. So, what is the right type for motifMatrix? VRange or GRange?

modified 2.4 years ago by Julian Gehring1.3k • written 2.4 years ago by solo777310
1
2.4 years ago by
Julian Gehring1.3k
Julian Gehring1.3k wrote:

Both GRanges and VRanges work as inputs for motifMatrix. Since the input to that function is in most workflows the output of the mutationContext function, it often is a VRanges that describes a set of variants. But, any object that inherits from a GRanges  is suitable, if it contains the information of alteration and context.

You can check that both work the same way by trying it out:

data(sca_motifs_tiny)
m1 = motifMatrix(sca_motifs_tiny, group = "study") ## VRanges input
m2 = motifMatrix(as(sca_motifs_tiny, "GRanges"), group = "study") ## GRanges input
identical(m1, m2) ## same output