workflows/embedding_model/scanvi_model
Description
Generation of a scANVI reference model.
Inputs
Name | Type & Properties | Description |
|---|---|---|
--input | file required | Reference dataset consisting of the labeled observations to train the scANVI classifier on. |
--modality | string | The modality from the --input to be processed. |
--layer | string | Which layer to use if .X is not to be used. |
--obs_target | string required | The `.obs` key containing the target labels. |
--obs_batch_label | string required | The .obs field in the reference dataset containing the batch labels. |
--obs_size_factor | string | Key in adata.obs for size factor information. Instead of using library size as a size factor, the provided size factor column will be used as offset in the mean of the likelihood. Assumed to be on linear scale. |
--obs_categorical_covariate | string multiple | Keys in adata.obs that correspond to categorical data. These covariates can be added in addition to the batch covariate and are also treated as nuisance factors (i.e., the model tries to minimize their effects on the latent space). Thus, these should not be used for biologically-relevant factors that you do _not_ want to correct for. Important: the order of the categorical covariates matters and should match the order of the covariates in the query data. |
--obs_continuous_covariate | string multiple | Keys in adata.obs that correspond to continuous data. These covariates can be added in addition to the batch covariate and are also treated as nuisance factors (i.e., the model tries to minimize their effects on the latent space). Thus, these should not be used for biologically-relevant factors that you do _not_ want to correct for. Important: the order of the continuous covariates matters and should match the order of the covariates in the query data. |
--unlabeled_category | string | Value in the --obs_batch_label field that indicates unlabeled observations |
--var_hvg | string | .var column containing highly variable genes. If provided, scANVI classifier will be trained only on HVG. |
--var_gene_names | string | .var column containing gene names. By default, use the index. |
scVI and scANVI training options
Name | Type & Properties | Description |
|---|---|---|
--early_stopping | boolean | Whether to perform early stopping with respect to the validation set. |
--early_stopping_monitor | string | Metric logged during validation set epoch. |
--early_stopping_patience | integer | Number of validation epochs with no improvement after which training will be stopped. |
--early_stopping_min_delta | double | Minimum change in the monitored quantity to qualify as an improvement, i.e. an absolute change of less than min_delta, will count as no improvement. |
--max_epochs | integer | Number of passes through the dataset, defaults to (20000 / number of cells) * 400 or 400; whichever is smallest. |
--reduce_lr_on_plateau | boolean | Whether to monitor validation loss and reduce learning rate when validation set `lr_scheduler_metric` plateaus. |
--lr_factor | double | Factor to reduce learning rate. |
--lr_patience | double | Number of epochs with no improvement after which learning rate will be reduced. |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output | file required output | The query data in .h5mu format with predicted labels predicted from the classifier trained on the reference. |
--output_obsm_integrated_scvi | string | The .obsm field in the output h5mu object where the scVI latent representation will be stored. |
--output_obsm_integrated_scanvi | string | The .obsm field in the output h5mu object where the scANVI latent representation will be stored. |
--output_obs_predictions | string | The .obs field in the output h5mu object where the predicted labels from the scANVI classifier will be stored. |
--output_obs_probabilities | string | The .obs field in the output h5mu object where the predicted probabilities from the scANVI classifier will be stored. |
--output_compression | string | The compression format to be used on the output h5mu object. |
--output_scvi_model | file output | Path to the resulting scVI model that was trained on the reference dataset. |
--output_scanvi_model | file output | Path to the resulting scANVI model that was trained on the reference dataset. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
modality: [ "rna" ]
unlabeled_category: [ "Unknown" ]
early_stopping_monitor: [ "elbo_validation" ]
early_stopping_patience: [ 45 ]
early_stopping_min_delta: [ 0 ]
reduce_lr_on_plateau: [ true ]
lr_factor: [ 0.6 ]
lr_patience: [ 30 ]
output: "$id.$key.output.h5mu"
output_obsm_integrated_scvi: [ "X_integrated_scvi" ]
output_obsm_integrated_scanvi: [ "X_integrated_scanvi" ]
output_obs_predictions: [ "scanvi_pred" ]
output_obs_probabilities: [ "scanvi_probabilities" ]
output_scvi_model: "$id.$key.output_scvi_model.path/to/scvi_model"
output_scanvi_model: "$id.$key.output_scanvi_model.path/to/scanvi_model"
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/embedding_model/scanvi_model/main.nf \
-params-file params.yaml Relationships
Used by
1 relationships
Current component
workflows/embedding_model/scanvi_modelopenpipeline v5.0.0
Uses
2 relationships