Skip to contents

Takes as input a normalized matrix (see metamoRph::normalize_data). Returns the ntop high variable genes either with the "classic" method which orders the features by variance or "scran" which uses the scran package's strategy of scaling variance by value (as larger features/genes) will also have higher variance and thus may be less useful for sample distinction.

Usage

select_HVG(
  feature_by_sample,
  ntop = 1000,
  hvg_selection = "scran",
  remove_regex = "^MT|^RPS|^RPL",
  hvg_force = NULL
)

Arguments

feature_by_sample

Raw feature (gene) count matrix (where genes/features are rows and samples are columns).

ntop

Number of highly variable genes/features to use in the prcomp PCA. Defaults to 1000.

hvg_selection

Either "classic" or "scran" to select the "ntop" features. "classic" will simply use the top n features by variance, and "scran" will use the scran package's strategy of scaling variance by expression (as highly expressed features/genes) will also have higher variance and thus may be less useful for sample distinction.

remove_regex

Default regex pattern is '^MT|^RPS|^RPL'. Set to '' to skip.

hvg_force

Optional vector of features / genes that must be in the stats::promp

Value

character vector of the ntop features

Details

This function is used by metamoRph::run_pca