createDisjoinSegmentsForTwoSamples: Generate common segments to enable calculation of metrics on...

View source: R/CNVMetricsLog2ratioInternalMethods.R

createDisjoinSegmentsForTwoSamplesR Documentation

Generate common segments to enable calculation of metrics on two segmented samples.

Description

The two segments are gathered together, including excluded regions when specified, and a disjoint operation is done to create a collection of non-overlapping ranges. The ranges overlapping the excluded regions are marked as so to be removed from future analysis. The log2value of each samples are assigned to the new disjointed segments for each sample in the metadata columns.

Usage

createDisjoinSegmentsForTwoSamples(
  segmentDataSample1,
  segmentDataSample2,
  bedExclusion = NULL
)

Arguments

segmentDataSample1

a GRanges, the segments from the first sample.

segmentDataSample2

a GRanges, the segments from the second sample.

bedExclusion

a GRanges, the regions that must be excluded from the analysis. Default: NULL.

Value

a GRanges containing the common segment information for the two samples. The log2ration value are present, for the two samples, in the metadata columns. When there is not log2ratio value for one sample, NA is the assigned value. A metadata column also specifies if the segments should be included in the analysis.

Author(s)

Astrid DeschĂȘnes

Examples


## Load required package to generate the two samples
require(GenomicRanges)

# Create first Granges representing first sample
sample01 <- GRanges(seqnames="chr1",
    ranges=IRanges(start=c(100, 201, 400), end=c(200, 350, 500)),
    strand="*", log2ratio=c(0.3091175, 0.4582058, -0.3798390))

# Create second Granges representing second sample
sample02 <- GRanges(seqnames="chr1",
    ranges=IRanges(start=c(150, 200, 450), end=c(250, 350, 500)),
    strand="*", log2ratio=c(0.222174, 0.3282156, -0.2728292))

# Create disjoint segment using the 2 samples and without any region
# excluded from the analysis (parameter bedExclusion set to null)
CNVMetrics:::createDisjoinSegmentsForTwoSamples(segmentDataSample1=sample01, 
    segmentDataSample2=sample02, bedExclusion=NULL)


KrasnitzLab/CNVMetrics documentation built on July 30, 2023, 2:22 p.m.