Totalvi leiden

Run totalVI integration followed by neighbour calculations, leiden clustering and run umap on the result.

Info

ID: totalvi_leiden
Namespace: workflows/integration

Example commands

You can run the pipeline using nextflow run.

View help

You can use --help as a parameter to get an overview of the possible parameters.

nextflow run openpipelines-bio/openpipeline \
  -r 2.1.0 -latest \
  -main-script target/nextflow/workflows/integration/totalvi_leiden/main.nf \
  --help

Run command

Example of params.yaml
# Inputs
id: # please fill in - example: "foo"
input: # please fill in - example: "dataset.h5mu"
# layer: "foo"
modality: "rna"
prot_modality: "prot"
reference: # please fill in - example: "path/to/file"

# Outputs
# output: "$id.$key.output.h5mu"
# reference_model_path: "totalvi_model_reference"
# query_model_path: "totalvi_model_query"

# General TotalVI Options
obs_batch: "sample_id"
max_epochs: 400
max_query_epochs: 200
weight_decay: 0.0
force_retrain: false
# var_input: "foo"

# TotalVI integration options RNA
rna_reference_modality: "rna"
rna_obsm_output: "X_totalvi"

# TotalVI integration options ADT
prot_reference_modality: "prot"
prot_obsm_output: "X_totalvi"

# Neighbour calculation RNA
rna_uns_neighbors: "totalvi_integration_neighbors"
rna_obsp_neighbor_distances: "totalvi_integration_distances"
rna_obsp_neighbor_connectivities: "totalvi_integration_connectivities"

# Neighbour calculation ADT
prot_uns_neighbors: "totalvi_integration_neighbors"
prot_obsp_neighbor_distances: "totalvi_integration_distances"
prot_obsp_neighbor_connectivities: "totalvi_integration_connectivities"

# Clustering options RNA
rna_obs_cluster: "totalvi_integration_leiden"
rna_leiden_resolution: [1.0]

# Clustering options ADT
prot_obs_cluster: "totalvi_integration_leiden"
prot_leiden_resolution: [1.0]

# Umap options
obsm_umap: "X_totalvi_umap"

# Nextflow input-output arguments
publish_dir: # please fill in - example: "output/"
# param_list: "my_params.yaml"

# Arguments
nextflow run openpipelines-bio/openpipeline \
  -r 2.1.0 -latest \
  -profile docker \
  -main-script target/nextflow/workflows/integration/totalvi_leiden/main.nf \
  -params-file params.yaml
Note

Replace -profile docker with -profile podman or -profile singularity depending on the desired backend.

Argument groups

Inputs

Name Description Attributes
--id ID of the sample. string, required, example: "foo"
--input Path to the sample. file, required, example: "dataset.h5mu"
--layer use specified layer for expression values instead of the .X object from the modality. string
--modality Which modality to process. string, default: "rna"
--prot_modality Which modality to process. string, default: "prot"
--reference Input h5mu file with reference data to train the TOTALVI model. file, required

Outputs

Name Description Attributes
--output Destination path to the output. file, required, example: "output.h5mu"
--reference_model_path Directory with the reference model. If not exists, trained model will be saved there file, default: "totalvi_model_reference"
--query_model_path Directory, where the query model will be saved file, default: "totalvi_model_query"

General TotalVI Options

Name Description Attributes
--obs_batch .Obs column name discriminating between your batches. string, default: "sample_id"
--max_epochs Number of passes through the dataset integer, default: 400
--max_query_epochs Number of passes through the dataset, when fine-tuning model for query integer, default: 200
--weight_decay Weight decay, when fine-tuning model for query double, default: 0
--force_retrain If true, retrain the model and save it to reference_model_path boolean_true
--var_input Boolean .var column to subset data with (e.g. containing highly variable genes). By default, do not subset genes. string

TotalVI integration options RNA

Name Description Attributes
--rna_reference_modality string, default: "rna"
--rna_obsm_output In which .obsm slot to store the normalized RNA from TOTALVI. string, default: "X_totalvi"

TotalVI integration options ADT

Name Description Attributes
--prot_reference_modality Name of the modality containing proteins in the reference string, default: "prot"
--prot_obsm_output In which .obsm slot to store the normalized protein data from TOTALVI. string, default: "X_totalvi"

Neighbour calculation RNA

Name Description Attributes
--rna_uns_neighbors In which .uns slot to store various neighbor output objects. string, default: "totalvi_integration_neighbors"
--rna_obsp_neighbor_distances In which .obsp slot to store the distance matrix between the resulting neighbors. string, default: "totalvi_integration_distances"
--rna_obsp_neighbor_connectivities In which .obsp slot to store the connectivities matrix between the resulting neighbors. string, default: "totalvi_integration_connectivities"

