File: lengthen_mut_matrix.Rd

package info (click to toggle)
r-bioc-mutationalpatterns 3.16.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,360 kB
  • sloc: sh: 8; makefile: 2
file content (55 lines) | stat: -rw-r--r-- 1,867 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lengthen_mut_matrix.R
\name{lengthen_mut_matrix}
\alias{lengthen_mut_matrix}
\title{Lengthen mutation matrix}
\usage{
lengthen_mut_matrix(mut_matrix)
}
\arguments{
\item{mut_matrix}{Mutation matrix}
}
\value{
mut_matrix
}
\description{
A mutation_matrix calculated on a GRangesList or GR object modified by 'split_muts_region()',
will contain a column per combination of sample and genomic region. In essence different regions
are treated as different samples. This function will transform the matrix, so that these regions
are instead treated as different mutation types. For example, instead of 'C[C>T]G', you might have
the feature 'C[C>T]G Promoter'. The number of rows in the matrix will thus be
multiplied by the number of regions.
After using 'split_muts_region()', use 'mut_matrix()' to get a mut_matrix that can be used
for this function.
The result can be plotted with plot_profile_region, but could also be used for NMF, refitting ect.
}
\examples{

## See the 'split_muts_region()' and 'mut_matrix()' examples for how we obtained the
## mutation matrix information:
mut_mat_split_region <- readRDS(system.file("states/mut_mat_data.rds",
  package = "MutationalPatterns"
))

long_mut_mat <- lengthen_mut_matrix(mut_mat_split_region)


## This also works on indels:
## See the 'split_muts_region()' and 'count_indels_context()' examples for how we
## obtained the indel counts:
indel_counts_split <- readRDS(system.file("states/blood_indels_counts_split_region.rds",
  package = "MutationalPatterns"
))


## Lengthen the matrix
lengthen_mut_matrix(indel_counts_split)
}
\seealso{
Other genomic_regions: 
\code{\link{bin_mutation_density}()},
\code{\link{plot_profile_region}()},
\code{\link{plot_spectrum_region}()},
\code{\link{split_muts_region}()}
}
\concept{genomic_regions}