Last data update: 2014.03.03

R: Divide binned read counts with those of reference samples
compareToReferenceR Documentation

Divide binned read counts with those of reference samples

Description

Divide binned read counts with those of reference samples.

Usage

compareToReference(object, references, force=FALSE)

Arguments

object

An object of class QDNAseqCopyNumbers.

references

A numeric vector of indexes of the reference sample. Must be the same length as there are samples in object. When NA, the sample will be kept as is. When FALSE, the sample will be removed from the output. As an example, object contains three samples: tumor1, tumor2, and normal2. There is no reference for tumor1, but normal2 is a matched normal sample from the same patient as tumor2. The keep tumor1 as is, but to divide tumor2 with normal2, argument references should be c(NA, 3, FALSE).

force

Whether to force the operation even when downstream data will be lost.

Value

Returns a QDNAseqCopyNumbers object with the desired samples divided by the signal of their reference samples.

Author(s)

Ilari Scheinin

Examples

data(LGG150)
readCounts <- LGG150
readCountsFiltered <- applyFilters(readCounts)
readCountsFiltered <- estimateCorrection(readCountsFiltered)
copyNumbers <- correctBins(readCountsFiltered)
copyNumbersNormalized <- normalizeBins(copyNumbers)
copyNumbersSmooth <- smoothOutlierBins(copyNumbersNormalized)
# Note: the following command will compare the sample to itself, which
# does not really make sense:
tumorVsNormal <- compareToReference(copyNumbersSmooth, c(1))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(QDNAseq)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/QDNAseq/compareToReference.Rd_%03d_medium.png", width=480, height=480)
> ### Name: compareToReference
> ### Title: Divide binned read counts with those of reference samples
> ### Aliases: compareToReference
> ###   compareToReference,QDNAseqCopyNumbers,numeric-method
> ### Keywords: manip
> 
> ### ** Examples
> 
> data(LGG150)
> readCounts <- LGG150
> readCountsFiltered <- applyFilters(readCounts)
38,819	total bins
38,819	of which in selected chromosomes
36,722	of which with reference sequence
33,347	final bins
> readCountsFiltered <- estimateCorrection(readCountsFiltered)
Calculating correction for GC content and mappability
    Calculating fit for sample LGG150 (1 of 1) ...
Done.
> copyNumbers <- correctBins(readCountsFiltered)
> copyNumbersNormalized <- normalizeBins(copyNumbers)
Applying median normalization ...
> copyNumbersSmooth <- smoothOutlierBins(copyNumbersNormalized)
Smoothing outliers ...
> # Note: the following command will compare the sample to itself, which
> # does not really make sense:
> tumorVsNormal <- compareToReference(copyNumbersSmooth, c(1))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>