sc_feature_filter: Filter scRNA-seq expression matrix to keep only highly...

Description Usage Arguments Details Value Examples

View source: R/sc_feature_filter.R

Description

This pipeline function takes an expression matrix as an input and select the features (genes, transcripts) with an estimated technical noise level lower that biological variation in the data. This is achieved by binning the data and calculating the correlation for each bin with highly expressed (lowest noise) gene set (see the vignette for details on the method).

Usage

1
2
3
sc_feature_filter(sc_data, print_plots = FALSE, max_zeros = 0.75,
  threshold = 2, top_window_size = 100, other_window_size = 1000,
  n_random = 3, sce_assay = NULL)

Arguments

sc_data

A data frame, a matrix or a SingleCellExperiment object. If data frame or matrix, it should contain expression values for each gene as rows, and expression values for the cells as columns.

print_plots

A boolean. Should the function produce three plots as a side effect? Plots are the output of plot_mean_variance, plot_correlations_distributions and plot_metric.

max_zeros

A number between 0 and 1. Maximum proportion of cells with 0 expression for a feature to be kept.

threshold

A number higher than 1. The higher the more stringent the feature selection will be. See determine_bin_cutoff.

top_window_size

Size of the reference bin. See define_top_genes

other_window_size

Size of the other bins of feature. See bin_scdata

n_random

Number of control windows generated by shuffling the top bin of features.

sce_assay,

if sc_data is an SingleCellExperiment object, sce_assay should be one of names(assays(<SingleCellExperiment>)).

Details

The function can optionally produce three plots of print_plots is TRUE. It is recommended to open a graphical device (i.e. through pdf or png), to call scFeatureFilter,and then to close the device with dev.off.

Value

A matrix or a tibble, depending on the type of sc_data, containing only the top expressed features.

Examples

1
2
3
4
5
6
7
8
9
sc_feature_filter(scData_hESC)

# with plots
## Not run: 
pdf("diagnostic.pdf")
sc_feature_filter(sc_data, print_plots = TRUE)
dev.off()

## End(Not run)

scFeatureFilter documentation built on Nov. 8, 2020, 7:49 p.m.