Skip to content

Commit 8e8cdf1

Browse files
authored
{is} prepare for rsem docs (#709)
Documentation for prepare_for_em (Was prepare-for-rsem) * Renamed prepare-for-rsem -> prepare_for_em. * Added docstring documentation. * Rearraged common option groups so that CRAM options can be added to prepare_for_em without adding other common sam/bam options. * Added docs/reference/prepare_for_em.rst * Altered index.rst, README and umi_tools.py to recognise the new command * Updated tests/*_help to account for changed option groups.
1 parent d16c87c commit 8e8cdf1

18 files changed

Lines changed: 204 additions & 102 deletions

README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fastq containg UMIs +/- cell barcodes for alignment.
2727
barcode, for example a library barcode, is left on the read. Can
2828
also filter reads by quality or against a whitelist (see above)
2929

30-
The remaining commands, ``group``, ``dedup`` and ``count``/``count_tab``, are used to
30+
The commands, ``group``, ``dedup`` and ``count``/``count_tab``, are used to
3131
identify PCR duplicates using the UMIs and perform different levels of
3232
analysis depending on the needs of the user. A number of different UMI
3333
deduplication schemes are enabled - The recommended method is
@@ -50,6 +50,10 @@ deduplication schemes are enabled - The recommended method is
5050
* count_tab:
5151
**As per count except input is a flatfile**
5252

53+
Finally, the command ``prepare_for_em`` will take the output of ``group`` or
54+
``dedup`` (after it has been name sorted or collated) and make the output
55+
compatible with EM tools like Salmon or RSEM.
56+
5357
See `QUICK_START.md <./doc/QUICK_START.md>`_ for a quick tutorial on
5458
the most common usage pattern.
5559

doc/index.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ for alignment.
6161
barcode, for example a library barcode, is left on the read. Can
6262
also filter reads by quality or against a whitelist (see above)
6363

64-
The remaining commands, ``group``, ``dedup`` and
64+
The commands, ``group``, ``dedup`` and
6565
``count``/``count_tab``, are used to identify PCR duplicates using the
6666
UMIs and perform different levels of analysis depending on the needs
6767
of the user. A number of different UMI deduplication schemes are
@@ -87,6 +87,10 @@ deduplication schemes see :doc:`the_methods`
8787
* count_tab:
8888
**As per count except input is a flatfile**
8989

90+
Finally the command ``prepare_for_em`` takes the output of dedup or group and ensures
91+
that the order of reads and the matching of pairs is compatible with EM algorithms
92+
such as RSEM and Salmon.
93+
9094
.. toctree::
9195
:maxdepth: 1
9296
:caption: Commands:
@@ -97,6 +101,7 @@ deduplication schemes see :doc:`the_methods`
97101
dedup <reference/dedup>
98102
count <reference/count>
99103
count_tab <reference/count_tab>
104+
prepare_for_em <reference/prepare_for_em>
100105

101106
Each tool has a set of :doc:`common_options` for input/output,
102107
profiling and debugging.
@@ -140,7 +145,7 @@ Enter repository and run:
140145

141146
.. code:: bash
142147
143-
$ python setup.py install
148+
$ pip install .
144149
145150
For more detail see :doc:`INSTALL`
146151

doc/reference/prepare_for_em.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Each tool has a set of :ref:`common_options` for input/output,
2+
profiling and debugging.
3+
4+
.. automodule:: umi_tools.prepare_for_em

tests/count_help

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,29 +67,25 @@ Options:
6767
File mapping transcripts to genes (tab separated)
6868
--per-cell group/dedup/count per cell
6969

70-
SAM/BAM options:
70+
Input/Output format options:
7171
--in-format=IN_FORMAT
7272
File format of the input file. Format is usually
7373
implied from the extension of the filename, but maybe
7474
overridden with this option. Default=bam
75-
--out-format=OUT_FORMAT
76-
File format of the input file. Format is usually
77-
implied from the extension of the filename, but maybe
78-
overridden with this option. Default=bam
7975
--input-options=INPUT_OPTIONS
8076
Format string provided to htslib for reading. Mostly
8177
useful for CRAM formatted files. See samtools
8278
documentation
83-
--output-options=OUTPUT_OPTIONS
84-
Format string provided to htslib for writing. Mostly
85-
useful for CRAM formatted files. See samtools
86-
documentation
79+
-i, --in-sam [Deprecated] Input file is in sam format
80+
[default=False]
8781
--reference-filename=REFERENCE_FILENAME
8882
File path or URL to the genome reference to be used
8983
when reading or writing CRAM files. By default, when
9084
reading a CRAM file, the reference recorded in the
9185
input file will be used unless this is specified. When
9286
writing, specifying a reference location is required.
87+
88+
SAM/BAM filtering options:
9389
--mapping-quality=MAPPING_QUALITY
9490
Minimum mapping quality for a read to be retained
9591
[default=0]
@@ -98,9 +94,7 @@ Options:
9894
read1, whether or not the template length is the same
9995
--chrom=CHROM Restrict to one chromosome
10096
--subset=SUBSET Use only a fraction of reads, specified by subset
101-
-i, --in-sam Input file is in sam format [default=False]
10297
--paired paired input BAM. [default=False]
103-
-o, --out-sam Output alignments in sam format [default=False]
10498
--no-sort-output Don't Sort the output
10599

106100
Dedup and Count SAM/BAM options:
@@ -114,7 +108,7 @@ Options:
114108
How to handle unpaired reads. Options are 'discard'or
115109
'use' [default=use]
116110

117-
input/output options:
111+
Input/Output pipe options:
118112
-I FILE, --stdin=FILE
119113
file to read stdin from [default = stdin].
120114
-L FILE, --log=FILE

tests/count_tab_help

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,25 @@ Options:
3434
--read-length use read length in addition to position and UMI to
3535
identify possible duplicates [default=False]
3636

37-
input/output options:
37+
Input/Output format options:
38+
--in-format=IN_FORMAT
39+
File format of the input file. Format is usually
40+
implied from the extension of the filename, but maybe
41+
overridden with this option. Default=bam
42+
--input-options=INPUT_OPTIONS
43+
Format string provided to htslib for reading. Mostly
44+
useful for CRAM formatted files. See samtools
45+
documentation
46+
-i, --in-sam [Deprecated] Input file is in sam format
47+
[default=False]
48+
--reference-filename=REFERENCE_FILENAME
49+
File path or URL to the genome reference to be used
50+
when reading or writing CRAM files. By default, when
51+
reading a CRAM file, the reference recorded in the
52+
input file will be used unless this is specified. When
53+
writing, specifying a reference location is required.
54+
55+
Input/Output pipe options:
3856
-I FILE, --stdin=FILE
3957
file to read stdin from [default = stdin].
4058
-L FILE, --log=FILE

tests/dedup_help

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,35 @@ Options:
7777
tags when selecting the best read amongst reads with
7878
the same position and umi [default=none]
7979

80-
SAM/BAM options:
80+
Input/Output format options:
8181
--in-format=IN_FORMAT
8282
File format of the input file. Format is usually
8383
implied from the extension of the filename, but maybe
8484
overridden with this option. Default=bam
85-
--out-format=OUT_FORMAT
86-
File format of the input file. Format is usually
87-
implied from the extension of the filename, but maybe
88-
overridden with this option. Default=bam
8985
--input-options=INPUT_OPTIONS
9086
Format string provided to htslib for reading. Mostly
9187
useful for CRAM formatted files. See samtools
9288
documentation
89+
-i, --in-sam [Deprecated] Input file is in sam format
90+
[default=False]
91+
--out-format=OUT_FORMAT
92+
File format of the input file. Format is usually
93+
implied from the extension of the filename, but maybe
94+
overridden with this option. Default=bam
9395
--output-options=OUTPUT_OPTIONS
9496
Format string provided to htslib for writing. Mostly
9597
useful for CRAM formatted files. See samtools
9698
documentation
99+
-o, --out-sam [Deprecated] Output alignments in sam format
100+
[default=False]
97101
--reference-filename=REFERENCE_FILENAME
98102
File path or URL to the genome reference to be used
99103
when reading or writing CRAM files. By default, when
100104
reading a CRAM file, the reference recorded in the
101105
input file will be used unless this is specified. When
102106
writing, specifying a reference location is required.
107+
108+
SAM/BAM filtering options:
103109
--mapping-quality=MAPPING_QUALITY
104110
Minimum mapping quality for a read to be retained
105111
[default=0]
@@ -108,9 +114,7 @@ Options:
108114
read1, whether or not the template length is the same
109115
--chrom=CHROM Restrict to one chromosome
110116
--subset=SUBSET Use only a fraction of reads, specified by subset
111-
-i, --in-sam Input file is in sam format [default=False]
112117
--paired paired input BAM. [default=False]
113-
-o, --out-sam Output alignments in sam format [default=False]
114118
--no-sort-output Don't Sort the output
115119

116120
Dedup and Count SAM/BAM options:
@@ -124,7 +128,7 @@ Options:
124128
How to handle unpaired reads. Options are 'discard'or
125129
'use' [default=use]
126130

127-
input/output options:
131+
Input/Output pipe options:
128132
-I FILE, --stdin=FILE
129133
file to read stdin from [default = stdin].
130134
-L FILE, --log=FILE

tests/extract_help

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Options:
7979
--ignore-read-pair-suffixes
8080
Ignore '\1' and '\2' read name suffixes
8181

82-
input/output options:
82+
Input/Output pipe options:
8383
-I FILE, --stdin=FILE
8484
file to read stdin from [default = stdin].
8585
-L FILE, --log=FILE

tests/group_help

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,35 @@ Options:
8080
tags when selecting the best read amongst reads with
8181
the same position and umi [default=none]
8282

83-
SAM/BAM options:
83+
Input/Output format options:
8484
--in-format=IN_FORMAT
8585
File format of the input file. Format is usually
8686
implied from the extension of the filename, but maybe
8787
overridden with this option. Default=bam
88-
--out-format=OUT_FORMAT
89-
File format of the input file. Format is usually
90-
implied from the extension of the filename, but maybe
91-
overridden with this option. Default=bam
9288
--input-options=INPUT_OPTIONS
9389
Format string provided to htslib for reading. Mostly
9490
useful for CRAM formatted files. See samtools
9591
documentation
92+
-i, --in-sam [Deprecated] Input file is in sam format
93+
[default=False]
94+
--out-format=OUT_FORMAT
95+
File format of the input file. Format is usually
96+
implied from the extension of the filename, but maybe
97+
overridden with this option. Default=bam
9698
--output-options=OUTPUT_OPTIONS
9799
Format string provided to htslib for writing. Mostly
98100
useful for CRAM formatted files. See samtools
99101
documentation
102+
-o, --out-sam [Deprecated] Output alignments in sam format
103+
[default=False]
100104
--reference-filename=REFERENCE_FILENAME
101105
File path or URL to the genome reference to be used
102106
when reading or writing CRAM files. By default, when
103107
reading a CRAM file, the reference recorded in the
104108
input file will be used unless this is specified. When
105109
writing, specifying a reference location is required.
110+
111+
SAM/BAM filtering options:
106112
--mapping-quality=MAPPING_QUALITY
107113
Minimum mapping quality for a read to be retained
108114
[default=0]
@@ -111,9 +117,7 @@ Options:
111117
read1, whether or not the template length is the same
112118
--chrom=CHROM Restrict to one chromosome
113119
--subset=SUBSET Use only a fraction of reads, specified by subset
114-
-i, --in-sam Input file is in sam format [default=False]
115120
--paired paired input BAM. [default=False]
116-
-o, --out-sam Output alignments in sam format [default=False]
117121
--no-sort-output Don't Sort the output
118122

119123
Group SAM/BAM options:
@@ -127,7 +131,7 @@ Options:
127131
How to handle unpaired reads. Options are 'discard',
128132
'use' or 'output' [default=use]
129133

130-
input/output options:
134+
Input/Output pipe options:
131135
-I FILE, --stdin=FILE
132136
file to read stdin from [default = stdin].
133137
-L FILE, --log=FILE

tests/umi_tools_help

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ For full UMI-tools documentation, see: https://umi-tools.readthedocs.io/en/lates
44
umi_tools.py - Tools for UMI analyses
55
=====================================
66

7-
:Author: Tom Smith & Ian Sudbury, CGAT
7+
:Author: Tom Smith & Ian Sudbery, CGAT
88
:Tags: Genomics UMI
99

1010
There are 6 tools:
@@ -15,6 +15,7 @@ There are 6 tools:
1515
- dedup
1616
- count
1717
- count_tab
18+
- prepare_for_em
1819

1920
To get help on a specific tool, type:
2021

tests/whitelist_help

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Options:
6969
--ignore-read-pair-suffixes
7070
Ignore '\1' and '\2' read name suffixes
7171

72-
input/output options:
72+
Input/Output pipe options:
7373
-I FILE, --stdin=FILE
7474
file to read stdin from [default = stdin].
7575
-L FILE, --log=FILE

0 commit comments

Comments
 (0)