HOME  ›   pipelines
If your question is not answered here, please email us at:  ${email.software}

Cell Ranger


10x Genomics
Chromium Single Cell Gene Expression

Single-Library Analysis with Cell Ranger count

Cell Ranger's pipelines analyze sequencing data produced from Chromium Single Cell Gene Expression. It also processes data generated by using Feature Barcode technology and/or Single Cell Targeted Gene Expression.

Table of Contents

The analysis involves the following steps:

  1. Run cellranger mkfastq on the Illumina BCL output folder to generate FASTQ files.

  2. Run cellranger count on each GEM well that was demultiplexed by cellranger mkfastq. For Targeted Gene Expression libraries, see Targeted Gene Expression Analysis for instructions on how to provide the target gene panel information. If you created a Feature Barcode library alongside the Gene Expression library, you will pass them both to cellranger count at this point. See Feature Barcode Analysis for details.

  3. Optionally, run cellranger aggr to aggregate multiple GEM wells from a single experiment that were analyzed by cellranger count.

  4. Optionally run cellranger reanalyze to re-run the secondary analysis on a library or aggregated set of libraries (i.e., PCA, t-SNE, and clustering) and be able to fine-tune parameters.

For the following example, assume that the Illumina BCL output is in a folder named /sequencing/140101_D00123_0111_AHAWT7ADXX.

Run cellranger mkfastq

First, follow the instructions on running cellranger mkfastq to generate FASTQ files. For example, if the flow cell ID was HAWT7ADXX, then cellranger mkfastq will output FASTQ files in HAWT7ADXX/outs/fastq_path.

Run cellranger count

To generate single cell feature counts for a single library, run cellranger count with the following arguments. For a complete listing of the arguments accepted, see the Command Line Argument Reference below, or run cellranger count --help. Cell Ranger must not be used for Single Cell Multiome Analysis. For Single Cell Multiome ATAC + Gene Expression libraries, use Cell Ranger ARC.

After determining these input arguments and customizing the code in red, run cellranger:

$ cd /home/jdoe/runs
$ cellranger count --id=sample345 \
                   --transcriptome=/opt/refdata-gex-GRCh38-2020-A \
                   --fastqs=/home/jdoe/runs/HAWT7ADXX/outs/fastq_path \
                   --sample=mysample \
                   --localcores=8 \

Following a series of checks to validate input arguments, cellranger count pipeline stages will begin to run:

Martian Runtime - v4.0.8
Running preflight checks (please wait)...
Checking sample info...
Checking FASTQ folder...
Checking reference...

Checking optional arguments...

By default, Cell Ranger will use all of the cores available on your system to execute pipeline stages. You can specify a different number of cores to use with the --localcores option; for example, --localcores=16 will limit Cell Ranger to using up to sixteen cores at once. Similarly, --localmem will restrict the amount of memory (in GB) used by Cell Ranger.

The pipeline will create a new folder named with the sample ID you specified (e.g. /home/jdoe/runs/sample345) for its output. If this folder already exists, Cell Ranger will assume it is an existing pipestance and attempt to resume running it.

Output files

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

- Run summary HTML:                         /opt/sample345/outs/web_summary.html
- Run summary CSV:                          /opt/sample345/outs/metrics_summary.csv
- BAM:                                      /opt/sample345/outs/possorted_genome_bam.bam
- BAM index:                                /opt/sample345/outs/possorted_genome_bam.bam.bai
- Filtered feature-barcode matrices MEX:    /opt/sample345/outs/filtered_feature_bc_matrix
- Filtered feature-barcode matrices HDF5:   /opt/sample345/outs/filtered_feature_bc_matrix.h5
- Unfiltered feature-barcode matrices MEX:  /opt/sample345/outs/raw_feature_bc_matrix
- Unfiltered feature-barcode matrices HDF5: /opt/sample345/outs/raw_feature_bc_matrix.h5
- Secondary analysis output CSV:            /opt/sample345/outs/analysis
- Per-molecule read information:            /opt/sample345/outs/molecule_info.h5
- CRISPR-specific analysis:                 null
- Loupe Browser file:                       /opt/sample345/outs/cloupe.cloupe
- Feature Reference:                        null
- Target Panel File:                        null

Waiting 6 seconds for UI to do final refresh.
Pipestance completed successfully!

yyyy-mm-dd hh:mm:ss Shutting down.
Saving pipestance info to "tiny/tiny.mri.tgz"

The output of the pipeline will be contained in a folder named with the sample ID you specified (e.g. sample345).

Once cellranger count has successfully completed, you can browse the resulting web summary HTML file in any supported web browser and open the .cloupe file in Loupe Browser. Refer to the Understanding Outputs 3' Gene Expression Outputs page for descriptions about all output files.

Command-line argument reference

