1
|
1 Galaxy tool to sub-sample sequence files
|
|
2 ========================================
|
0
|
3
|
|
4 This tool is copyright 2014 by Peter Cock, The James Hutton Institute
|
|
5 (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved.
|
|
6 See the licence text below (MIT licence).
|
|
7
|
|
8 This tool is a short Python script (using Biopython library functions)
|
|
9 to sub-sample sequence files (in a range of formats including FASTA, FASTQ,
|
|
10 and SFF). This can be useful for preparing a small sample of data to test
|
|
11 or time a new pipeline, or for reducing the read coverage in a de novo
|
|
12 assembly.
|
|
13
|
|
14 This tool is available from the Galaxy Tool Shed at:
|
|
15
|
|
16 * http://toolshed.g2.bx.psu.edu/view/peterjc/sample_seqs
|
|
17
|
|
18
|
|
19 Automated Installation
|
|
20 ======================
|
|
21
|
|
22 This should be straightforward using the Galaxy Tool Shed, which should be
|
|
23 able to automatically install the dependency on Biopython, and then install
|
|
24 this tool and run its unit tests.
|
|
25
|
|
26
|
|
27 Manual Installation
|
|
28 ===================
|
|
29
|
|
30 There are just two files to install to use this tool from within Galaxy:
|
|
31
|
|
32 * ``sample_seqs.py`` (the Python script)
|
|
33 * ``sample_seqs.xml`` (the Galaxy tool definition)
|
|
34
|
|
35 The suggested location is in a dedicated ``tools/sample_seqs`` folder.
|
|
36
|
|
37 You will also need to modify the ``tools_conf.xml`` file to tell Galaxy to offer the
|
|
38 tool. One suggested location is in the filters section. Simply add the line::
|
|
39
|
|
40 <tool file="sample_seqs/sample_seqs.xml" />
|
|
41
|
2
|
42 You will also need to install Biopython 1.62 or later.
|
0
|
43
|
2
|
44 If you wish to run the unit tests, also move/copy the ``test-data/`` files
|
|
45 under Galaxy's ``test-data/`` folder. Then::
|
|
46
|
|
47 ./run_tests.sh -id sample_seqs
|
0
|
48
|
|
49 That's it.
|
|
50
|
|
51
|
|
52 History
|
|
53 =======
|
|
54
|
|
55 ======= ======================================================================
|
|
56 Version Changes
|
|
57 ------- ----------------------------------------------------------------------
|
|
58 v0.0.1 - Initial version.
|
2
|
59 v0.1.1 - Using optparse to provide a proper command line API.
|
|
60 v0.1.2 - Interleaved mode for working with paired records.
|
|
61 - Tool definition now embeds citation information.
|
|
62 v0.2.0 - Option to give number of sequences (or pairs) desired.
|
|
63 This works by first counting all your sequences, then calculates
|
|
64 the percentage required in order to sample them uniformly (evenly).
|
|
65 This makes two passes through the input and is therefore slower.
|
0
|
66 ======= ======================================================================
|
|
67
|
|
68
|
|
69 Developers
|
|
70 ==========
|
|
71
|
|
72 This script and related tools are being developed on this GitHub repository:
|
|
73 https://github.com/peterjc/pico_galaxy/tree/master/tools/sample_seqs
|
|
74
|
|
75 For making the "Galaxy Tool Shed" http://toolshed.g2.bx.psu.edu/ tarball use
|
|
76 the following command from the Galaxy root folder::
|
|
77
|
2
|
78 $ tar -czf sample_seqs.tar.gz tools/sample_seqs/README.rst tools/sample_seqs/sample_seqs.py tools/sample_seqs/sample_seqs.xml tools/sample_seqs/tool_dependencies.xml test-data/ecoli.fastq test-data/ecoli.sample_N100.fastq test-data/ecoli.pair_sample_N100.fastq test-data/ecoli.sample_C10.fastq test-data/get_orf_input.Suis_ORF.prot.fasta test-data/get_orf_input.Suis_ORF.prot.sample_N100.fasta test-data/get_orf_input.Suis_ORF.prot.pair_sample_N100.fasta test-data/get_orf_input.Suis_ORF.prot.sample_C10.fasta test-data/get_orf_input.Suis_ORF.prot.pair_sample_C10.fasta test-data/MID4_GLZRM4E04_rnd30_frclip.sff test-data/MID4_GLZRM4E04_rnd30_frclip.sample_N5.sff test-data/MID4_GLZRM4E04_rnd30_frclip.pair_sample_N5.sff test-data/MID4_GLZRM4E04_rnd30_frclip.sample_C1.sff
|
0
|
79
|
|
80 Check this worked::
|
|
81
|
|
82 $ tar -tzf sample_seqs.tar.gz
|
|
83 tools/sample_seqs/README.rst
|
|
84 tools/sample_seqs/sample_seqs.py
|
|
85 tools/sample_seqs/sample_seqs.xml
|
|
86 tools/sample_seqs/tool_dependencies.xml
|
|
87 test-data/ecoli.fastq
|
|
88 test-data/ecoli.sample_N100.fastq
|
2
|
89 test-data/ecoli.pair_sample_N100.fastq
|
|
90 test-data/ecoli.sample_C10.fastq
|
0
|
91 test-data/get_orf_input.Suis_ORF.prot.fasta
|
|
92 test-data/get_orf_input.Suis_ORF.prot.sample_N100.fasta
|
2
|
93 test-data/get_orf_input.Suis_ORF.prot.pair_sample_N100.fasta
|
|
94 test-data/get_orf_input.Suis_ORF.prot.sample_C10.fasta
|
|
95 test-data/get_orf_input.Suis_ORF.prot.pair_sample_C10.fasta
|
0
|
96 test-data/MID4_GLZRM4E04_rnd30_frclip.sff
|
|
97 test-data/MID4_GLZRM4E04_rnd30_frclip.sample_N5.sff
|
2
|
98 test-data/MID4_GLZRM4E04_rnd30_pair_sample.sff
|
|
99 test-data/MID4_GLZRM4E04_rnd30_frclip.pair_sample_N5.sff
|
|
100 test-data/MID4_GLZRM4E04_rnd30_frclip.sample_C1.sff
|
0
|
101
|
|
102
|
|
103 Licence (MIT)
|
|
104 =============
|
|
105
|
|
106 Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
107 of this software and associated documentation files (the "Software"), to deal
|
|
108 in the Software without restriction, including without limitation the rights
|
|
109 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
110 copies of the Software, and to permit persons to whom the Software is
|
|
111 furnished to do so, subject to the following conditions:
|
|
112
|
|
113 The above copyright notice and this permission notice shall be included in
|
|
114 all copies or substantial portions of the Software.
|
|
115
|
|
116 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
117 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
118 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
119 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
120 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
121 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
122 THE SOFTWARE.
|