Learn R Programming

aroma.cn (version 1.3.3)

deShearC1C2.PairedPSCBS: Correct for shearing in (C1,C2) space based on region-based PSCN estimates

Description

Correct for shearing in (C1,C2) space based on region-based PSCN estimates as given by the PSCBS segmentation method.

Usage

## S3 method for class 'PairedPSCBS':
deShearC1C2(fit, ..., dirs=c("|_", "|-", "-", "|", "X", "|,-", "-,|", "|-,X", "|,-,X", "-,|,X"), verbose=FALSE)

Arguments

fit
A PairedPSCBS fit object as returned by segmentByPairedPSCBS.
adjust
A numeric adjusting the bandwidth of the empirical density estimator of line (changepoint) directions.
weightFlavor
A character string specifying how weights are generated for lines (changepoints).
...
Not used.
verbose
See Verbose.

Value

  • Returns a PairedPSCBS fit object.

Examples

Run this code
if (Sys.getenv("_R_CHECK_FULL_") != "" && require("PSCBS")) {

# Load example ASCN data
data <- PSCBS::exampleData("paired.chr01");
R.oo::attachLocally(data);

# AD HOC: Robustification
CT[CT < 0] <- 0;
CT[CT > 30] <- 30;

# PSCBS segmentation
cc <- 1;
ww <- which(data$chromosome == cc);

fit <- segmentByPairedPSCBS(CT[ww], betaT=betaT[ww], betaN=betaN[ww], x=x[ww], chromosome=cc, verbose=-10);
fit <- postsegmentTCN(fit);

## Normalize
fitN <- normalizeBAFsByRegions(fit, verbose=-10);

# Call allelic balance
fitC <- callAllelicBalanceByBAFs(fitN);
ww <- which(fitC$output$abCall);
fitC$output[ww, "dhMean"] <- 0;

# deShear
fitD <- deShearC1C2(fitC, verbose=-10);

devSet("tracks");
subplots(2*3, ncol=2, byrow=FALSE);
par(mar=c(1,3.5,1,0.5)+1);
plotTracks(fit, subplots=FALSE);
plotTracks(fitD, subplots=FALSE);

devSet("C1C2");
Clim <- c(0,4);
plotC1C2(fitC, Clim=Clim);
linesC1C2(fitC);
title(main="(C1,C2) - adjusted");

devSet("C1C2,deShear");
Clim <- c(0,4);
plotC1C2(fitD, Clim=Clim);
linesC1C2(fitD);
title(main="(C1,C2) - deSheared");

} # if (require("PSCBS"))

Run the code above in your browser using DataLab