breakIntoGaps: Redistribute probes/bins in removed segments into the...

View source: R/breakIntoGaps.R

breakIntoGapsR Documentation

Redistribute probes/bins in removed segments into the adjacent segments.

Description

This function redistributes the probes/bins from a removed segment into the adjacent segments for one specific chromosome at the time. The function uses an uniform distribution to select the proportion of probes/bins each adjacent segments will receive.

Usage

breakIntoGaps(segTable, gapInd, startProbe, endProbe)

Arguments

segTable

a matrix or a data.frame with 3 columns named or enumerated by the values of startProbe, endProbe, gapInd.

gapInd

a character string specifying the name of the column in segTable that tabulates the segments to remove. The value 1 identifies segments to remove while 0 identifies segments to keep.

startProbe

a character string specifying the name of the column in segTable that tabulates the (integer) start postion 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 postion of each segment in internal units such as probe numbers for data of CGH microarray origin.

Value

a matrix of numeric with 2 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.

Author(s)

Alexander Krasnitz, Guoli Sun

Examples


## Table containing information about segments in the chromosome
## The table must have a column with the information about segments
## to be removed (in the example, the column "toremove")
## The table must also have start and end columns
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),
    toremove = c(0, 1, 0, 1, 0))
    
## This function redistributes the bins/probes from a removed segment into 
## the adjacent segments  
CNprep:::breakIntoGaps(segTable = segTable, gapInd = "toremove",
    startProbe = "start", endProbe = "end")


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