Learn R Programming

metaseqR (version 1.12.2)

filter.genes: Filter gene expression based on gene counts

Description

This function performs the gene expression filtering based on gene read counts and a set of gene filter rules. For more details see the main help pages of metaseqr.

Usage

filter.genes(gene.counts, gene.data, gene.filters)

Arguments

gene.counts
a matrix of gene counts, preferably after the normalization procedure.
gene.data
an annotation data frame usually obtained with get.annotation containing the unique gene accession identifiers.
gene.filters
a named list with gene filters and their parameters. See the main help page of metaseqr for details.

Value

  • a named list with three members. The first member (result is a named list whose names are the gene filter names and its members are the filtered rownames of gene.data. The second member (cutoff is a named list whose names are the gene filter names and its members are the cutoff values corresponding to each filter. The third member is a matrix of binary flags (0 for non-filtered, 1 for filtered) for each gene. The rownames of the flag matrix correspond to gene ids.

Examples

Run this code
data("mm9.gene.data",package="metaseqR")
gene.counts <- mm9.gene.counts
sample.list <- sample.list.mm9
gene.counts <- normalize.edger(as.matrix(gene.counts[,9:12]),
    sample.list)
gene.data <- get.annotation("mm9","gene")
gene.filters <- get.defaults("gene.filter","mm9")
filter.results <- filter.genes(gene.counts,gene.data,
    gene.filters)

Run the code above in your browser using DataLab