Fit: Signature Fit

View source: R/signatureFitMultiStepLib.R

FitR Documentation

Signature Fit

Description

This function provides basic signature fit functionalities. Fit a given set of mutational signatures into mutational catalogues to estimate the activity/exposure of each of the given signatures in the catalogues.

Usage

Fit(
  catalogues,
  signatures,
  exposureFilterType = "fixedThreshold",
  giniThresholdScaling = 10,
  giniThresholdScaling_nmuts = -1,
  threshold_percent = 5,
  threshold_nmuts = -1,
  method = "KLD",
  useBootstrap = FALSE,
  nboot = 200,
  threshold_p.value = 0.05,
  nparallel = 1,
  randomSeed = NULL,
  verbose = FALSE
)

Arguments

catalogues

catalogues matrix, samples as columns, channels as rows

signatures

mutational signatures to be fitted into the sample catalgues, signatures as columns and channels as rows

exposureFilterType

use either fixedThreshold or giniScaledThreshold. When using fixedThreshold, exposures will be removed based on a fixed percentage with respect to the total number of mutations (threshold_percent will be used). When using giniScaledThreshold each signature will used a different threshold calculated as (1-Gini(signature))*giniThresholdScaling

giniThresholdScaling

scaling factor for the threshold type giniScaledThreshold, which is based on the Gini score of a signature. The threshold is computed as (1-Gini(signature))*giniThresholdScaling, and will be used as a percentage of mutations in a sample that the exposure of "signature" need to be larger than. Set it to -1 to deactivate.

giniThresholdScaling_nmuts

scaling factor for the threshold type giniScaledThreshold, which is based on the Gini score of a signature. The threshold is computed as (1-Gini(signature))*giniThresholdScaling_nmuts, and will be used as number of mutations in a sample that the exposure of "signature" need to be larger than. Set to -1 to deactivate.

threshold_percent

threshold in percentage of total mutations in a sample, only exposures larger than threshold are considered. Set it to -1 to deactivate.

threshold_nmuts

threshold in number of mutations in a sample, only exposures larger than threshold are considered.Set it to -1 to deactivate.

method

KLD or NNLS

useBootstrap

set to TRUE to use the signature fit with bootstrap method

nboot

number of bootstraps to use, more bootstraps more accurate results (use only when useBootstrap=TRUE)

threshold_p.value

p-value to determine whether an exposure is above the threshold_percent. In other words, this is the empirical probability that the exposure is lower than the threshold (use only when useBootstrap=TRUE)

nparallel

to use parallel specify >1

randomSeed

set an integer random seed (use only when useBootstrap=TRUE)

verbose

use FALSE to suppress messages

Details

This is a standard interface to signature fit functions with/without bootstrap. The object returned by this function can be passed to the plotFit() function for automated plotting of the results.

A post fit exposure filter will reduce the false positive singature assignments by setting to zero exposure values that are below a certain threshold. We provide two exposureFilterType methods: fixedThreshold and giniScaledThreshold. The fixedThreshold method will set to zero exposures that are below a fixed threshold given as a percentage of the mutations in a sample (parameter threshold_percent), while the method giniScaledThreshold will use a different threshold for each signature, computed as (1-Gini(signature))*giniThresholdScaling, which will also be a percentage of the mutations in a sample.

Value

returns the activities/exposures of the signatures in the given sample and other information

Examples

res <- Fit(catalogues,getOrganSignatures("Breast"))
plotFit(res,"results/")

Nik-Zainal-Group/signature.tools.lib documentation built on April 13, 2025, 5:50 p.m.