File: split_muts_region.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 (66 lines) | stat: -rw-r--r-- 2,152 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
56
57
58
59
60
61
62
63
64
65
66
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/split_muts_region.R
\name{split_muts_region}
\alias{split_muts_region}
\title{Split GRangesList or GRanges based on a list of regions.}
\usage{
split_muts_region(vcf_list, ranges_grl, include_other = TRUE)
}
\arguments{
\item{vcf_list}{GRangesList or GRanges object}

\item{ranges_grl}{GRangesList or GRanges object containing regions of interest}

\item{include_other}{Boolean. Whether or not to include a "Other" region
containing mutations that aren't in any other region.}
}
\value{
GRangesList
}
\description{
A GRangesList or GRanges object containing variants is split based on a list of regions.
This list can be either a GRangesList or a GRanges object.
The result is a GRangesList where each element contains the variants of one sample from one region.
Variant that are not in any of the provided region are put in a list of 'other'.
}
\examples{

## Read in some existing genomic regions.
## See the 'genomic_distribution()' example for how we obtained the
## following data:
CTCF_g <- readRDS(system.file("states/CTCF_g_data.rds",
  package = "MutationalPatterns"
))
promoter_g <- readRDS(system.file("states/promoter_g_data.rds",
  package = "MutationalPatterns"
))
flanking_g <- readRDS(system.file("states/promoter_flanking_g_data.rds",
  package = "MutationalPatterns"
))

## Combine the regions into a single GRangesList
regions <- GRangesList(promoter_g, flanking_g, CTCF_g)

names(regions) <- c("Promoter", "Promoter flanking", "CTCF")

## Read in some variants.
## See the 'read_vcfs_as_granges()' example for how we obtained the
## following data:
grl <- readRDS(system.file("states/read_vcfs_as_granges_output.rds",
  package = "MutationalPatterns"
))

## Split muts based on the supplied regions
split_muts_region(grl, regions)

## Don't include muts outside of the supplied regions
split_muts_region(grl, regions, include_other = FALSE)
}
\seealso{
Other genomic_regions: 
\code{\link{bin_mutation_density}()},
\code{\link{lengthen_mut_matrix}()},
\code{\link{plot_profile_region}()},
\code{\link{plot_spectrum_region}()}
}
\concept{genomic_regions}