Neighbour calculation ADT

Name Description Attributes
--prot_uns_neighbors In which .uns slot to store various neighbor output objects. string, default: "totalvi_integration_neighbors"
--prot_obsp_neighbor_distances In which .obsp slot to store the distance matrix between the resulting neighbors. string, default: "totalvi_integration_distances"
--prot_obsp_neighbor_connectivities In which .obsp slot to store the connectivities matrix between the resulting neighbors. string, default: "totalvi_integration_connectivities"

Clustering options RNA

Name Description Attributes
--rna_obs_cluster Prefix for the .obs keys under which to add the cluster labels. Newly created columns in .obs will be created from the specified value for ‘–obs_cluster’ suffixed with an underscore and one of the resolutions resolutions specified in ‘–leiden_resolution’. string, default: "totalvi_integration_leiden"
--rna_leiden_resolution Control the coarseness of the clustering. Higher values lead to more clusters. List of double, default: 1, multiple_sep: ";"

Clustering options ADT

Name Description Attributes
--prot_obs_cluster Prefix for the .obs keys under which to add the cluster labels. Newly created columns in .obs will be created from the specified value for ‘–obs_cluster’ suffixed with an underscore and one of the resolutions resolutions specified in ‘–leiden_resolution’. string, default: "totalvi_integration_leiden"
--prot_leiden_resolution Control the coarseness of the clustering. Higher values lead to more clusters. List of double, default: 1, multiple_sep: ";"

Umap options

Name Description Attributes
--obsm_umap In which .obsm slot to store the resulting UMAP embedding. string, default: "X_totalvi_umap"

Authors

  • Dries Schaumont (author)

Visualisation

