View source: R/MODULE_3_QC_PCA.R
min_count_filter | R Documentation |
Function to filter out genes with counts below a minimum in one or more samples.
min_count_filter(x, mincount, columns, method = "all")
x |
Input data frame containing RNA-seq or Ribo-seq data. Rows are genes/transcripts and columns are samples. The data.frame may contain additional columns for gene/transcript ID or other metadata. |
mincount |
A single number (float), minimum RNA or RPF count required for a gene/transcript to be retained. |
columns |
A vector specifying the columns to be considered for minimum count filtering. |
method |
The method of filtering. Options: |
If method="all"
is chosen, a gene passes the filtering only if all samples specified
by the columns
argument have values >= mincount
. If method="average"
is chosen, a gene
passes the filtering if the average count among the specified columns
is >= mincount
.
Use the columns
argument to exclude gene/transcript ID and other metadata columns from the
calculations or to filter RNA and RPF counts separately while keeping them in the same data.frame.
Filtered data frame containing all the original columns but only the rows (genes) that pass the filtering criterion.
rr_LMCN.v1 <- min_count_filter(rr_LMCN, mincount = 5, columns = c(2:9), method = "all") rr_LMCN.v2 <- min_count_filter(rr_LMCN.v1, mincount = 2, columns = c(10:17), method = "average")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.