Repository revision
repository tip
Select a revision to inspect and download versions of Galaxy utilities from this repository.

Repository 'seq_rename'
http://toolshed.g2.bx.psu.edu/view/peterjc/seq_rename
seq_rename
unrestricted
Rename sequences with ID mapping from a tabular file
Allows you to rename sequences in FASTA, QUAL, FASTQ or SFF files.

The renaming rules are given by two columns of a tabular file (old names and new names). Any sequence not mentioned in the tabular file keeps its current name.

This tool requires Biopython for working with SFF files.

See also my related tools to filter sequences by ID, or select sequences by ID.
2:7c0642fc57ad
peterjc
True
295

Repository README files - may contain important installation or license information

Galaxy tool to rename FASTA, QUAL, FASTQ or SFF sequences

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 rename sequences from a FASTA, QUAL, FASTQ, or SFF file based on an ID mapping gives as two columns of a tabular file. The output order follows that of the sequence file, and if there are duplicates in the input sequence file, there will be duplicates in the output sequence file.

This tool is available from the Galaxy Tool Shed,

See also the sister tools to filter or select sequence files according to IDs from column(s) of tabular file:

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_rename.py (the Python script)
  • seq_rename.xml (the Galaxy tool definition)

The suggested location is in a dedicated tools/seq_rename folder.

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="seq_rename/seq_rename.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_rename

You will also need to install Biopython 1.54 or later. That's it.

History

Version Changes
v0.0.1
  • Initial version.
v0.0.2
  • Record script version when run from Galaxy.
  • Add unit test.
  • Check for errors using Python script's return code.
v0.0.3
  • Link to Tool Shed added to help text and this documentation.
v0.0.4
  • Automated installation of Biopython dependency.
  • Use reStructuredText for this README file.
  • Adopt standard MIT License.
  • Updated citation information (Cock et al. 2013).
  • Development moved to GitHub, https://github.com/peterjc/pico_galaxy
  • Renamed folder and adopted README.rst naming.

Developers

This script and related tools were initially developed on the following hg branch: http://bitbucket.org/peterjc/galaxy-central/src/tools

Development has now moved to a dedicated GitHub repository: https://github.com/peterjc/pico_galaxy/tree/master/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_rename.tar.gz tools/seq_rename/README.rst tools/seq_rename/seq_rename.* tools/seq_rename/repository_dependencies.xml test-data/four_human_proteins.fasta test-data/four_human_proteins.rename.tabular test-data/four_human_proteins.rename.fasta

Check this worked:

$ tar -tzf seq_rename.tar.gz
tools/seq_rename/README.rst
tools/seq_rename/seq_rename.py
tools/seq_rename/seq_rename.xml
tools/seq_rename/repository_dependencies.xml
test-data/four_human_proteins.fasta
test-data/four_human_proteins.rename.tabular
test-data/four_human_proteins.rename.fasta

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.

Dependencies of this repository

Repository package_numpy_1_7 revision ef12a3a11d5b owned by iuc (prior install required)

Contents of this repository

Name Description Version
Rename sequences with ID mapping from a tabular file 0.0.4

Automated tool test results

Time tested: 2014-04-17 05:42:57
System: Linux 3.8.0-30-generic
Architecture: x86_64
Python version: 2.7.4
Galaxy revision: 13085:c05752549163
Galaxy database version: 118
Tool shed revision: 12961:888478c66456
Tool shed database version: 22
Tool shed mercurial version: 2.2.3
Tool id: seq_rename
Tool version: seq_rename
Test: test_tool_000000 (functional.test_toolbox.TestForTool_toolshed.g2.bx.psu.edu/repos/peterjc/seq_rename/seq_rename/0.0.4)
Tool id: seq_rename
Tool version: seq_rename
Test: test_tool_000001 (functional.test_toolbox.TestForTool_toolshed.g2.bx.psu.edu/repos/peterjc/seq_rename/seq_rename/0.0.4)
Tool shedNameOwnerChangeset revision
toolshed.g2.bx.psu.edu package_biopython_1_62 biopython 3e82cbc44886
Time tested: 2014-04-16 05:37:20
System: Linux 3.8.0-30-generic
Architecture: x86_64
Python version: 2.7.4
Galaxy revision: 13065:1ad62c772728
Galaxy database version: 118
Tool shed revision: 12961:888478c66456
Tool shed database version: 22
Tool shed mercurial version: 2.2.3
Tool id: seq_rename
Tool version: seq_rename
Test: test_tool_000000 (functional.test_toolbox.TestForTool_toolshed.g2.bx.psu.edu/repos/peterjc/seq_rename/seq_rename/0.0.4)
Tool id: seq_rename
Tool version: seq_rename
Test: test_tool_000001 (functional.test_toolbox.TestForTool_toolshed.g2.bx.psu.edu/repos/peterjc/seq_rename/seq_rename/0.0.4)
Tool shedNameOwnerChangeset revision
toolshed.g2.bx.psu.edu package_biopython_1_62 biopython 3e82cbc44886
Time tested: 2014-04-15 06:11:48
System: Linux 3.8.0-30-generic
Architecture: x86_64
Python version: 2.7.4
Galaxy revision: 13058:1165a5a1221a
Galaxy database version: 118
Tool shed revision: 12961:888478c66456
Tool shed database version: 22
Tool shed mercurial version: 2.2.3
Tool id: seq_rename
Tool version: seq_rename
Test: test_tool_000000 (functional.test_toolbox.TestForTool_toolshed.g2.bx.psu.edu/repos/peterjc/seq_rename/seq_rename/0.0.4)
Tool id: seq_rename
Tool version: seq_rename
Test: test_tool_000001 (functional.test_toolbox.TestForTool_toolshed.g2.bx.psu.edu/repos/peterjc/seq_rename/seq_rename/0.0.4)
Tool shedNameOwnerChangeset revision
toolshed.g2.bx.psu.edu package_biopython_1_62 biopython 3e82cbc44886
Time tested: 2014-04-14 05:34:16
System: Linux 3.8.0-30-generic
Architecture: x86_64
Python version: 2.7.4
Galaxy revision: 13041:b423b847f58e
Galaxy database version: 118
Tool shed revision: 12961:888478c66456
Tool shed database version: 22
Tool shed mercurial version: 2.2.3
Tool id: seq_rename
Tool version: seq_rename
Test: test_tool_000000 (functional.test_toolbox.TestForTool_toolshed.g2.bx.psu.edu/repos/peterjc/seq_rename/seq_rename/0.0.4)
Tool id: seq_rename
Tool version: seq_rename
Test: test_tool_000001 (functional.test_toolbox.TestForTool_toolshed.g2.bx.psu.edu/repos/peterjc/seq_rename/seq_rename/0.0.4)
Tool shedNameOwnerChangeset revision
toolshed.g2.bx.psu.edu package_biopython_1_62 biopython 3e82cbc44886

Categories
Fasta Manipulation
Sequence Analysis
Text Manipulation