Harmony leiden

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

Info

ID: harmony_leiden
Namespace: multiomics/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 0.12.6 -latest \
  -main-script ./workflows/multiomics/integration/harmony_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: "log_normalized"
modality: "rna"

# Outputs
# output: "$id.$key.output.h5mu"

# Neighbour calculation
uns_neighbors: "harmonypy_integration_neighbors"
obsp_neighbor_distances: "harmonypy_integration_distances"
obsp_neighbor_connectivities: "harmonypy_integration_connectivities"

# Harmony integration options
embedding: "X_pca"
obsm_integrated: "X_pca_integrated"
obs_covariates: # please fill in - example: ["batch", "sample"]
theta: [2]

# Clustering options
obs_cluster: "harmony_integration_leiden"
leiden_resolution: [1]

# Umap options
obsm_umap: "X_leiden_harmony_umap"

# Nextflow input-output arguments
publish_dir: # please fill in - example: "output/"
# param_list: "my_params.yaml"
nextflow run openpipelines-bio/openpipeline \
  -r 0.12.6 -latest \
  -profile docker \
  -main-script ./workflows/multiomics/integration/harmony_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, default: "log_normalized"
--modality Which modality to process. string, default: "rna"

Outputs

Name Description Attributes
--output Destination path to the output. file, required, example: "output.h5mu"

Neighbour calculation

Name Description Attributes
--uns_neighbors In which .uns slot to store various neighbor output objects. string, default: "harmonypy_integration_neighbors"
--obsp_neighbor_distances In which .obsp slot to store the distance matrix between the resulting neighbors. string, default: "harmonypy_integration_distances"
--obsp_neighbor_connectivities In which .obsp slot to store the connectivities matrix between the resulting neighbors. string, default: "harmonypy_integration_connectivities"

Harmony integration options

Name Description Attributes
--embedding Embedding to use as input string, default: "X_pca"
--obsm_integrated In which .obsm slot to store the resulting integrated embedding. string, default: "X_pca_integrated"
--obs_covariates The .obs field(s) that define the covariate(s) to regress out. List of string, required, example: "batch", "sample", multiple_sep: ":"
--theta Diversity clustering penalty parameter. Specify for each variable in group.by.vars. theta=0 does not encourage any diversity. Larger values of theta result in more diverse clusters.” List of double, default: 2, multiple_sep: ":"

Clustering options

Name Description Attributes
--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: "harmony_integration_leiden"
--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_leiden_harmony_umap"

Authors

  • Dries Schaumont (author)

Visualisation

flowchart LR
    v0(Input)
    v2(toSortedList)
    v4(flatMap)
    v10(harmonypy)
    v12(join)
    v20(find_neighbors)
    v22(join)
    v25(filter)
    v31(leiden)
    v33(join)
    v41(move_obsm_to_obs)
    v43(join)
    v47(mix)
    v46(filter)
    v53(umap)
    v55(join)
    v61(Output)
    v46-->v47
    v0-->v2
    v2-->v4
    v4-->v12
    v4-->v10
    v10-->v12
    v12-->v22
    v12-->v20
    v20-->v22
    v22-->v25
    v22-->v46
    v25-->v33
    v25-->v31
    v31-->v33
    v33-->v43
    v33-->v41
    v41-->v43
    v43-->v47
    v47-->v55
    v47-->v53
    v53-->v55
    v55-->v61