Mercurial > repos > peterjc > seq_select_by_id
changeset 3:19e26966ed3e draft
Uploaded v0.0.6, handles Biopython dependency via the ToolShed, adopted MIT license, using reStructuredTest for the README file.
No functional changes.
author | peterjc |
---|---|
date | Mon, 29 Jul 2013 09:13:13 -0400 |
parents | 28d52478ace9 |
children | 6842c0c7bc70 |
files | tools/filters/repository_dependencies.xml tools/filters/seq_select_by_id.py tools/filters/seq_select_by_id.rst tools/filters/seq_select_by_id.txt tools/filters/seq_select_by_id.xml |
diffstat | 5 files changed, 136 insertions(+), 89 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/filters/repository_dependencies.xml Mon Jul 29 09:13:13 2013 -0400 @@ -0,0 +1,6 @@ +<?xml version="1.0"?> +<repositories description="This requires Biopython as a dependency."> +<!-- Leave out the tool shed and revision to get the current + tool shed and latest revision at the time of upload --> +<repository changeset_revision="5d0c54f7fea2" name="package_biopython_1_61" owner="biopython" toolshed="http://toolshed.g2.bx.psu.edu" /> +</repositories>
--- a/tools/filters/seq_select_by_id.py Mon Apr 15 12:28:51 2013 -0400 +++ b/tools/filters/seq_select_by_id.py Mon Jul 29 09:13:13 2013 -0400 @@ -17,10 +17,10 @@ http://dx.doi.org/10.1093/bioinformatics/btp163 pmid:19304878. This script is copyright 2011-2013 by Peter Cock, The James Hutton Institute UK. -All rights reserved. See accompanying text file for licence details (MIT/BSD -style). +All rights reserved. See accompanying text file for licence details (MIT +license). -This is version 0.0.4 of the script. +This is version 0.0.6 of the script. """ import sys @@ -29,7 +29,7 @@ sys.exit(err) if "-v" in sys.argv or "--version" in sys.argv: - print "v0.0.4" + print "v0.0.6" sys.exit(0) #Parse Command Line
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/filters/seq_select_by_id.rst Mon Jul 29 09:13:13 2013 -0400 @@ -0,0 +1,118 @@ +Galaxy tool to select FASTA, QUAL, FASTQ or SFF sequences by ID +=============================================================== + +This tool is copyright 2011-2013 by Peter Cock, The James Hutton Institute +(formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved. +See the licence text below. + +This tool is a short Python script (using Biopython library functions) to extract +sequences from a FASTA, QUAL, FASTQ, or SFF file based on the list of IDs given +by a column of a tabular file. The output order follows that of the tabular file, +and if there are duplicates in the tabular file, there will be duplicates in the +output sequence file. + +This tool is available from the Galaxy Tool Shed at: + +* http://toolshed.g2.bx.psu.edu/view/peterjc/seq_select_by_id + +See also the sister tools to filter sequence files according to IDs from column(s) +of a tabular file (where the output order follows the sequence file, and any +duplicate IDs are ignored) and rename sequences: + +* http://toolshed.g2.bx.psu.edu/view/peterjc/seq_filter_by_id +* http://toolshed.g2.bx.psu.edu/view/peterjc/seq_rename + + +Automated Installation +====================== + +This should be straightforward using the Galaxy Tool Shed, which should be +able to automatically install the dependency on Biopython, and then install +this tool and run its unit tests. + + +Manual Installation +=================== + +There are just two files to install to use this tool from within Galaxy: + +* seq_select_by_id.py (the Python script) +* seq_select_by_id.xml (the Galaxy tool definition) + +The suggested location is in the Galaxy folder tools/filters next to the tool +for calling sff_extract.py for converting SFF to FASTQ or FASTA + QUAL. + +You will also need to modify the tools_conf.xml file to tell Galaxy to offer the +tool. One suggested location is in the filters section. Simply add the line:: + + <tool file="filters/seq_select_by_id.xml" /> + +If you wish to run the unit tests, also add this to tools_conf.xml.sample +and move/copy the test-data files under Galaxy's test-data folder. Then:: + + $ ./run_functional_tests.sh -id seq_select_by_id + +You will also need to install Biopython 1.54 or later. That's it. + + +History +======= + +======= ====================================================================== +Version Changes +------- ---------------------------------------------------------------------- +v0.0.1 - Initial version. +v0.0.3 - Ignore blank lines in input. +v0.0.4 - Record script version when run from Galaxy. + - Basic unit test included. +v0.0.5 - Check for errors using Python script's return code. +v0.0.6 - Link to Tool Shed added to help text and this documentation. + - Automatic installation of Biopython dependency. + - Use reStructuredText for this README file. + - Adopt standard MIT License. +======= ====================================================================== + + +Developers +========== + +This script and related tools are being developed on the following hg branch: +http://bitbucket.org/peterjc/galaxy-central/src/tools + +For making the "Galaxy Tool Shed" http://toolshed.g2.bx.psu.edu/ tarball use +the following command from the Galaxy root folder:: + + $ tar -czf seq_select_by_id.tar.gz tools/filters/seq_select_by_id.* tools/filters/repository_dependencies.xml test-data/k12_ten_proteins.fasta test-data/k12_hypothetical.fasta test-data/k12_hypothetical.tabular + +Check this worked:: + + $ tar -tzf seq_select_by_id.tar.gz + tools/filters/seq_select_by_id.py + tools/filters/seq_select_by_id.rst + tools/filter/seq_select_by_id.xml + tools/filters/repository_dependencies.xml + test-data/k12_ten_proteins.fasta + test-data/k12_hypothetical.fasta + test-data/k12_hypothetical.tabular + + +Licence (MIT) +============= + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.
--- a/tools/filters/seq_select_by_id.txt Mon Apr 15 12:28:51 2013 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,84 +0,0 @@ -Galaxy tool to select FASTA, QUAL, FASTQ or SFF sequences by ID -=============================================================== - -This tool is copyright 2011 by Peter Cock, The James Hutton Institute -(formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved. -See the licence text below. - -This tool is a short Python script (using Biopython library functions) to extract -sequences from a FASTA, QUAL, FASTQ, or SFF file based on the list of IDs given -by a column of a tabular file. The output order follows that of the tabular file, -and if there are duplicates in the tabular file, there will be duplicates in the -output sequence file. - -See also the sister tool to filter sequence files according to IDs from column(s) -of a tabular file, where the output order follows the sequence file, and any -duplicate IDs are ignored. - -There are just two files to install: - -* seq_select_by_id.py (the Python script) -* seq_select_by_id.xml (the Galaxy tool definition) - -The suggested location is in the Galaxy folder tools/filters next to the tool -for calling sff_extract.py for converting SFF to FASTQ or FASTA + QUAL. - -You will also need to modify the tools_conf.xml file to tell Galaxy to offer the -tool. One suggested location is in the filters section. Simply add the line: - -<tool file="filters/seq_select_by_id.xml" /> - -You will also need to install Biopython 1.54 or later. That's it. - - -History -======= - -v0.0.1 - Initial version. -v0.0.3 - Ignore blank lines in input. -v0.0.4 - Record script version when run from Galaxy. - - Basic unit test included. - - -Developers -========== - -This script and related tools are being developed on the following hg branch: -http://bitbucket.org/peterjc/galaxy-central/src/tools - -For making the "Galaxy Tool Shed" http://toolshed.g2.bx.psu.edu/ tarball use -the following command from the Galaxy root folder: - -$ tar -czf seq_select_by_id.tar.gz tools/filters/seq_select_by_id.* test-data/k12_ten_proteins.fasta test-data/k12_hypothetical.fasta test-data/k12_hypothetical.tabular - -Check this worked: - -$ tar -tzf seq_select_by_id.tar.gz -filter/seq_select_by_id.py -filter/seq_select_by_id.txt -filter/seq_select_by_id.xml -test-data/k12_ten_proteins.fasta -test-data/k12_hypothetical.fasta -test-data/k12_hypothetical.tabular - - -Licence (MIT/BSD style) -======================= - -Permission to use, copy, modify, and distribute this software and its -documentation with or without modifications and for any purpose and -without fee is hereby granted, provided that any copyright notices -appear in all copies and that both those copyright notices and this -permission notice appear in supporting documentation, and that the -names of the contributors or copyright holders not be used in -advertising or publicity pertaining to distribution of the software -without specific prior permission. - -THE CONTRIBUTORS AND COPYRIGHT HOLDERS OF THIS SOFTWARE DISCLAIM ALL -WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE -CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT -OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE -OR PERFORMANCE OF THIS SOFTWARE.
--- a/tools/filters/seq_select_by_id.xml Mon Apr 15 12:28:51 2013 -0400 +++ b/tools/filters/seq_select_by_id.xml Mon Jul 29 09:13:13 2013 -0400 @@ -1,9 +1,14 @@ -<tool id="seq_select_by_id" name="Select sequences by ID" version="0.0.4"> +<tool id="seq_select_by_id" name="Select sequences by ID" version="0.0.6"> <description>from a tabular file</description> <version_command interpreter="python">seq_select_by_id.py --version</version_command> <command interpreter="python"> seq_select_by_id.py $input_tabular $column $input_file $input_file.ext $output_file </command> + <stdio> + <!-- Anything other than zero is an error --> + <exit_code range="1:" /> + <exit_code range=":-1" /> + </stdio> <inputs> <param name="input_file" type="data" format="fasta,qual,fastq,sff" label="Sequence file to select from" help="FASTA, QUAL, FASTQ, or SFF format." /> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> @@ -54,5 +59,7 @@ molecular biology and bioinformatics. Bioinformatics 25(11) 1422-3. http://dx.doi.org/10.1093/bioinformatics/btp163 pmid:19304878. +This tool is available to install into other Galaxy Instances via the Galaxy +Tool Shed at http://toolshed.g2.bx.psu.edu/view/peterjc/seq_select_by_id </help> </tool>