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

Annotation of /FigKernelScripts/assign_figfam.pl

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : arodri7 1.1 #!/usr/bin/perl
2 :    
3 :     ########################################################################
4 :     # -*- perl -*-
5 :     #
6 :     # Copyright (c) 2003-2006 University of Chicago and Fellowship
7 :     # for Interpretations of Genomes. All Rights Reserved.
8 :     #
9 :     # This file is part of the SEED Toolkit.
10 :     #
11 :     # The SEED Toolkit is free software. You can redistribute
12 :     # it and/or modify it under the terms of the SEED Toolkit
13 :     # Public License.
14 :     #
15 :     # You should have received a copy of the SEED Toolkit Public License
16 :     # along with this program; if not write to the University of Chicago
17 :     # at info@ci.uchicago.edu or the Fellowship for Interpretation of
18 :     # Genomes at veronika@thefig.info or download a copy from
19 :     # http://www.theseed.org/LICENSE.TXT.
20 :     #
21 :     ############
22 :     #
23 :     # This little utility can be used as an initial pass in annotating the proteins within
24 :     # a genome. We suggest that you try something like
25 :     #
26 :     # assign_using_ff ../FigfamsData.Release.1 < fasta.for.genome > assignments 2> could.not.assign
27 :     #
28 :     # for your favorite genome and evaluate the results
29 :     #
30 :     ###########################
31 :    
32 :     use Carp;
33 :     use Data::Dumper;
34 :    
35 :     my $usage = "usage: assign_using_ff [-l] [-f] Dir";
36 :    
37 :     my $dir;
38 :     my $loose = 0;
39 :     my $full = 0;
40 :     while ( $ARGV[0] =~ /^-/ )
41 :     {
42 :     $_ = shift @ARGV;
43 :     if ($_ =~ s/^-l//) { $loose = 1 }
44 :     elsif ($_ =~ s/^-f//) { $full = 1 }
45 :     else { print STDERR "Bad flag: '$_'\n$usage"; exit 1 }
46 :     }
47 :    
48 :     ($dir = shift @ARGV)
49 :     || die $usage;
50 :    
51 :     use lib "$dir/../bin";
52 :     use FF;
53 :     use FFs;
54 :     my $figfams = new FFs($dir);
55 :    
56 :    
57 :     $line = <STDIN>;
58 :     while ($line && ($line =~ /^>(\S+)/))
59 :     {
60 :     my $id = $1;
61 :     my @seq = ();
62 :     while (defined($line = <STDIN>) && ($line !~ /^>/))
63 :     {
64 :     $line =~ s/\s//g;
65 :     push(@seq,$line);
66 :     }
67 :     my $seq = join("",@seq);
68 :     my($famO,undef) = $figfams->place_in_family($seq,undef,$loose);
69 :     if ($famO)
70 :     {
71 :     my $func = $full ? $famO->family_function(1) : $famO->family_function;
72 :     print join("\t",($id,$func)),"\n";
73 :     }
74 :     else
75 :     {
76 :     print STDERR "$id was not placed into a FIGfam\n";
77 :     }
78 :     }

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3