correction/decontx_remove_background
Description
DecontX is a Bayesian method to estimate and remove contamination in individual cells.
DecontX assumes the observed expression of a cell is a mixture of counts from two multinomial distributions:
(1) a distribution of native transcript counts from the cell's actual population and
(2) a distribution of contaminating transcript counts from all other cell populations captured in the assay.
Campbell et al. 2020, Genome Biology
Inputs
Name | Type & Properties | Description |
|---|---|---|
--input -i | file required | A .h5mu file containing a matrix of counts. Cells in each batch will be subsetted and converted to a sparse matrix before analysis. This object should only contain filtered cells after cell calling. Empty cell barcodes (low expression droplets before cell calling) are not needed to run DecontX. |
--modality | string | Which modality to process. |
--input_layer | string | The layer in the input data to use as the counts matrix (assayName). If not provided, .X is used. |
--input_obs_clusters | string | The name of the .obs column containing cell cluster labels (z). If not provided, PCA will be used to reduce the dimensionality of the dataset initially, UMAP will be used to further reduce the dataset to 2 dimensions, and dbscan will be used to identify clusters of broad cell types. |
--input_obs_batch | string | The name of the .obs column containing batch labels for cells. If batch labels are supplied, DecontX is run on cells from each batch separately. Cells run in different channels or assays should be considered different batches. |
Background
Name | Type & Properties | Description |
|---|---|---|
--background | file | A .h5mu file containing a matrix of counts from empty droplets, with the same data format as --input. When supplied, the empirical distribution of transcripts from these empty droplets will be used as the contamination distribution. |
--background_layer | string | The layer in the background data to use as the counts matrix (bgAssayName). If not provided, the value of --input_layer is used. |
--background_obs_batch | string | The name of the .obs column in the background data containing batch labels (bgBatch). Its unique values should be the same as those in --input_obs_batch, such that each batch of cells has its corresponding batch of empty droplets as background. |
Arguments
Name | Type & Properties | Description |
|---|---|---|
--max_iter | integer | Maximum iterations of the EM algorithm. |
--delta | double multiple | Vector of length 2. Concentration parameters for the Dirichlet prior for the contamination in each cell. The first element is the prior for the native counts while the second element is the prior for the contamination counts. These essentially act as pseudocounts for the native and contamination in each cell. If --estimate_delta is true, this is only used to produce a random sample of proportions for an initial value of contamination in each cell; delta is then updated in each iteration. If --estimate_delta is false, delta is fixed with these values for the entire inference procedure. Fixing delta and setting a high number in the second element will force DecontX to be more aggressive and estimate higher levels of contamination at the expense of potentially removing native expression. |
--estimate_delta | boolean | Whether to update delta at each iteration. Set to false to keep delta fixed at the --delta values for the entire inference procedure. |
--convergence | double | The EM algorithm will be stopped if the maximum difference in the contamination estimates between the previous and current iterations is less than this. |
--iter_log_lik | integer | Calculate log likelihood every --iter_log_lik iterations. |
--var_genes | integer | The number of variable genes to use in dimensionality reduction before clustering. Variability is calculated using the modelGeneVar function from the 'scran' package. Used only when --input_obs_clusters is not provided. |
--dbscan_eps | double | The clustering resolution parameter used in 'dbscan' to estimate broad cell clusters. Used only when --input_obs_clusters is not provided. |
--seed | integer | Seed for reproducibility. |
--logfile | file output | If provided, log messages will be redirected to this file instead of stdout. |
--verbose | boolean | Whether to print log messages. Use this flag to disable log messages. |
Outputs
Name | Type & Properties | Description |
|---|---|---|
--output -o | file required output | Output h5mu file, with contamination estimated and removed. |
--output_layer | string | Name of the layer to store the decontaminated counts matrix in. |
--output_obs_contamination | string | Name of the .obs column to store the estimated contamination proportion per cell in. |
--output_obs_clusters | string | Name of the .obs column to store the cell cluster labels used by DecontX in (either passed through from --input_obs_clusters or estimated internally). |
--output_compression | string | Compression format to use for the output AnnData and/or Mudata H5 files. By default no compression is applied. |
Run this component
Run the following command to execute this component with Nextflow:
cat > params.yaml <<'EOM'
modality: [ "rna" ]
max_iter: [ 500 ]
delta: [ 10, 10 ]
estimate_delta: [ true ]
convergence: [ 0.001 ]
iter_log_lik: [ 10 ]
var_genes: [ 5000 ]
dbscan_eps: [ 1 ]
logfile: "$id.$key.logfile"
verbose: [ false ]
output: "$id.$key.output.h5mu"
output_layer: [ "decontx_counts" ]
output_obs_contamination: [ "decontx_contamination" ]
output_obs_clusters: [ "decontx_clusters" ]
id: "run"
publish_dir: "output/"
EOM
nextflow run https://packages.viash-hub.com/vsh/openpipeline.git \
-revision v5.0.0 \
-main-script target/nextflow/correction/decontx_remove_background/main.nf \
-params-file params.yaml Relationships
Used by
0 relationships
No components use this component.
Current component
correction/decontx_remove_backgroundopenpipeline v5.0.0
Uses
0 relationships
No component dependencies found.