adjustLogRatio: Adjust tumor vs. normal coverage log ratio for tumor purity...

View source: R/adjustLogRatio.R

adjustLogRatioR Documentation

Adjust tumor vs. normal coverage log ratio for tumor purity and ploidy

Description

This function can be used to adjust the log ratio for tumor purity and ploidy for downstream tools that expect a log2 ratio (for example GISTIC).

Usage

adjustLogRatio(ratio, purity, ploidy, is.log2 = TRUE, min.ratio = 2^-8)

Arguments

ratio

Vector of log2 tumor vs normal coverage ratios.

purity

Purity of sample.

ploidy

Ploidy of sample.

is.log2

log.ratio is log2 transformed.

min.ratio

Minimum (non-log2-transformed) ratio. Set to approx -8 log2 adjusted.

Value

numeric(length(log.ratio)), log.ratio adjusted for purity and ploidy

Author(s)

Markus Riester

References

Nature Biotechnology. * Toal (2018), https://github.com/lima1/PureCN/issues/40

Examples


normal.coverage.file <- system.file("extdata", "example_normal.txt.gz", 
    package = "PureCN")
tumor.coverage.file <- system.file("extdata", "example_tumor.txt.gz", 
    package = "PureCN")
normal <- readCoverageFile(normal.coverage.file)
tumor <- readCoverageFile(tumor.coverage.file)
log.ratio <- calculateLogRatio(normal, tumor)
log.ratio.adjusted <- adjustLogRatio(log.ratio, 0.65, 1.73)


lima1/PureCN documentation built on Sept. 17, 2024, 5:48 a.m.