get_mutations_in_flanked_sites: Mutation counts along relative positions

View source: R/plotting_mutation_patterns.R

get_mutations_in_flanked_sitesR Documentation

Mutation counts along relative positions

Description

Prepares data frame of mutations at relative positions along flanks and sites

Usage

get_mutations_in_flanked_sites(mutations, this_sites, window_size, n_patients)

Arguments

mutations

Data frame of mutations

this_sites

Data frame of sites

window_size

Integer indicating the half-width of sites and flanking regions (added to both sides of midpoint)

n_patients

Integer indicating number of patients

Value

Data frame containing the frequency of mutations across site and flank positions

dist

the relative position of each base to nearest site midpoint

mut_count

the number of overlapping mutations

is_site

boolean indicating if the position is within the site

mut_freq

frequency of mutations calculated as mut_count / n_patients / total bp * 1e6


reimandlab/RM2 documentation built on Aug. 13, 2022, 12:22 p.m.