Software  ›   pipelines
If your question is not answered here, please email us at:  ${email.software} # 10x GenomicsChromium Single Cell Gene Expression # Running Multi-GEM Well Count Invocation ## Aggregation and Custom Configuration As mentioned in the workflow overview, Cell Ranger can be used to analyze multiple GEM wells. Depending on your exact scenario, the approach may be different. Here are three circumstances, from most to least common: 1. You created one GEM well, but sequenced it more than once. This might have been to increase coverage depth, or for some other reason. You might have sequenced the GEM well across different lanes of the same flowcell, or across multiple flow cells. In any of these cases, provided that this all comes from a single GEM well, you can analyze these runs as a single sample using cellranger count by Specifying Input FASTQs. 2. You created GEM wells from multiple samples. This would be the case in many experiments, such as comparing diseased and healthy patients. First, run cellranger count on each GEM well separately. Then, to compare the GEM wells, aggregate them with cellranger aggr. 3. You created multiple GEM wells from the same sample. It is recommended to simply aggregate the GEM wells, just as if they were different samples. However, if it is necessary to pool these GEM wells and analyze them as a single sample, you can do that. It just requires learning a little more about exactly how Cell Ranger works, and writing a customized pipeline configuration file, called an MRO. This page covers this final scenario. ## What is an MRO file? Cell Ranger uses a pipeline management framework called Martian. The pipeline and each stage in it is specified by a configuration file called an MRO file. Usually, the cellranger commands create the appropriate MRO files for you, but in the case that you want to do something outside the normal workflows, it is possible to create a custom MRO file to directly exercise the full range of features. In the example below we describe how to construct an MRO file to specify multiple libraries as well as multiple flow cells (since most often the multiple libraries will have been sequenced on different runs). ## Understanding the Pipeline Invocation MRO The easiest way to write your own MRO is to start with the MRO from a previous pipeline. Assuming you have already run a single-flowcell sample (e.g., sample345), examine the _invocation file contained in its output directory. Note: this example assumes that the input flowcells were processed with cellranger mkfastq.$ cat sample345/_invocation

@include "sc_rna_counter_cs.mro"

call SC_RNA_COUNTER_CS(
sample_id = "sample345",
sample_def = [
{
"fastq_mode": "ILMN_BCL2FASTQ",
"gem_group": null,
"lanes": null,
"sample_indices": [ "any" ],
"sample_names": [ "Sample1" ]
}
],
sample_desc = "",
reference_path = "/opt/refdata-cellranger-GRCh38-3.0.0",
recovered_cells = null,
force_cells = null,
no_secondary_analysis = false,
)

The sample_def argument controls the parameters used to define this sample and is a JSON-encoded list of maps that define:

• fastq_mode - set this to "ILMN_BCL2FASTQ"
• gem_group - identifier of the GEM well that this dataset is associated with.
• lanes - a list of lanes from this flowcell to be included in this sample (e.g., [ 1, 2 ], [ 2 ], etc) or null to use all lanes
• read_path - a directory containing FASTQs from a single flowcell
• sample_indices - set this to "any" when working with mkfastq output
• sample_names - a list of names associated with particular sample indices (as specified in the mkfastq sample sheet for this flowcell)

Make a copy of this _invocation file; this will be the MRO from which we will build our multi-GEM well invocation MRO.

## Analyzing Multiple GEM Grpu From A Single Sample Across Multiple Flowcells

Continuing with the example MRO above, we would make the following changes:

1. Give the sample an appropriate sample_id. This corresponds to the --id option used in a normal cellranger count analysis.
2. Duplicate the dict contained in the sample_def definition as a second item in the sample_def list. Make sure that sample_names reflects the actual sample names encoded in the FASTQ filenames for the respective flow cells. This corresponds to the --sample option used in a normal cellranger count analysis.
3. Change the read_path for each of these sample_def objects to point to the locations of their respective FASTQ output directories. This corresponds to the --fastqs option used in a normal cellranger count analysis.
4. Change lanes and/or sample_names to reflect the flowcell configuration used in sequencing, if necessary.
5. Change the gem_group to incrementally increasing integers, starting with 1. This is the part that command line options don't handle.
$cp sample345/_invocation sample345-multi.mro$ nano sample345-multi.mro
...

$cat sample345-multi.mro @include "sc_rna_counter_cs.mro" call SC_RNA_COUNTER_CS( sample_id = "sample345-multi", sample_def = [ { "fastq_mode": "ILMN_BCL2FASTQ", "gem_group": 1, "lanes": null, "read_path": "/home/jdoe/runs/HAWT7ADXX", "sample_indices": [ "any" ], "sample_names": [ "Sample1" ] }, { "fastq_mode": "ILMN_BCL2FASTQ", "gem_group": 2, "lanes": null, "read_path": "/home/jdoe/runs/HAWPUADXX", "sample_indices": [ "any" ], "sample_names": [ "Sample1" ] } ], sample_desc = "", reference_path = "/opt/refdata-cellranger-GRCh38-3.0.0", recovered_cells = null, force_cells = null, no_secondary_analysis = false, ) The cellular barcode sequences include suffixes from the different GEM wells. AGAATGGTCTGCAT-1 CTGATCGATATCGA-1 GTAGCAACGTCGTA-2 AGAATGGTCTGCAT-2 This is how cellranger prevents the same barcode from different cells in different GEM reactions from being erroneously combined into a single cell based only on the barcode sequence. ## Running Cell Ranger Once you have this single-sample, multi-GEM well, multi-flowcell MRO, confirm that its syntax is valid with cellranger mrc, the MRO compiler included with Cell Ranger:$ cellranger mrc sample345-multi.mro
Successfully compiled 1 mro files.

Then run the MRO file using cellranger's alternate MRO-mode syntax:

\$ cellranger count sample345-multi sample345-multi.mro --uiport=3600
Martian Runtime - v3.2.0
Serving UI at http://localhost:3600