workflows/annotation/azimuth
Description
Cell type annotation workflow using Azimuth reference mapping (Seurat RunAzimuth()).
Accepts either an H5MU file (--input) or a Seurat object (--input_seurat) as query.
For H5MU input, the modalities are split, the modality selected with --modality is converted
to a Seurat object and mapped onto the Azimuth reference, and the annotated modality is converted
back and merged with the other (untouched) modalities. For Seurat input, the selected assay is
annotated and converted to an H5MU file containing a single modality.
Inputs
Name | Type & Properties | Description |
|---|---|---|
--input -i | file | The input (query) data to be annotated. Should be an .h5mu file. |
--input_seurat | file | The input (query) data to be annotated. Should be an .rds file containing a Seurat object with raw (unnormalized) counts. |
--modality | string | Which modality of `--input` to annotate. When using `--input_seurat`, this is the name of the modality the annotated assay is stored in in the output. |
--input_seurat_assay | string | Name of the Seurat assay in `--input_seurat` to run the annotation on. Only used with `--input_seurat`. |
--input_layer | string | Layer containing the raw (unnormalized) counts. RunAzimuth() normalizes these internally using SCTransform. With `--input`, this is a layer of `--modality`; if not provided, .X is used. With `--input_seurat`, this is a layer of `--input_seurat_assay`; if not provided, "counts" is used. |
--input_var_gene_names | string | Column in .var (`--input`) or in the feature metadata of `--input_seurat_assay` (`--input_seurat`) containing gene symbols. If not provided, the feature names are used. Azimuth references use gene symbols; when the query features are Ensembl IDs, Azimuth converts them using a homolog table downloaded at runtime. |
--input_reference_gene_overlap | integer | Minimum number of genes that must overlap between the query and the reference for the mapping to be performed. |
Reference
Name | Type & Properties | Description |
|---|---|---|
--reference | string required | Name of a curated Azimuth reference, downloaded and installed automatically on first use via SeuratData. See https://azimuth.hubmapconsortium.org/references/ for a description of each reference. Set to "custom" to use a local reference instead, provided via `--custom_reference`. |
--custom_reference | file | Path to a local directory containing a "ref.Rds" and "idx.annoy" file pair for a custom reference, e.g. as created by annotate/azimuth_reference. If provided, `--reference` must be set to "custom". |
--annotation_levels | string multiple | Which annotation levels (columns in the reference's metadata, e.g. "celltype.l1", "celltype.l2") to transfer. If not provided, all annotation levels available in the reference are transferred. |
--do_adt | boolean_true | Whether to impute a protein (ADT) assay from the reference, if the reference includes antibody-derived tag data. The imputed expression is stored in a separate modality (see `--output_modality_imputed_adt`). |
Mapping arguments
Name | Type & Properties | Description |
|---|---|---|
--k_weight | integer | Number of neighbors to consider when weighting anchors during label/embedding transfer. |
--n_trees | integer | Number of trees used when building the annoy index for neighbor search. |
--mapping_score_k | integer | Number of neighbors used to compute the per-cell mapping score. |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output | file required output | The annotated output .h5mu file. |
--write_seurat | boolean_true | Whether to also write the annotated Seurat object to `--output_seurat`. |
--output_seurat | file output | The annotated Seurat object (.rds file). Only written when `--write_seurat` is set. With `--input`, this object only contains the annotated `--modality` (as assay "RNA"), not the other modalities. |
--output_seurat_compression | string | Compression used when writing `--output_seurat`. |
--output_obs_predictions | string multiple | In which `.obs` slots to store the predicted cell labels. If provided, `--annotation_levels` must be provided as well, and both must have the same length. If empty, defaults to `azimuth_pred_<level>`, with "." in the level name replaced by "_". |
--output_obs_probability | string multiple | In which `.obs` slots to store the prediction scores. If provided, `--annotation_levels` must be provided as well, and both must have the same length. If empty, defaults to `azimuth_probability_<level>`, with "." in the level name replaced by "_". |
--output_obs_mapping_score | string | In which `.obs` slot to store the per-cell mapping score. |
--output_obsm_umap | string | In which `.obsm` slot to store the query embedding projected onto the reference UMAP. |
--output_obsm_integrated | string | In which `.obsm` slot to store the integrated (reference-projected) embedding. |
--output_modality_imputed_adt | string | Name of the modality in which the imputed protein expression is stored when `--do_adt` is set. Must not already exist in `--input`. |
--output_compression | string | The compression format to be used on the output h5mu object. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
modality: [ "rna" ]
input_seurat_assay: [ "RNA" ]
input_reference_gene_overlap: [ 100 ]
k_weight: [ 50 ]
n_trees: [ 20 ]
mapping_score_k: [ 100 ]
output: "$id.$key.output.h5mu"
output_seurat: "$id.$key.output_seurat.rds"
output_seurat_compression: [ "gzip" ]
output_obs_mapping_score: [ "azimuth_mapping_score" ]
output_obsm_umap: [ "X_azimuth_umap" ]
output_obsm_integrated: [ "X_integrated_azimuth" ]
output_modality_imputed_adt: [ "prot_imputed" ]
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/openpipeline.git \
-revision v5.0.0 \
-main-script target/nextflow/workflows/annotation/azimuth/main.nf \
-params-file params.yaml Relationships
Used by
0 relationships
No components use this component.
Current component
workflows/annotation/azimuthopenpipeline v5.0.0