mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 10:24:38 +08:00
Tool for changing case
This commit is contained in:
@@ -4,7 +4,7 @@ How to prepare NCBI taxonomy for Galaxy Metagenomic Toolkit
|
||||
1. run runTest.sh
|
||||
If this script produces NO messages -> everything is OK
|
||||
|
||||
2. run processRaxonomy.sh
|
||||
2. run processTaxonomy.sh
|
||||
This script does several things:
|
||||
- downloads taxonomy dump tarball from NCBI ftp site
|
||||
- downloads very large gi2taxId files for nucleotide and protein entries of GenBank
|
||||
|
||||
@@ -106,6 +106,7 @@ def main():
|
||||
# contains a single 'scientific name' type
|
||||
try:
|
||||
if field[2] == 'scientific name':
|
||||
field[1] = field[1].replace('\t','_')
|
||||
sqlTemplate = string.Template('insert into names values($taxId, "$name", "$syn")')
|
||||
sql = sqlTemplate.substitute(taxId = int(field[0]), name = field[1], syn = field[2])
|
||||
cur.execute(sql)
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
<tool file="filters/Convert_characters1/1.0.0/convert_characters.xml" />
|
||||
<tool file="filters/createInterval/1.0.0/CreateInterval.xml" />
|
||||
<tool file="filters/Cut1/1.0.0/cutWrapper.xml" />
|
||||
<tool file="filters/ChangeCase1/1.0.0/changeCase.xml" />
|
||||
<tool file="filters/Paste1/1.0.0/pasteWrapper.xml" />
|
||||
<tool file="filters/Remove_beginning1/1.0.0/remove_beginning.xml" />
|
||||
<tool file="filters/Show_beginning1/1.0.0/headWrapper.xml" />
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#! /usr/bin/perl -w
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
|
||||
# Changes case to upper or lower in specified columns
|
||||
# changeCase.pl [filename] [output] [upper|lower]
|
||||
|
||||
die "Check arguments\n" unless @ARGV == 3;
|
||||
|
||||
open (IN, "<$ARGV[0]") or die "Cannot open $ARGV[0]:$!\n";
|
||||
open (OUT, ">$ARGV[1]") or die "Cannot create $ARGV[1]:$!\n";
|
||||
|
||||
while (<IN>) {
|
||||
if ($ARGV[2] eq "up") {
|
||||
print OUT uc($_);
|
||||
} elsif ($ARGV[2] eq "lo") {
|
||||
print OUT lc($_);
|
||||
}
|
||||
}
|
||||
|
||||
close IN;
|
||||
close OUT;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<tool id="ChangeCase1" name="Change Case">
|
||||
<description>to upper or lower</description>
|
||||
<command interpreter="perl">changeCase.pl $input $out_file1 "$upperLower"</command>
|
||||
<inputs>
|
||||
<param format="txt" name="input" type="data" label="Change"/>
|
||||
<param name="upperLower" type="select" label="To">
|
||||
<option value="up">Upper case</option>
|
||||
<option value="lo">Lower case</option>
|
||||
</param>
|
||||
</inputs>
|
||||
<outputs>
|
||||
<data format="tabular" name="out_file1" />
|
||||
</outputs>
|
||||
<tests>
|
||||
<test>
|
||||
<param name="input" value="1.txt"/>
|
||||
<param name="upperLower" value="up"/>
|
||||
<output name="out_file1" file="change-case.dat"/>
|
||||
</test>
|
||||
</tests>
|
||||
<help>
|
||||
|
||||
This tool changes case for lower to upper and vice versa.
|
||||
|
||||
.. class:: infomark
|
||||
|
||||
If you want to change case on a specific column use this tool in combination with *Text Manipulation->Cut*
|
||||
|
||||
</help>
|
||||
</tool>
|
||||
Reference in New Issue
Block a user