calcExpectedMutations: Calculate expected mutation frequencies of a sequence

View source: R/MutationProfiling.R

calcExpectedMutationsR Documentation

Calculate expected mutation frequencies of a sequence

Description

calcExpectedMutations calculates the expected mutation frequencies of a given sequence. This is primarily a helper function for expectedMutations.

Usage

calcExpectedMutations(
  germlineSeq,
  inputSeq = NULL,
  targetingModel = HH_S5F,
  regionDefinition = NULL,
  mutationDefinition = NULL
)

Arguments

germlineSeq

germline (reference) sequence.

inputSeq

input (observed) sequence. If this is not NULL, then germlineSeq will be processed to be the same same length as inputSeq and positions in germlineSeq corresponding to positions with Ns in inputSeq will also be assigned an N.

targetingModel

TargetingModel object. Default is HH_S5F.

regionDefinition

RegionDefinition object defining the regions and boundaries of the Ig sequences.

mutationDefinition

MutationDefinition object defining replacement and silent mutation criteria. If NULL then replacement and silent are determined by exact amino acid identity.

Details

calcExpectedMutations calculates the expected mutation frequencies of a given sequence and its germline.

Note, only the part of the sequences defined in regionDefinition are analyzed. For example, when using the default IMGT_V definition, mutations in positions beyond 312 will be ignored.

Value

A numeric vector of the expected frequencies of mutations in the regions in the regionDefinition. For example, when using the default IMGT_V definition, which defines positions for CDR and FWR, the following columns are calculated:

  • mu_expected_cdr_r: number of replacement mutations in CDR1 and CDR2 of the V-segment.

  • mu_expected_cdr_s: number of silent mutations in CDR1 and CDR2 of the V-segment.

  • mu_expected_fwr_r: number of replacement mutations in FWR1, FWR2 and FWR3 of the V-segment.

  • mu_expected_fwr_s: number of silent mutations in FWR1, FWR2 and FWR3 of the V-segment.

See Also

expectedMutations calls this function. To create a custom targetingModel see createTargetingModel. See calcObservedMutations for getting observed mutation counts.

Examples

# Load example data
data(ExampleDb, package="alakazam")

# Use first entry in the exampled data for input and germline sequence
in_seq <- ExampleDb[["sequence_alignment"]][1]
germ_seq <-  ExampleDb[["germline_alignment_d_mask"]][1]

# Identify all mutations in the sequence
calcExpectedMutations(germ_seq,in_seq)

# Identify only mutations the V segment minus CDR3
calcExpectedMutations(germ_seq, in_seq, regionDefinition=IMGT_V)

# Define mutations based on hydropathy
calcExpectedMutations(germ_seq, in_seq, regionDefinition=IMGT_V,
                      mutationDefinition=HYDROPATHY_MUTATIONS)


shazam documentation built on Oct. 3, 2023, 1:06 a.m.