Skip to content

Commit fc9ac8c

Browse files
committed
Documentation for prepare_for_em
* Renamed prepare-for-rsem to prepare_for_em (make module python legal name) * Added docs/reference file * Altered index.rst, README and umi_tools.py to recognise the new command
1 parent ed07120 commit fc9ac8c

6 files changed

Lines changed: 30 additions & 10 deletions

File tree

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/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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
3333
In order for this to work correctly, your input file must be sorted by read name.
3434
Generally the protocol would be
35-
1. Align reads with your favourite aligner
35+
1. Align reads to the transcriptome with your favourite aligner
3636
2. Position sort the resulting BAM file
3737
3. Run `dedup` on the position sorted name file
3838
4. Use `samtools sort -n` or `samtools collate` to sort by read name
3939
5. Use `prepare_for_rsem` to create a file that has exactly one mate
4040
per read and that pairs are adjecent in the output.
41-
6. Run your downstream tools - RSEM/Salmon on the output.
41+
6. Run your downstream tools - RSEM/Salmon/Kalisto on the output.
4242
4343
prepare-for-em specific options
4444
-------------------------------
@@ -47,7 +47,8 @@
4747
--tags=TAG[,TAG....]
4848
====================
4949
List of SAM tags that are transfered from read1 to read2. The default
50-
is UG and BX
50+
is UG and BX, which is the numeric UMI group, and the infered true UMI
51+
respectively.
5152
5253
5354
'''
@@ -169,8 +170,8 @@ def main(argv=None):
169170
else:
170171
out_name = "-"
171172

172-
outformat = U.determine_format(out_name, options.sam, options.out_format)
173-
outbam = U.open_output_alignments(out_name, outformat, options)
173+
outformat = U.determine_format(out_name, options.out_sam, options.out_format)
174+
outbam = U.open_output_alignments(out_name, outformat, inbam, options)
174175

175176
options.tags = options.tags.split(",")
176177

umi_tools/umi_tools.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
umi_tools.py - Tools for UMI analyses
33
=====================================
44
5-
:Author: Tom Smith & Ian Sudbury, CGAT
5+
:Author: Tom Smith & Ian Sudbery, CGAT
66
:Tags: Genomics UMI
77
88
There are 6 tools:
@@ -13,6 +13,7 @@
1313
- dedup
1414
- count
1515
- count_tab
16+
- prepare_for_em
1617
1718
To get help on a specific tool, type:
1819
@@ -46,6 +47,10 @@ def main():
4647

4748
command = argv[1]
4849

50+
# substitute old name
51+
if command == "prepare-for-rsem":
52+
command = "prepare-for-em"
53+
4954
try:
5055
module = importlib.import_module("umi_tools." + command, "umi_tools")
5156
except ImportError:

0 commit comments

Comments
 (0)