Scds

Scds is a transcription-based doublet detection software that uses two different methods to detect doublets - cxds and bcds. The cxds method uses marker genes that are not co-expressed to identify droplets that are likely doublets. bcds simulates doublet by adding droplet transcriptomes together and then uses variable genes to identify the probability a droplet is a doublet with a binary classification algorithm. We typically use the combined score of these two methods but they can be use separately as well. We have provided a wrapper script that takes common arguments for Scds and we also provide an example script that you can run manually in R if you prefer.

Data

This is the data that you will need to have prepare to run Scds:

Required

  • A counts matrix ($COUNTS)

    • The directory path containing your cellranger counts matrix files (directory containing barcodes.tsv, genes.tsv and matrix.mtx or barcodes.tsv.gz, features.tsv.gz and matrix.mtx.gz)

      or

    • h5 file (filtered_feature_bc_matrix.h5)

      • If you don’t have your data in this format, you can run Scds manually in R and load the data in using a method of your choosing.

Optional

  • Output directory ($SCDS_OUTDIR)

    • If you don’t provide an $SCDS_OUTDIR, the results will be written to the present working directory.

  • Filtered barcode file

    • A list of barcodes that are a subset of the barcodes in your h5 or matrix.mtx files. This is useful if you have run other QC softwares such as CellBender or DropletQC to remove empty droplets or droplets with damaged cells.

    • Expectation is that there is no header in this file

Run Scds

:octicon:`stopwatch` Expected Resource Usage

~7min using a total of 10Gb memory when using 2 thread for the full Test Dataset which contains ~20,982 droplets of 13 multiplexed donors,

You can either run Scds with the wrapper script we have provided or you can run it manually if you would prefer to alter more parameters.

First, let’s assign the variables that will be used to execute each step.

Example Variable Settings

Below is an example of the variables that we can set up to be used in the command below. These are files provided as a test dataset available in the Data Preparation Documentation Please replace paths with the full path to data on your system.

SCDS_OUTDIR=/path/to/output/scds
COUNTS=/path/to/TestData4PipelineFull/test_dataset/outs/filtered_gene_bc_matrices/Homo_sapiens_GRCh38p10/

To run Scds with our wrapper script, simply execute the following in your shell:

singularity exec Demuxafy.sif scds.R -o $SCDS_OUTDIR -t $COUNTS

To see all the parameters that this wrapper script will accept, run:

singularity exec Demuxafy.sif scds.R -h

  usage: scds.R
        [-h] -o OUT -t TENX_MATRIX [-b BARCODES_FILTERED]

  optional arguments:
    -h, --help            show this help message and exit
    -o OUT, --out OUT     The output directory where results will be saved
    -t TENX_MATRIX, --tenX_matrix TENX_MATRIX
                          Path to the 10x filtered matrix directory or h5 file.
    -b BARCODES_FILTERED, --barcodes_filtered BARCODES_FILTERED
                          Path to a list of filtered barcodes to use for doublet
                          detection.

Scds Results and Interpretation

After running the Scds with the wrapper script or manually you should have two files in the $SCDS_OUTDIR:

/path/to/output/scds
├── scds_doublets_singlets.tsv
└── scds_doublet_summary.tsv
  • scds_doublet_summary.tsv

    • A summary of the number of singlets and doublets predicted by Scds.

      Classification

      Droplet N

      doublet

      2771

      singlet

      18211

      • To check whether the number of doublets identified by Scds is consistent with the expected doublet rate expected based on the number of droplets that you captured, you can use our Expected Doublet Estimation Calculator.

  • scds_doublets_singlets.tsv

    • The per-barcode singlet and doublet classification from Scds.

      Barcode

      scds_score

      scds_DropletType

      AAACCTGAGATAGCAT-1

      0.116344358493288

      singlet

      AAACCTGAGCAGCGTA-1

      0.539856378453988

      singlet

      AAACCTGAGCGATGAC-1

      0.0237184380134577

      singlet

      AAACCTGAGCGTAGTG-1

      0.163695865366576

      singlet

      AAACCTGAGGAGTTTA-1

      0.11591462421927

      singlet

      AAACCTGAGGCTCATT-1

      0.0479944175570073

      singlet

      AAACCTGAGGGCACTA-1

      0.374426050641161

      singlet

      AAACCTGAGTAATCCC-1

      0.247842972104563

      singlet

Merging Results with Other Software Retults

We have provided a script that will help merge and summarize the results from multiple softwares together. See Combine Results.

Citation

If you used the Demuxafy platform for analysis, please reference our preprint as well as scds.