|
| 1 | +``flex-quant`` command |
| 2 | +====================== |
| 3 | + |
| 4 | +The ``flex-quant`` command runs the end-to-end ``simpleaf`` pipeline for 10x Flex Gene Expression data. Unlike :doc:`/quant-command`, which is designed around standard single-cell RNA-seq chemistries and a single cell-barcode whitelist, ``flex-quant`` handles the extra resources and steps required for Flex assays: |
| 5 | + |
| 6 | +- Flex chemistry lookup from the chemistry registry |
| 7 | +- probe set selection by organism |
| 8 | +- probe-set CSV to FASTA conversion and ``probe_t2g.tsv`` generation |
| 9 | +- probe index construction with ``piscem build`` when needed |
| 10 | +- cell barcode whitelist resolution |
| 11 | +- sample barcode list resolution |
| 12 | +- ``piscem map-scrna`` |
| 13 | +- multi-barcode permit-list generation with ``alevin-fry generate-permit-list`` |
| 14 | +- ``alevin-fry collate`` and ``alevin-fry quant`` |
| 15 | + |
| 16 | +At present, ``flex-quant`` expects a registered Flex chemistry such as ``10x-flexv1-gex-3p`` or ``10x-flexv2-gex-3p`` and requires ``piscem`` plus ``alevin-fry`` to be configured with :doc:`/set-paths`. |
| 17 | + |
| 18 | +Overview |
| 19 | +-------- |
| 20 | + |
| 21 | +The command needs: |
| 22 | + |
| 23 | +1. a Flex chemistry name via ``--chemistry`` |
| 24 | +2. an organism via ``--organism`` for automatic probe-set selection |
| 25 | +3. paired-end reads via ``--reads1`` and ``--reads2`` |
| 26 | +4. an output directory via ``--output`` |
| 27 | + |
| 28 | +If the chemistry registry contains the needed metadata, ``simpleaf`` can automatically download and cache the probe set, the cell barcode whitelist, and the sample barcode list. If you already have local resources, you can override these defaults with ``--index``, ``--probe-set``, or ``--sample-bc-list``. |
| 29 | + |
| 30 | +The relevant options (which you can obtain by running ``simpleaf flex-quant -h``) are below: |
| 31 | + |
| 32 | +.. code-block:: console |
| 33 | +
|
| 34 | + quantify a 10x Flex GEX sample (probe-based, multiplexed) |
| 35 | +
|
| 36 | + Usage: simpleaf flex-quant [OPTIONS] --chemistry <CHEMISTRY> --organism <ORGANISM> --output <OUTPUT> --reads1 <READS1> --reads2 <READS2> |
| 37 | +
|
| 38 | + Options: |
| 39 | + -c, --chemistry <CHEMISTRY> Chemistry name: 10x-flexv1-gex-3p or 10x-flexv2-gex-3p |
| 40 | + --organism <ORGANISM> Target organism for automatic probe set selection [possible values: human, mouse] |
| 41 | + -o, --output <OUTPUT> Path to output directory |
| 42 | + -t, --threads <THREADS> Number of threads to use [default: 16] |
| 43 | + -r, --resolution <RESOLUTION> UMI resolution mode [default: cr-like] [possible values: cr-like, cr-like-em, parsimony, parsimony-em, parsimony-gene, parsimony-gene-em] |
| 44 | + -h, --help Print help |
| 45 | + -V, --version Print version |
| 46 | +
|
| 47 | + Mapping Options: |
| 48 | + -i, --index <INDEX> Path to pre-built probe index (overrides auto-build) |
| 49 | + -1, --reads1 <READS1> Comma-separated list of R1 FASTQ files |
| 50 | + -2, --reads2 <READS2> Comma-separated list of R2 FASTQ files |
| 51 | +
|
| 52 | + Probe Set Options: |
| 53 | + --probe-set <PROBE_SET> Path to probe set CSV or FASTA (overrides auto-download) |
| 54 | + --sample-bc-list <SAMPLE_BC_LIST> Path to sample/probe barcode file with rotation mapping |
| 55 | + --kmer-length <KMER_LENGTH> k-mer length for probe index building [default: 23] |
| 56 | +
|
| 57 | + Piscem Mapping Options: |
| 58 | + --skipping-strategy <SKIPPING_STRATEGY> The skipping strategy to use for k-mer collection [default: permissive] [possible values: permissive, strict] |
| 59 | + --struct-constraints If piscem >= 0.7.0, enable structural constraints |
| 60 | + --max-ec-card <MAX_EC_CARD> Maximum cardinality equivalence class to examine [default: 4096] |
| 61 | +
|
| 62 | + Permit List Options: |
| 63 | + --min-reads <MIN_READS> Minimum read count threshold for unfiltered permit list [default: 10] |
| 64 | +
|
| 65 | +Resource resolution |
| 66 | +------------------- |
| 67 | + |
| 68 | +``flex-quant`` resolves resources in the following order: |
| 69 | + |
| 70 | +- Probe index: |
| 71 | + If ``--index`` is provided, ``simpleaf`` uses that index directly. The command expects a corresponding ``probe_t2g.tsv`` next to the index, unless you also provide ``--probe-set`` so it can generate the t2g mapping. |
| 72 | +- Probe set: |
| 73 | + If ``--probe-set`` is provided, it overrides the registry entry. A CSV probe set is converted into a FASTA plus ``probe_t2g.tsv`` automatically. A FASTA input is accepted as-is, and ``simpleaf`` generates an identity-style t2g mapping from the FASTA headers. |
| 74 | +- Automatic probe-set selection: |
| 75 | + If neither ``--index`` nor ``--probe-set`` is provided, ``simpleaf`` looks up the requested ``--organism`` in the selected chemistry's registered probe sets, downloads the matching probe CSV if needed, and builds a cached probe index. |
| 76 | +- Cell barcode whitelist: |
| 77 | + This is resolved from the selected chemistry's permit-list metadata in the registry. |
| 78 | +- Sample barcode list: |
| 79 | + This is resolved from ``--sample-bc-list`` if provided, otherwise from the selected chemistry's registry metadata. |
| 80 | + |
| 81 | +Examples |
| 82 | +-------- |
| 83 | + |
| 84 | +Use a registry-backed Flex chemistry with automatic resource resolution: |
| 85 | + |
| 86 | +.. code-block:: console |
| 87 | +
|
| 88 | + $ export ALEVIN_FRY_HOME=/path/to/af_home |
| 89 | + $ simpleaf flex-quant \ |
| 90 | + --chemistry 10x-flexv2-gex-3p \ |
| 91 | + --organism human \ |
| 92 | + --reads1 sample_R1.fastq.gz \ |
| 93 | + --reads2 sample_R2.fastq.gz \ |
| 94 | + --output flex_out |
| 95 | +
|
| 96 | +Use local probe-set and sample-barcode files instead of downloading them: |
| 97 | + |
| 98 | +.. code-block:: console |
| 99 | +
|
| 100 | + $ simpleaf flex-quant \ |
| 101 | + --chemistry 10x-flexv1-gex-3p \ |
| 102 | + --organism mouse \ |
| 103 | + --probe-set /path/to/probe_set.csv \ |
| 104 | + --sample-bc-list /path/to/sample_bc.tsv \ |
| 105 | + --reads1 lane1_R1.fastq.gz,lane2_R1.fastq.gz \ |
| 106 | + --reads2 lane1_R2.fastq.gz,lane2_R2.fastq.gz \ |
| 107 | + --output flex_out |
| 108 | +
|
| 109 | +Use a pre-built probe index: |
| 110 | + |
| 111 | +.. code-block:: console |
| 112 | +
|
| 113 | + $ simpleaf flex-quant \ |
| 114 | + --chemistry 10x-flexv2-gex-3p \ |
| 115 | + --organism human \ |
| 116 | + --index /path/to/probe_index \ |
| 117 | + --reads1 sample_R1.fastq.gz \ |
| 118 | + --reads2 sample_R2.fastq.gz \ |
| 119 | + --output flex_out |
| 120 | +
|
| 121 | +Output |
| 122 | +------ |
| 123 | + |
| 124 | +The command creates the requested output directory and writes: |
| 125 | + |
| 126 | +- ``af_map/``: the ``piscem`` mapping output |
| 127 | +- ``af_quant/``: the ``alevin-fry`` permit-list, collate, and quantification output |
| 128 | +- ``simpleaf_flex_quant_info.json``: a metadata record describing the resolved inputs, executed commands, and step timings |
| 129 | + |
| 130 | +Notes |
| 131 | +----- |
| 132 | + |
| 133 | +- ``flex-quant`` is specific to registered Flex GEX chemistries. For standard scRNA-seq chemistries and general custom geometries, use :doc:`/quant-command`. |
| 134 | +- The Flex pipeline currently uses ``piscem`` for mapping. |
| 135 | +- When a probe CSV is converted, all probes are kept in the generated FASTA and t2g mapping so that downstream quantification has a complete reference-to-gene map. |
0 commit comments