view tools/filters/seq_rename.xml @ 2:b51633a69a92 draft

Uploaded v0.0.3, add links to Tool Shed in documentation. Unit test passes locally.
author peterjc
date Tue, 07 May 2013 09:52:31 -0400
parents 6ce8634e2035
children 16a1a5ae98e9
line wrap: on
line source

<tool id="seq_rename" name="Rename sequences" version="0.0.3">
	<description>with ID mapping from a tabular file</description>
	<version_commmand interpreter="python">seq_rename.py --version</version_commmand>
	<command interpreter="python">
seq_rename.py $input_tabular $old_column $new_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" help="FASTA, QUAL, FASTQ, or SFF format." />
		<param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/>
		<param name="old_column" type="data_column" data_ref="input_tabular" multiple="False" numerical="False" label="Column containing current (old) sequence identifiers"/>
                <param name="new_column" type="data_column" data_ref="input_tabular" multiple="False" numerical="False" label="Column containing new sequence identifiers"/>
	</inputs>
	<outputs>
		<data name="output_file" format="fasta" label="Renamed ${on_string}">
			<!-- TODO - Replace this with format="input:input_fastq" if/when that works -->
			<change_format>
				<when input_dataset="input_file" attribute="extension" value="sff" format="sff" />
				<when input_dataset="input_file" attribute="extension" value="fastq" format="fastq" />
				<when input_dataset="input_file" attribute="extension" value="fastqsanger" format="fastqsanger" />
				<when input_dataset="input_file" attribute="extension" value="fastqsolexa" format="fastqsolexa" />
				<when input_dataset="input_file" attribute="extension" value="fastqillumina" format="fastqillumina" />
				<when input_dataset="input_file" attribute="extension" value="fastqcssanger" format="fastqcssanger" />
			</change_format>
		</data>
	</outputs>
	<tests>
		<test>
			<param name="input_file" value="four_human_proteins.fasta" ftype="fasta" />
			<param name="input_tabular" value="four_human_proteins.rename.tabular" ftype="tabular" />
			<param name="old_column" value="1" />
			<param name="new_column" value="2" />
			<output name="output_file" file="four_human_proteins.rename.fasta" ftype="fasta" />
		</test>
	</tests>
	<requirements>
		<requirement type="python-module">Bio</requirement>
	</requirements>
	<help>

**What it does**

Takes a FASTA, QUAL, FASTQ or Standard Flowgram Format (SFF) file and produces a
new sequence file (of the same format) where the sequence identifiers have been
renamed according two the specified columns a the tabular file.

WARNING: If you have any duplicates in the intput sequence file, you will still
have duplicate sequences in the output.

WARNING: If the tabular file has more than one new name for any old ID, the
last one is used.

**Citation**

This tool uses Biopython to read and write SFF files. If you use this tool in
scientific work leading to a publication, please cite the Biopython application
note (and Galaxy too of course):

Cock et al 2009. Biopython: freely available Python tools for computational
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_rename
	</help>
</tool>