Software  ›   pipelines
If your question is not answered here, please email us at:  support@10xgenomics.com

10x Genomics
Chromium Single Cell CNV

Subsetting a BAM to cells of interest using cellranger-dna bamslice

The cellranger-dna bamslice command filters the position-sorted BAM file produced by a cellranger-dna cnv run to a subset of cells specified with a custom configuration CSV.

Command Line Interface

These are the most common command line arguments (run cellranger-dna bamslice --help for a full list):

ArgumentDescription
--id=IDA unique run ID string: e.g. tumor_primary_subset1
--csv=CSVPath of CSV file containing barcode subset definitions (see Configuration).
--bam=BAMPath of BAM file to filter (an output of cellranger-dna cnv).

After specifying these input arguments, run cellranger-dna bamslice. In this example, we're filtering the outputs of a mixed tumor sample:

$ cd /home/jdoe/runs
$ ls -1 tumor_mixed/outs/*.bam # verify the input file exists
tumor_mixed/outs/possorted_bam.bam
$ cellranger-dna bamslice --id=tumor_subsets \
                       --csv=tumor_subsets.csv \
                       --bam=/home/jdoe/runs/tumor_mixed/outs/possorted_bam.bam

The pipeline will begin to run, creating a new folder named with the ID you specified (e.g. /home/jdoe/runs/tumor_subsets) for its output. If this folder already exists, cellranger-dna will assume it is an existing pipestance and attempt to resume running it.

Pipeline Outputs

A successful run should conclude with a message similar to this:

2019-05-07 10:20:51 [runtime] (chunks_complete) ID.tumor_subsets.SUBSET_BAM._SUBSET_BAM
2019-05-07 10:20:51 [runtime] (run:local)       ID.tumor_subsets.SUBSET_BAM._SUBSET_BAM.fork0.join
2019-05-07 10:20:53 [runtime] (join_complete)   ID.tumor_subsets.SUBSET_BAM._SUBSET_BAM
 
Outputs:
- subsets: /home/jdoe/runs/tumor_subsets/outs/subsets
 
Pipestance completed successfully!
$ ls -1 tumor_subsets/outs/subsets/*.bam
normal.bam
tumor_primary.bam

Refer to the BAM page for a description of the output BAM files.

Configuration

You select your barcodes of interest for each group directly, using a separate barcodes file for each group.

A text editor or Excel may be used to construct the configuration CSV. Your spreadsheet may look something like this:

AB
1library_idbarcodes_csv
2normal/home/jdoe/normal_barcodes.csv
3tumor_primary/home/jdoe/tumor_primary_barcodes.csv

When you save this to CSV, it will look something like this:

library_id,barcodes_csv
normal,/home/jdoe/normal_barcodes.csv
tumor_primary,/home/jdoe/tumor_primary_barcodes.csv

The barcodes CSV files will each have one barcode entry per line, including the GEM well suffix (see GEM wells). Each such file will look something like:

AAACGGGTCAAAGTGA-1
AAAGATGCAATGGGAC-1
...
TTTGTCATCCGCACGA-1