--idRequired. A unique run ID string (e.g., sample345). The name is arbitrary and will be used to name the directory containing all pipeline-generated files and outputs. Only letters, numbers, underscores, and hyphens are allowed (maximum of 64 characters).
--fastqs Required. Either:
Path of the fastq_path folder generated by cellranger mkfastq
e.g. /home/jdoe/runs/HAWT7ADXX/outs/fastq_path. This contains a directory hierarchy that cellranger count will automatically traverse.
- OR -
Any folder containing fastq files, for example if the fastq files were generated by a service provider and delivered outside the context of the mkfastq output directory structure. See input FASTQ page for help.
  • Can take multiple comma-separated paths, which is helpful if the same library was sequenced on multiple flow cells. Doing this will treat all reads from the library, across flow cells, as one sample.
  • If you have multiple libraries for the sample, you will need to run cellranger count on them individually, and then combine them with cellranger aggr.
  • This argument cannot be used when performing Feature Barcode analysis; use --libraries instead.
  • --libraries Path to a libraries.csv file declaring FASTQ paths and library types of input libraries. Required for gene expression + Feature Barcode analysis. When using this argument, --fastqs and --sample must not be used.
    This argument should not be used when performing gene expression-only analysis; use --fastqs instead.
    --sample Required. Sample name as specified in the sample sheet supplied to cellranger mkfastq.
  • Can take multiple comma-separated values, which is helpful if the same library was sequenced on multiple flow cells with different sample names, which therefore have different FASTQ file prefixes. Doing this will treat all reads from the library, across flow cells, as one sample.
  • If you have multiple libraries for the sample, you will need to run cellranger count on them individually, and then combine them with cellranger aggr.
  • Allowable characters in sample names are letters, numbers, hyphens, and underscores.
  • --transcriptomeRequired. Path to the Cell Ranger-compatible transcriptome reference e.g.,
    • For a human-only sample, use /opt/refdata-gex-GRCh38-2020-A
    • For a human and mouse mixture sample, use /opt/refdata-gex-GRCh38-and-mm10-2020-A
    • Pre-built references are available on the Download Links page
    • Or generate a custom reference with mkref
    --feature-ref Path to a Feature Reference CSV file declaring the Feature Barcode reagents used in the experiment. Required for Feature Barcode analysis.
    --target-panel Path to a Target Panel CSV file declaring the target panel used, if any. Required for Targeted Gene Expression analysis. Default analysis will exclude intronic mapped reads, which is the recommended mode for targeted assays.
    --no-target-umi-filter Optional. Add this flag to disable targeted UMI filtering. See Targeted algorithms for details.
    --expect-cells Optional. Override the pipeline’s auto-estimate. See cell calling algorithm overview for details on how this parameter is used. If used, enter the expected number of recovered cells.
    --force-cells Optional. Force pipeline to use this number of cells, bypassing the cell detection algorithm. Use this if the number of cells estimated by Cell Ranger is not consistent with the barcode rank plot.
    --include-introns Optional. Set to false to exclude intronic reads in count. Including introns in analysis is recommended to maximize sensitivity, except when --target-panel is used. Default: true.
    --nosecondary Optional. Add this flag to skip secondary analysis of the feature-barcode matrix (dimensionality reduction, clustering, and visualization). Set this if you plan to use cellranger reanalyze or your own custom analysis.
    --no-bam Optional. Add this flag to skip BAM file generation. This will reduce the total computation time for the pipestance and the size of the output directory. If unsure, we recommend not using this option, as BAM files can be useful for troubleshooting and downstream analysis. Default: false.
    --no-libraries Optional. Add this flag to proceed with processing data using a --feature-ref but no Feature Barcode data specified with the --libraries flag.
    --chemistry Optional. Assay configuration. NOTE: by default the assay configuration is detected automatically, which is the recommended mode. You should only specify chemistry if there is an error in automatic detection. Select one of:
    • auto for auto-detection (default),
    • threeprime for Single Cell 3′,
    • fiveprime for Single Cell 5′,
    • SC3Pv2 for Single Cell 3′ v2,
    • SC3Pv3 for Single Cell 3′ v3,
    • SC3Pv3LT for Single Cell 3′ v3 LT,
    • SC3Pv3HT for Single Cell 3′ v3 HT,
    • SC5P-PE for Single Cell 5′ paired-end (both R1 and R2 are used for alignment),
    • SC5P-R2 for Single Cell 5′ R2-only (where only R2 is used for alignment).
    • SC3Pv1 for Single Cell 3′ v1. NOTE: this mode cannot be auto-detected. It must be set explicitly with this option.
    • ARC-v1 for analyzing the GEX portion of multiome data. NOTE: this mode cannot be auto-detected.
    --r1-lengthOptional. Limit the length of the input Read 1 sequence of Gene Expression (and any Feature Barcode) library to the first N bases, where N is a user-supplied value. Note that the length includes the 10x Barcode and UMI sequences so do not set this below 26 for Single Cell 3′ v2 or Single Cell 5′. This and --r2-length are useful options for determining the optimal read length for sequencing.
    --r2-lengthOptional. Limit the length of the input R2 sequence to the first N bases, where N is a user-supplied value. Trimming occurs before sequencing metrics are computed and therefore, limiting R2 read length may affect Q30 scores.
    --lanesOptional. Lanes associated with this sample
    --localcoresOptional. Restricts cellranger to use specified number of cores to execute pipeline stages. By default, cellranger will use all of the cores available on your system.
    --localmemOptional. Restricts cellranger to use specified amount of memory (in GB) to execute pipeline stages. By default, cellranger will use 90% of the memory available on your system.
    --check-library-compatibilityOptional. This option allows users to disable the check that evaluates 10x Barcode overlap between libraries when multiple libraries are specified (e.g., Gene Expression + Antibody Capture). Setting this option to false will disable the check across all library combinations. We recommend running this check (default), however if the pipeline errors out, users can bypass the check to generate outputs for troubleshooting. Default: true