Learn R Programming

ExomeDepth (version 1.1.16)

AnnotateExtra,ExomeDepth-method: AnnotateExtra

Description

Add annotations to a ExomeDepth object.

Usage

# S4 method for ExomeDepth
AnnotateExtra(x, reference.annotation, min.overlap = 0.5, column.name)

Value

An ExomeDepth object with the relevant annotations added to the CNVcalls slot.

Arguments

x

An ExomeDepth object.

reference.annotation

The list of reference annotations in GRanges format.

min.overlap

Numeric, defaults to 0.5. This defines the minimum fraction of the CNV call that is covered by the reference call to declare that there is a significant overlap.

column.name

The name of the column used to store the overlap (in the slot CNV.calls).

Details

This function takes annotations in the GRanges format and adds these to the CNV calls in the ExomeDepth object. Note that a recent version of GenomicRanges (> 1.8.10) is required. Otherwise the function will return a warning and not update the ExomeDepth object.

Examples

Run this code

data(ExomeCount)  #pick an example count file
small_count <- ExomeCount[1:100, ]  #reduce the size for speedy computations
## create a dummy test object
example_object <- new('ExomeDepth', test = small_count$Exome2, reference = small_count$Exome3)

## artifically create a couple of CNV calls for this test
example_object@CNV.calls <- data.frame(chromosome = c(1,7),
                                       start = c(108778622, 61286538),
                                       end = c(109000909,61296735))

data(Conrad.hg19)
print(example_object@CNV.calls)
example_object_annotated <- AnnotateExtra(x = example_object,
                             reference.annotation = Conrad.hg19.common.CNVs,
                             min.overlap = 0.1,
                             column.name = 'Conrad.hg19')
print(example_object_annotated@CNV.calls)

Run the code above in your browser using DataLab