flowchart TB
    v0(Channel.fromList)
    v2(filter)
    v10(filter)
    v18(totalvi)
    v25(cross)
    v35(cross)
    v41(filter)
    v50(filter)
    v65(cross)
    v75(cross)
    v84(branch)
    v111(concat)
    v96(cross)
    v106(cross)
    v115(branch)
    v142(concat)
    v127(cross)
    v137(cross)
    v146(branch)
    v173(concat)
    v158(cross)
    v168(cross)
    v180(cross)
    v190(cross)
    v196(filter)
    v350(concat)
    v205(filter)
    v220(cross)
    v230(cross)
    v239(branch)
    v266(concat)
    v251(cross)
    v261(cross)
    v270(branch)
    v297(concat)
    v282(cross)
    v292(cross)
    v301(branch)
    v328(concat)
    v313(cross)
    v323(cross)
    v335(cross)
    v345(cross)
    v357(cross)
    v364(cross)
    v376(cross)
    v383(cross)
    v387(Output)
    subgraph group_rna_neighbors_leiden_umap [rna_neighbors_leiden_umap]
        v58(find_neighbors)
        v89(leiden)
        v120(move_obsm_to_obs)
        v151(umap)
    end
    subgraph group_adt_neighbors_leiden_umap [adt_neighbors_leiden_umap]
        v213(find_neighbors)
        v244(leiden)
        v275(move_obsm_to_obs)
        v306(umap)
    end
    v84-->v111
    v115-->v142
    v146-->v173
    v239-->v266
    v270-->v297
    v301-->v328
    v0-->v2
    v2-->v10
    v10-->v18
    v18-->v25
    v10-->v25
    v10-->v35
    v41-->v50
    v50-->v58
    v58-->v65
    v50-->v65
    v50-->v75
    v84-->v89
    v89-->v96
    v84-->v96
    v84-->v106
    v106-->v111
    v115-->v120
    v120-->v127
    v115-->v127
    v115-->v137
    v137-->v142
    v146-->v151
    v151-->v158
    v146-->v158
    v146-->v168
    v168-->v173
    v173-->v180
    v41-->v180
    v41-->v190
    v196-->v205
    v205-->v213
    v213-->v220
    v205-->v220
    v205-->v230
    v239-->v244
    v244-->v251
    v239-->v251
    v239-->v261
    v261-->v266
    v270-->v275
    v275-->v282
    v270-->v282
    v270-->v292
    v292-->v297
    v301-->v306
    v306-->v313
    v301-->v313
    v301-->v323
    v323-->v328
    v328-->v335
    v196-->v335
    v196-->v345
    v345-->v350
    v350-->v357
    v2-->v357
    v357-->v364
    v2-->v364
    v2-->v376
    v376-->v383
    v2-->v383
    v383-->v387
    v35-->v41
    v18-->v35
    v190-->v196
    v58-->v75
    v75-->v84
    v89-->v106
    v111-->v115
    v120-->v137
    v142-->v146
    v151-->v168
    v173-->v190
    v213-->v230
    v230-->v239
    v244-->v261
    v266-->v270
    v275-->v292
    v297-->v301
    v306-->v323
    v328-->v345
    v350-->v376
    style group_rna_neighbors_leiden_umap fill:#F0F0F0,stroke:#969696;
    style group_adt_neighbors_leiden_umap fill:#F0F0F0,stroke:#969696;
    style v0 fill:#e3dcea,stroke:#7a4baa;
    style v2 fill:#e3dcea,stroke:#7a4baa;
    style v10 fill:#e3dcea,stroke:#7a4baa;
    style v18 fill:#e3dcea,stroke:#7a4baa;
    style v25 fill:#e3dcea,stroke:#7a4baa;
    style v35 fill:#e3dcea,stroke:#7a4baa;
    style v41 fill:#e3dcea,stroke:#7a4baa;
    style v50 fill:#e3dcea,stroke:#7a4baa;
    style v58 fill:#e3dcea,stroke:#7a4baa;
    style v65 fill:#e3dcea,stroke:#7a4baa;
    style v75 fill:#e3dcea,stroke:#7a4baa;
    style v84 fill:#e3dcea,stroke:#7a4baa;
    style v111 fill:#e3dcea,stroke:#7a4baa;
    style v89 fill:#e3dcea,stroke:#7a4baa;
    style v96 fill:#e3dcea,stroke:#7a4baa;
    style v106 fill:#e3dcea,stroke:#7a4baa;
    style v115 fill:#e3dcea,stroke:#7a4baa;
    style v142 fill:#e3dcea,stroke:#7a4baa;
    style v120 fill:#e3dcea,stroke:#7a4baa;
    style v127 fill:#e3dcea,stroke:#7a4baa;
    style v137 fill:#e3dcea,stroke:#7a4baa;
    style v146 fill:#e3dcea,stroke:#7a4baa;
    style v173 fill:#e3dcea,stroke:#7a4baa;
    style v151 fill:#e3dcea,stroke:#7a4baa;
    style v158 fill:#e3dcea,stroke:#7a4baa;
    style v168 fill:#e3dcea,stroke:#7a4baa;
    style v180 fill:#e3dcea,stroke:#7a4baa;
    style v190 fill:#e3dcea,stroke:#7a4baa;
    style v196 fill:#e3dcea,stroke:#7a4baa;
    style v350 fill:#e3dcea,stroke:#7a4baa;
    style v205 fill:#e3dcea,stroke:#7a4baa;
    style v213 fill:#e3dcea,stroke:#7a4baa;
    style v220 fill:#e3dcea,stroke:#7a4baa;
    style v230 fill:#e3dcea,stroke:#7a4baa;
    style v239 fill:#e3dcea,stroke:#7a4baa;
    style v266 fill:#e3dcea,stroke:#7a4baa;
    style v244 fill:#e3dcea,stroke:#7a4baa;
    style v251 fill:#e3dcea,stroke:#7a4baa;
    style v261 fill:#e3dcea,stroke:#7a4baa;
    style v270 fill:#e3dcea,stroke:#7a4baa;
    style v297 fill:#e3dcea,stroke:#7a4baa;
    style v275 fill:#e3dcea,stroke:#7a4baa;
    style v282 fill:#e3dcea,stroke:#7a4baa;
    style v292 fill:#e3dcea,stroke:#7a4baa;
    style v301 fill:#e3dcea,stroke:#7a4baa;
    style v328 fill:#e3dcea,stroke:#7a4baa;
    style v306 fill:#e3dcea,stroke:#7a4baa;
    style v313 fill:#e3dcea,stroke:#7a4baa;
    style v323 fill:#e3dcea,stroke:#7a4baa;
    style v335 fill:#e3dcea,stroke:#7a4baa;
    style v345 fill:#e3dcea,stroke:#7a4baa;
    style v357 fill:#e3dcea,stroke:#7a4baa;
    style v364 fill:#e3dcea,stroke:#7a4baa;
    style v376 fill:#e3dcea,stroke:#7a4baa;
    style v383 fill:#e3dcea,stroke:#7a4baa;
    style v387 fill:#e3dcea,stroke:#7a4baa;