makeCNPmask: Given a set of copy-number events, create a DNA copy-number...

View source: R/makeCNPmask.R

makeCNPmaskR Documentation

Given a set of copy-number events, create a DNA copy-number mask.

Description

The function takes as an input a set of intervals with integer-valued boundary positions. It then finds interval regions where the event count is above each of two thresholds, upper and lower, and returns those interval regions with the count above the lower threshold that contain interval regions with the count above the upper threshold.

Usage

makeCNPmask(
  imat,
  chromCol = 1,
  startCol = 2,
  endCol = 3,
  nProf = 1,
  uThresh,
  dThresh
)

Arguments

imat

A matrix or a data.frame tabulating the chromosome numbers and startpoint/endpoint positions of the interval events.

chromCol

A character string or numeric representing an integer specifying the column of imat containing the chromosome numbers of the interval events.

startCol

A character string or numeric representing an integer specifying the column of imat containing the left (right) endpoint of the interval events.

endCol

A character string or numeric representing an integer specifying the column of imat containing the right endpoint of the interval events.

nProf

A positive numeric acting as an integer specifying the number of copy number profiles from which the events originated. Default: 1.

uThresh

A numeric specifying the upper threshold for the event frequency or (if nProf = 1) for the event count. The upper threshold must be equal or superior to the lower threshold (dThresh).

dThresh

A numeric specifying the lower thresholds for the event frequency or (if nProf = 1) for the event count. The lower threshold must be equal or inferior to the upper threshold (uThresh).

Details

TODO details with strange parameters. Masking is performed separately for each value in indexvals. Segments (rows of segtable) with that value of eventIndex are examined for coverage by mask intervals with that value of maskindex in masktable. If the coverage is at least mincover, the segment is slated for masking, while its flanking segments are extended to a random point within the segment being masked.

Value

A matrix of numeric (used as integer) with three columns:

  • "chrom", the chromosome number

  • "start", the left boundary position of the mask

  • "end", the right boundary position of the mask

Author(s)

Alexander Krasnitz, Guoli Sun

Examples


## Load a table of copy number events collected from 1203 profiles.
data(cnpexample)

## Create a table of gain (amplification) events only.
amps <- cnpexample[cnpexample[,"copy.num"] == "amp",]

# Create a mask using this table.
ampCNPmask <- makeCNPmask(imat=amps, chromCol="chrom",
    startCol="chrom.start", endCol="chrom.end", nProf=1203,
    uThresh=0.02, dThresh=0.008)


KrasnitzLab/CNprep documentation built on May 28, 2022, 8:32 p.m.