Bbknn leiden
Run bbknn followed by leiden clustering and run umap on the result.
Info
ID: bbknn_leiden
Namespace: multiomics/integration
Links
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.10.0 -latest \
-main-script ./workflows/multiomics/integration/bbknn_leiden/main.nf \
--helpRun 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 0.10.0 -latest \
-profile docker \
-main-script ./workflows/multiomics/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. | double, default: 1 |
UMAP options
| Name | Description | Attributes |
|---|---|---|
--obsm_umap |
In which .obsm slot to store the resulting UMAP embedding. | string, default: "X_leiden_bbknn_umap" |
Visualisation
flowchart LR
p0(Input)
p2(toSortedList)
p4(flatMap)
p10(bbknn)
p12(join)
p20(leiden)
p22(join)
p30(umap)
p32(join)
p40(move_obsm_to_obs)
p42(join)
p48(Output)
p0-->p2
p2-->p4
p4-->p12
p4-->p10
p10-->p12
p12-->p22
p12-->p20
p20-->p22
p22-->p32
p22-->p30
p30-->p32
p32-->p42
p32-->p40
p40-->p42
p42-->p48