Skip to content

Commit a5146f9

Browse files
committed
update docs
1 parent e03e7f5 commit a5146f9

8 files changed

Lines changed: 150 additions & 13 deletions

docs/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#######
22
#
33
###### Custom themes (no version specifiers) ######
4-
furo
4+
sphinx
5+
furo

docs/source/chemistry-command.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The ``chemistry`` command provides functionality to manage and inspect custom ch
3232
These sub-commands are described below.
3333

3434
``simpleaf chemistry refresh``
35-
-----------------------
35+
-------------------------------
3636

3737
The ``refresh`` sub-command takes no *required* arguments; it's usage is shown below:
3838

@@ -81,8 +81,10 @@ Every chemistry added to the registry has three mandatory properties: ``name``,
8181
- ``name``: A unique name (within the existing registry) of the chemistry. It must be a valid UTF-8 identifier. If the name is already registered, the existing definition will be updated if a higher ``--version`` is provided (see below for details). Otherwise, simpleaf will complain and fail.
8282
- ``geometry``: The geometry specification must be provided as a quoted string, and must follow the `Sequence Fragment Geometry Description Language <https://hackmd.io/@PI7Og0l1ReeBZu_pjQGUQQ/rJMgmvr13>`_ as used in the `quant command <https://simpleaf.readthedocs.io/en/latest/quant-command.html#a-note-on-the-chemistry-flag>`_.
8383
- ``expected-ori``: The expected orientation of the chemistry. It must be one of the following: fw (forward), rc (reverse complement), or both (both orientations). It describes the expected orientation relative to the first (most upstream) mappable biological sequence.
84-
Imagine we have reads from 10x Chromium 5' protocols with read1s and read2s both of 150 base pairs. With this specification, a read1, which is in the forward orientation, contains, from 5' to 3', a cell barcode, a UMI, a fixed fragment, and a fragment representing the 5' end of the cDNA. A read2, which is in the reverse complementary orientation, contains the second (downstream) cDNA fragment relative to its read1. You can find a detailed explanation of the 10x Chromium 5' protocol from `Single Cell Genomics Library Structure <https://teichlab.github.io/scg_lib_structs/methods_html/10xChromium5.html>`_.
85-
If we map the biological sequence in read1s and read2s as paired-end reads (currently only supported when using the default mapper -- piscem), as biological read1s are the first mappable sequences, the expected orientation for this chemistry should be ``fw``, the orientation of read1s. However, if we only map read2s, the expected orientation should be ``rc``, because read2s are the first mappable sequences and are in the reverse complementary orientation.
84+
85+
Imagine we have reads from 10x Chromium 5' protocols with read1s and read2s both of 150 base pairs. With this specification, a read1, which is in the forward orientation, contains, from 5' to 3', a cell barcode, a UMI, a fixed fragment, and a fragment representing the 5' end of the cDNA. A read2, which is in the reverse complementary orientation, contains the second (downstream) cDNA fragment relative to its read1. You can find a detailed explanation of the 10x Chromium 5' protocol from `Single Cell Genomics Library Structure <https://teichlab.github.io/scg_lib_structs/methods_html/10xChromium5.html>`_.
86+
87+
If we map the biological sequence in read1s and read2s as paired-end reads (currently only supported when using the default mapper -- piscem), as biological read1s are the first mappable sequences, the expected orientation for this chemistry should be ``fw``, the orientation of read1s. However, if we only map read2s, the expected orientation should be ``rc``, because read2s are the first mappable sequences and are in the reverse complementary orientation.
8688

8789
In addition to the required fields, there are 3 optional fields, as described below. A permit list file must be a TSV file without a header, and the first column must contain the sequence of permitted cell barcodes, i.e., the whitelist of cell barcodes.
8890

docs/source/flex-quant-command.rst

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
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.

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ That's it for initial notes. Use the menu below to learn more about the `simple
4545
inspect-command.rst
4646
index-command.rst
4747
quant-command.rst
48+
flex-quant-command.rst
4849
refresh-prog-info.rst
4950
workflow.rst
5051
LICENSE.rst

docs/source/quant-command.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
``quant`` command
22
=================
33

4+
For 10x Flex Gene Expression data, use :doc:`/flex-quant-command` instead. The ``quant`` command documented here covers the standard ``simpleaf`` quantification workflow for non-Flex chemistries.
5+
46

57
The ``quant`` command takes as input **either**:
68
1) the index, reads, and relevant information about the experiment (e.g. the chemistry) OR
@@ -95,4 +97,3 @@ The relevant options (which you can obtain by running ``simpleaf quant -h``) are
9597
9698
Output Options:
9799
--anndata-out Generate an anndata (h5ad format) count matrix from the standard (matrix-market format) output
98-

docs/source/workflow-get.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ Usually, a published workflow contains four sections:
3030
For most users, the ``fast_config`` is the only section needed to instantiate the template. To fill the missing information, one just needs to replace the ``null`` with a meaningful value. For more details, please check out dedicated tutorial on `running workflows from an published template <https://combine-lab.github.io/alevin-fry-tutorials/2023/running-simpleaf-workflow/>`_.
3131

3232

33-
Full Usage
34-
^^^^^^^^^^
33+
Get Usage
34+
^^^^^^^^^
3535

3636
The relevant options (which you can obtain by running ``simpleaf workflow get -h``) are:
3737

@@ -48,4 +48,3 @@ The relevant options (which you can obtain by running ``simpleaf workflow get -h
4848
-V, --version Print version
4949
5050
51-

docs/source/workflow-list.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ simpleaf workflow list
33

44
``simpleaf workflow list`` lists all workflows in the registry. If one would like to refresh the registry to keep all workflows up to date, please run the :ref:`simpleaf workflow refresh` command.
55

6-
Full Usage
6+
List Usage
77
^^^^^^^^^^
88

99
The relevant options (which you can obtain by running ``simpleaf workflow list -h``) are:
@@ -17,4 +17,3 @@ The relevant options (which you can obtain by running ``simpleaf workflow list -
1717
Options:
1818
-h, --help Print help
1919
-V, --version Print version
20-

docs/source/workflow-refresh.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ simpleaf workflow refresh
33

44
``simpleaf workflow refresh`` pulls the latest protocol estuary library from `its GitHub repository <https://github.com/COMBINE-lab/protocol-estuary>`_. We recommend updating the registry everytime before fetching a workflow.
55

6-
Full Usage
7-
^^^^^^^^^^
6+
Refresh Usage
7+
^^^^^^^^^^^^^
88

99
The relevant options (which you can obtain by running ``simpleaf workflow refresh -h``) are:
1010

@@ -17,4 +17,3 @@ The relevant options (which you can obtain by running ``simpleaf workflow refres
1717
Options:
1818
-h, --help Print help
1919
-V, --version Print version
20-

0 commit comments

Comments
 (0)