filter/filter_with_hvg
Description
Annotate highly variable genes [Satija15] [Zheng17] [Stuart19].
Expects logarithmized data, except when flavor='seurat_v3' in which count data is expected.
Depending on flavor, this reproduces the R-implementations of Seurat [Satija15], Cell Ranger [Zheng17], and Seurat v3 [Stuart19].
For the dispersion-based methods ([Satija15] and [Zheng17]), the normalized dispersion is obtained by scaling with the mean and standard deviation of the dispersions for genes falling into a given bin for mean expression of genes. This means that for each bin of mean expression, highly variable genes are selected.
For [Stuart19], a normalized variance for each gene is computed. First, the data are standardized (i.e., z-score normalization per feature) with a regularized standard deviation. Next, the normalized variance is computed as the variance of each gene after the transformation. Genes are ranked by the normalized variance.
Arguments
Name | Type & Properties | Description |
|---|---|---|
--input | file required | Input h5mu file |
--modality | string | |
--layer | string | use adata.layers[layer] for expression values instead of adata.X. |
--output | file output | Output h5mu file. |
--output_compression | string | The compression format to be used on the output h5mu object. |
--var_name_filter | string | In which .var slot to store a boolean array corresponding to which observations should be filtered out. |
--varm_name | string | In which .varm slot to store additional metadata. |
--do_subset | boolean_true | Whether to subset before storing the output. |
--flavor | string | Choose the flavor for identifying highly variable genes. For the dispersion based methods in their default workflows, Seurat passes the cutoffs whereas Cell Ranger passes n_top_genes. |
--n_top_genes | integer | Number of highly-variable genes to keep. Mandatory if flavor='seurat_v3'. |
--min_mean | double | If n_top_genes is defined, this and all other cutoffs for the means and the normalized dispersions are ignored. Ignored if flavor='seurat_v3'. |
--max_mean | double | If n_top_genes is defined, this and all other cutoffs for the means and the normalized dispersions are ignored. Ignored if flavor='seurat_v3'. |
--min_disp | double | If n_top_genes is defined, this and all other cutoffs for the means and the normalized dispersions are ignored. Ignored if flavor='seurat_v3'. |
--max_disp | double | If n_top_genes is defined, this and all other cutoffs for the means and the normalized dispersions are ignored. Ignored if flavor='seurat_v3'. Default is +inf. |
--span | double | The fraction of the data (cells) used when estimating the variance in the loess model fit if flavor='seurat_v3'. |
--n_bins | integer | Number of bins for binning the mean gene expression. Normalization is done with respect to each bin. If just a single gene falls into a bin, the normalized dispersion is artificially set to 1. |
--obs_batch_key | string | If specified, highly-variable genes are selected within each batch separately and merged. This simple process avoids the selection of batch-specific genes and acts as a lightweight batch correction method. For all flavors, genes are first sorted by how many batches they are a HVG. For dispersion-based flavors ties are broken by normalized dispersion. If flavor = 'seurat_v3', ties are broken by the median (across batches) rank based on within-batch normalized variance. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
modality: [ "rna" ]
output: "$id.$key.output.h5mu"
var_name_filter: [ "filter_with_hvg" ]
varm_name: [ "hvg" ]
flavor: [ "seurat" ]
min_mean: [ 0.0125 ]
max_mean: [ 3 ]
min_disp: [ 0.5 ]
span: [ 0.3 ]
n_bins: [ 20 ]
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/openpipeline.git \
-revision 1.0.3 \
-main-script target/nextflow/filter/filter_with_hvg/main.nf \
-params-file params.yaml Relationships
Used by
No components use this component.
Current component
Uses
No component dependencies found.