Bbknn leiden

Run bbknn followed by leiden clustering and run umap on the result.

Info

ID: bbknn_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 1.0.1 -latest \
  -main-script target/nextflow/workflows/integration/bbknn_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"

# Bbknn
obsm_input: "X_pca"
obs_batch: "sample_id"
uns_output: "bbknn_integration_neighbors"
obsp_distances: "bbknn_integration_distances"
obsp_connectivities: "bbknn_integration_connectivities"
n_neighbors_within_batch: 3
n_pcs: 50
# n_trim: 123

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

# UMAP options
obsm_umap: "X_leiden_bbknn_umap"

# Nextflow input-output arguments
publish_dir: # please fill in - example: "output/"
# param_list: "my_params.yaml"
nextflow run openpipelines-bio/openpipeline \
  -r 1.0.1 -latest \
  -profile docker \
  -main-script target/nextflow/workflows/integration/bbknn_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"

Bbknn

Name Description Attributes
--obsm_input The dimensionality reduction in .obsm to use for neighbour detection. Defaults to X_pca. string, default: "X_pca"
--obs_batch .obs column name discriminating between your batches. string, default: "sample_id"
--uns_output Mandatory .uns slot to store various neighbor output objects. string, default: "bbknn_integration_neighbors"
--obsp_distances In which .obsp slot to store the distance matrix between the resulting neighbors. string, default: "bbknn_integration_distances"
--obsp_connectivities In which .obsp slot to store the connectivities matrix between the resulting neighbors. string, default: "bbknn_integration_connectivities"
--n_neighbors_within_batch How many top neighbours to report for each batch; total number of neighbours in the initial k-nearest-neighbours computation will be this number times the number of batches. integer, default: 3
--n_pcs How many dimensions (in case of PCA, principal components) to use in the analysis. integer, default: 50
--n_trim Trim the neighbours of each cell to these many top connectivities. May help with population independence and improve the tidiness of clustering. The lower the value the more independent the individual populations, at the cost of more conserved batch effect. If None (default), sets the parameter value automatically to 10 times neighbors_within_batch times the number of batches. Set to 0 to skip. integer

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: "bbknn_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_bbknn_umap"

Authors

  • Mauro Saporita (author)

  • Povilas Gibas (author)

Visualisation

flowchart TB
    v0(Channel.fromList)
    v29(concat)
    v18(bbknn)
    v39(leiden)
    v59(move_obsm_to_obs)
    v72(mix)
    v81(umap)
    v108(Output)
    v0-->v18
    v18-->v29
    v29-->v39
    v39-->v59
    v59-->v72
    v29-->v72
    v72-->v81
    v81-->v108
    style v0 fill:#e3dcea,stroke:#7a4baa;
    style v29 fill:#e3dcea,stroke:#7a4baa;
    style v18 fill:#e3dcea,stroke:#7a4baa;
    style v39 fill:#e3dcea,stroke:#7a4baa;
    style v59 fill:#e3dcea,stroke:#7a4baa;
    style v72 fill:#e3dcea,stroke:#7a4baa;
    style v81 fill:#e3dcea,stroke:#7a4baa;
    style v108 fill:#e3dcea,stroke:#7a4baa;