# HG changeset patch # User jeltje # Date 1420657822 18000 # Node ID 65489579eace15917cb3e739e224aa319fb09153 Uploaded diff -r 000000000000 -r 65489579eace myTools/test-data/testinput.fa --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/myTools/test-data/testinput.fa Wed Jan 07 14:10:22 2015 -0500 @@ -0,0 +1,4 @@ +>gi|1731512|gb|U51349.1|TAU51349 +CTACGGCAGGAGAAGACATCCGAAGAAGCTGACACCTCTCGCCTACAAGCAGTTTATCCCTAATGTCGCG +GAGAAGACCTTAGGGGCCAGCGGCAGATACGAAGGCAAGATAACGCGCAATTCGGAGAGATTTAAAGAAC +TTACTCCAAATTACAATCCCGACATTATCTTTAAGGATGAGGAGAACACG diff -r 000000000000 -r 65489579eace myTools/test-data/testoutput.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/myTools/test-data/testoutput.txt Wed Jan 07 14:10:22 2015 -0500 @@ -0,0 +1,1 @@ +0.471 diff -r 000000000000 -r 65489579eace myTools/toolExample.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/myTools/toolExample.pl Wed Jan 07 14:10:22 2015 -0500 @@ -0,0 +1,23 @@ +#!/usr/local/bin/perl -w + +# usage : perl toolExample.pl + +open (IN, "<$ARGV[0]"); +open (OUT, ">$ARGV[1]"); +while () { + chop; + if (m/^>/) { + s/^>//; + if ($. > 1) { + print OUT sprintf("%.3f", $gc/$length) . "\n"; + } + $gc = 0; + $length = 0; + } else { + ++$gc while m/[gc]/ig; + $length += length $_; + } +} +print OUT sprintf("%.3f", $gc/$length) . "\n"; +close( IN ); +close( OUT ); diff -r 000000000000 -r 65489579eace myTools/toolExample.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/myTools/toolExample.xml Wed Jan 07 14:10:22 2015 -0500 @@ -0,0 +1,30 @@ + + for each sequence in a file + toolExample.pl $input $output + + + + + + + + + + + + + + + +This tool computes GC content from a FASTA file. + + + + + + + + + + +