Learn R Programming

SomaticSignatures (version 2.8.4)

motif-functions: Group somatic moticfs

Description

Tabulate somatic motifs by a grouping variable.

Usage

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

Arguments

vr
GRanges object [required]
group
Grouping variable name [character, default: 'sampleNames']
normalize
Normalize to frequency

Value

Occurance matrix with motifs in rows and samples in columns.

Details

The 'motifMatrix' function transforms the metadata columns of a 'VRanges' object, as returned by the 'mutationContext' function, to a matrix of the form 'motifs x groups'. This constitutes the bases for the estimation of the signatures. By default (with 'normalize' set to TRUE), the counts are transformed to frequencies, such that the sum of frequencies of each group equal 1. Otherwise (with 'normalize' set to FALSE), the counts for each mofis in a group is returned.

See Also

'mutationContext', 'mutationContextMutect'

Examples

Run this code
data(sca_motifs_tiny)

motifMatrix(sca_motifs_tiny, group = "study")

Run the code above in your browser using DataLab