[Bio] / FigKernelScripts / fasta_for_hypo.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/fasta_for_hypo.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (view) (download) (as text)

1 : efrank 1.1 # -*- perl -*-
2 : olson 1.2 #
3 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
4 :     # for Interpretations of Genomes. All Rights Reserved.
5 :     #
6 :     # This file is part of the SEED Toolkit.
7 :     #
8 :     # The SEED Toolkit is free software. You can redistribute
9 :     # it and/or modify it under the terms of the SEED Toolkit
10 :     # Public License.
11 :     #
12 :     # You should have received a copy of the SEED Toolkit Public License
13 :     # along with this program; if not write to the University of Chicago
14 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
15 :     # Genomes at veronika@thefig.info or download a copy from
16 :     # http://www.theseed.org/LICENSE.TXT.
17 :     #
18 :    
19 : efrank 1.1 use FIG;
20 :    
21 :     # usage: fasta_for_hypo Assignments < fasta > unassigned.fasta
22 :    
23 :     ($assignments = shift @ARGV)
24 :     || die "usage: fasta_for_hypo Assignments < fasta > unassigned.fasta";
25 :    
26 :     foreach $_ (`cat $assignments`)
27 :     {
28 :     if (($_ =~ /^(\S+)\t(\S[^\t]+\S)/) && ($id = $1) && ($func = $2) && (! &FIG::hypo($func)))
29 :     {
30 :     $assigned{$id} = 1;
31 :     }
32 :     }
33 :    
34 :     $/ = "\n>";
35 :     while (defined($_ = <STDIN>))
36 :     {
37 :     chomp;
38 :     if ($_ =~ /^>?(\S+)([^\n]*\n)(.*)/s)
39 :     {
40 :     $id = $1;
41 :     $comment = $2;
42 :     $seq = $3;
43 :     $seq =~ s/\s//g;
44 :     if ((! $assigned{$id}) || &FIG::hypo($assigned{$id}))
45 :     {
46 :     print ">$id\n$seq\n";
47 :     }
48 :     }
49 :     }
50 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3