ChIPQC: Construct a 'ChIPQCexperiment' object

View source: R/ChIPQC_IF.R

ChIPQCR Documentation

Construct a ChIPQCexperiment object

Description

Constructs a new ChIPQCexperiment object.

Usage

ChIPQC(experiment, annotation, chromosomes, samples,
       consensus=FALSE, bCount=FALSE, mapQCth=15, blacklist=NULL, 
       profileWin=400, fragmentLength=125, shifts=1:300, ...)

Arguments

experiment

A specification of the ChIP-seq experiment to evaluate. This can either be a dataframe, a filename for a .csv file, or a DBA object as defined in the DiffBind package. Columns names in sample sheet may include:

  • SampleID: Identifier string for sample

  • Tissue: Identifier string for tissue type

  • Factor: Identifier string for factor

  • Condition: Identifier string for condition

  • Treatment: Identifier string for treatment

  • Replicate: Replicate number of sample

  • bamReads: file path for bam file containing aligned reads for ChIP sample

  • bamControl: file path for bam file containing aligned reads for control sample

  • ControlID: Identifier string for control sample

  • Peaks: path for file containing peaks for sample. Format determined by PeakCaller field or caller parameter

  • PeakCaller: Identifier string for peak caller used. If Peaks is not a bed file, this will determine how the Peaks file is parsed. If missing, will use default peak caller specified in caller parameter. Possible values:

    • “raw”: text file file; peak score is in fourth column

    • “bed”: .bed file; peak score is in fifth column

    • “narrow”: default peak.format: narrowPeaks file

    • “macs”: MACS .xls file

    • “swembl”: SWEMBL .peaks file

    • “bayes”: bayesPeak file

    • “fp4”: FindPeaks v4

  • PeakFormat: string indicating format for peak files; see PeakCaller and dba.peakset

  • ScoreCol: column in peak files that contains peak scores

  • LowerBetter: logical indicating that lower scores signify better peaks

See the documentation for the sampleSheet parameter of dba for details.

annotation

Either a character string indicating the genome and version to use as a genomic annotation, or a previously defined annotation (obtained using QCannotation on a previously defined ChIPQCexperiment object.) May be left unspecified, in which case no genomic feature analysis is performed. The following annotation specifiers are supported:

  • “hg19”: Human, version 19

  • “hg18”: Human, version 18

  • “mm10”: Mouse, version 10

  • “mm9” : Mouse, version 19

  • “rn4” : Rat, version 4

  • “ce6” : C. Elgans, version 6

  • “dm3” : D. Melanogaster, version 3

Alternatively, you can construct your own annotation; see the package vignette for more information.

chromosomes

Specification of which chromosomes to use for computing QC statistics. If missing, the first chromosome which has a peak is checked. If NULL, all chromosomes will be checked (which may be time-consuming). This can be a character string (e.g. “chr18”) or a vector or list of character strings. If it is an integer or vector of integers, the chromosomes will be checked based on the order that they are listed in a peak set.

samples

list of ChIPCsample objects. If present, the sample objects will be taken directly from this list instead of being computed using the ChIPQCsample constructor.

consensus

If consensus is a GRanges object, all samples will use this peakset when computing peak-based metrics. If consensus=TRUE, a consensus peakset will be generated and used for all samples, derived by merging overlapping peaks in all provided peaksets, keeping any peaks that overlap in at least two samples To avoid this behavior, set consensus=FALSE; this will result in only supplied peaksets being used for calculation of peak-based metrics (and no peak-based metric being computed for samples with no peakset specified, such as controls).

bCount

if TRUE, the peak scores for all samples will be based on read counts using dba.count using a consensus peakset. If consenus is missing, any samples (such as controls) that are not already associated with a peakset will be associated with the consensus peakset (if consensus is not missing, all samples will be associated with the consensus peakset). Note that the re-counting process may be time-consuming.

mapQCth

An integer representing a mapping quality score threshold. Only reads with mapping quality scores above this threshold will be used for some statistics.

blacklist

A GRanges object or filename specifying a bed file containing genomic regions that should be excluded from the analysis. If missing and the annotation is “hg19”, a default blacklist, blacklist_hg19 derived from the UCSC list, will be used. No blacklist is used if this is set to NULL, or is left missing and the annotation is not “hg19”.

profileWin

An integer indicating the width, in base pairs, of the window to be used for peak profiles. Peaks will be centered on their summits, and include half the window size upstream and half downstream of this point.

fragmentLength

An integer indicating the expected fragment length of the libraries. Optional, as this value will be computed for each library.

shifts

A vector of values to try when computing optimal shift sizes.

...

additional parameters passed to dba.count if bCount=TRUE.

Details

ChIPQC first constructs a new DBA object if one is not provided. Next it computes the annotation if one is not provided. The main loop constructs new ChIPQCsample objects for each sample (and unique control sample).

Value

A ChIPQCexperiment object.

Note

ChIPQC uses bplapply from the BiocParallel package to build the ChIPQCsample object in parallel, if supported. Control of the parallelization can be effected using BiocParallel functions, such as register.

Author(s)

Thomas Carroll and Rory Stark

See Also

ChIPQC-package, ChIPQCexperiment, ChIPQCsample, DiffBind

Examples

## Not run: exampleExp = ChIPQC(samples,annotation="hg19")
data(example_QCexperiment)
exampleExp

## Not run: tamoxifen = ChIPQC(samples, ,annotation="hg19", consensus=TRUE, bCounts=T)
data(tamoxifen_QC)
tamoxifen

shengqh/ChIPQC documentation built on Feb. 27, 2023, 10:51 p.m.