rangeSampleMeans {genoset} | R Documentation

## 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

      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" )

[Package genoset version 1.38.0 Index]