Learn R Programming

genoset (version 1.28.2)

rangeSampleMeans: Average features in ranges per sample

Description

This function takes per-feature genomic data and returns averages for each of a set of genomic ranges. The most obvious application is determining the copy number of a set of genes. The features corresponding to each gene are determined with boundingIndices such that all features with the bounds of a gene (overlaps). The features on either side of the gene unless those positions exactly match the first or last base covered by the gene. Therefore, genes falling between two features will at least cover two features. Range bounding is performed by the boundingIndices function.

Usage

rangeSampleMeans(query, subject, assay.element, na.rm = FALSE)

Arguments

query
GRanges object representing genomic regions (genes) to be averaged.
subject
A GenoSet object or derivative
assay.element
character, name of element in assayData to use to extract data
na.rm
scalar logical, ignore NAs?

Value

  • numeric matrix of features in each range averaged by sample

See Also

Other "range summaries": boundingIndicesByChr, boundingIndices

Examples

Run this code
data(genoset)
  my.genes = GRanges( ranges=IRanges(start=c(35e6,128e6),end=c(37e6,129e6),names=c("HER2","CMYC")), seqnames=c("chr17","chr8") )
  rangeSampleMeans( my.genes, genoset.ds, "lrr" )

Run the code above in your browser using DataLab