breakIntoCNPs.chrom: Determine which segments have to be removed and redistribute...

View source: R/breakIntoCNPs.chrom.R

breakIntoCNPs.chromR Documentation

Determine which segments have to be removed and redistribute probes/bins from removed segments

Description

This function determines which segments have to be removed and redistributes the probes/bins from a removed segment into the adjacent segments for one specific chromosome at the time.

Usage

breakIntoCNPs.chrom(
  segTable,
  chrom,
  startPos,
  endPos,
  startProbe,
  endProbe,
  eventIndex,
  cnpTable,
  cnpChrom,
  cnpStart,
  cnpEnd,
  cnpIndex,
  minCover,
  indexVals
)

Arguments

segTable

a matrix or a data.frame with columns named or enumerated by the values of chrom, startPos, endPos, startProbe, endProbe, eventIndex.

chrom

a character string specifying the name for the column in segTable tabulating the (integer) chromosome number for each segment.

startPos

a character string or integer specifying the name or number of columns in segTable that tabulates the (integer) genomic start coordinate of each segment.

endPos

a character string or integer specifying the name or number of columns in segTable that tabulates the (integer) genomic end coordinate of each segment.

startProbe

a character string specifying the name of column in segTable that tabulates the (integer) start position of each segment in internal units such as probe numbers for data of CGH microarray origin.

endProbe

a character string specifying the name of the column in segTable that tabulates the (integer) end position of each segment in internal units such as probe numbers for data of CGH microarray origin.

eventIndex

a character string giving the name of the column in segTable where copy number variation status of the segments is tabulated.

cnpTable

a matrix or a data.frame with columns named or enumerated as given by cnpChrom, cnpStart, cnpEnd, cnpIndex and with rows corresponding to genomic intervals that comprise the mask.

cnpChrom

a character string or integer specifying the name or number of columns in cnpTable that tabulates the chromosome number of the intervals comprising the mask.

cnpStart

a character string or integer specifying the name or number of columns in masktable that tabulates the genomic start coordinates of the intervals comprising the mask.

cnpEnd

a character string or integer specifying the name or number of columns in masktable that tabulates the genomic end coordinates of the intervals comprising the mask.

cnpIndex

a numeric vector corresponding to eventIndex, specifying copy number events status for measuring units.

minCover

A single numeric value between 0 and 1 specifying the degree of overlap above which two clusters will be joined into one.

indexVals

a numeric vector of length 2 specifying the two values in maskindex to be matched with values in eventIndex to determine the events that are to be masked.

Value

a matrix of numeric with 3 columns:

  1. the updated start position (integer) of each segment in internal units. This column has the same name than the startProbe parameter.

  2. the updated end position (integer) of each segment in internal units. This column has the same name than the endProbe parameter.

  3. the masked result: 0 when the segment is retained, 1 when the segment is removed. This column is called "toremove".

Author(s)

Alexander Krasnitz, Guoli Sun

Examples


# Table containing information about segments in the chromosome
segTable <- data.frame(ID=c(rep("WZ1", 5)), 
    start=c(1, 16, 23, 31, 38),
    end=c(15, 22, 30, 37, 50),
    seg.median=c(0.03779, -0.51546, 0.2431, -0.2259, 0.0372),
    chrom=c(rep(1, 5)),
    chrom.pos.start=c(932544, 16004440, 38093655, 78729960, 103416416),
    chrom.pos.end=c(15844870, 37974708, 78619856, 103394039, 142176090),
    eventIndex=c(0, 0, 1, 0, -1))
    
# Table with copy number information
cnptable <- matrix(c(rep(1, 3), c(932544, 38093688, 123416446), 
    c(11844870, 48619856, 182176090), rep(1,3)), ncol=4, byrow=FALSE,
    dimnames=list(NULL, c("chrom", "start", "end", "cnpindex")))
    
# This function redistributes the bins/probes from a removed segment into 
# the adjacent segments  
CNprep:::breakIntoCNPs.chrom(segTable=segTable, chrom="chrom", 
    startPos="chrom.pos.start", endPos="chrom.pos.end", 
    startProbe="start", endProbe="end", 
    eventIndex="eventIndex", 
    cnpTable=cnptable, cnpChrom="chrom",  
    cnpStart="start", cnpEnd="end", cnpIndex="cnpindex", 
    minCover=0.005, indexVals=c(-1, 1))


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