addCNV: estimate CNV information and add to qseaSet object

Description Usage Arguments Value Author(s) See Also Examples

View source: R/qsea.addCNV.R

Description

This function adds information on Copy Number Variation (CNV) to the qseaSet object, which is used for normalization. Sample wise CNV information can either be provided, or estimated from input or enrichment sequencing data, by incorporating functions of the HMMcopy package.

Usage

1
2
3
addCNV(qs,file_name, window_size=1000000, paired=FALSE, fragment_length,cnv, 
mu=log2(c(1/2, 2/3, 1, 3/2,2,3)), normal_idx, plot_dir, MeDIP=FALSE, 
parallel=FALSE)

Arguments

qs

the qseaSet object

cnv

pre-computed CNV information for each sample. If provided, the following parameters are ignored

file_name

column name of the sample table for the sequencing files, from which CNV information are computed

window_size

window size for CNV analysis

paired

are files in file_name column paired end

fragment_length

for single end sequencing, provide the average fragment length

mu

a priori CNV levels of different states, parameter passed to HMMcopy

normal_idx

index of samples which are assumed to be CNV free. The median of these samples serves as "normal" CNV reference level, and CNV are computed relative to this reference level. By default, QSEA looks for samples with "normal" or "control" in its name.

plot_dir

If provided, detail CNV plots for each chromosome and each sample are created in the provided directory

MeDIP

If set TRUE, QSEA assumes that provided files are methylation enriched sequencing data. In this case, only fragments without CpG dinucleotides are considered. This option allows QSEA to infer CNV information from MeDIP or MDB seq experiments directly

parallel

Switch for parallel computing, using BiocParallel

Value

The qseaSet object, extended by the CNV information

Author(s)

Mathias Lienhard

See Also

HMMsegment

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library("BSgenome.Hsapiens.UCSC.hg19")

bam_hESCs_1 = system.file("extdata", 
    "hESCs.MeDIP.Rep1.chr22.bam", package="MEDIPSData")
bam_hESCs_2 = system.file("extdata", 
    "hESCs.MeDIP.Rep2.chr22.bam", package="MEDIPSData")
sample_table=data.frame(sample_name=paste0("hESCs_", 1:2), 
    file_name=c(bam_hESCs_1,bam_hESCs_2), 
    group=rep("hESC",2), stringsAsFactors=FALSE)
qseaSet=createQseaSet(sampleTable=sample_table, 
        BSgenome="BSgenome.Hsapiens.UCSC.hg19", 
        chr.select="chr22", 
        window_size=500)

#this is an example for computing CNVs from MeDIP data. A very limited example
#however, since the samples do not contain CNVs.
qseaSet=addCNV(qseaSet, fragment_length=300, file_name="file_name", MeDIP=TRUE,
window_size=1000000)

qsea documentation built on Nov. 8, 2020, 8:28 p.m.