[Bio] / FigKernelPackages / FIG.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/FIG.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.209, Wed Jan 26 18:37:58 2005 UTC revision 1.210, Thu Jan 27 00:31:21 2005 UTC
# Line 16  Line 16 
16  use SeedDas;  use SeedDas;
17  use Construct;  use Construct;
18  use FIGRules;  use FIGRules;
19    use Tracer;
20    
21  #  #
22  # Conditionally evaluate this in case its prerequisites are not available.  # Conditionally evaluate this in case its prerequisites are not available.
# Line 61  Line 62 
62    
63  umask 0;  umask 0;
64    
65    =head1 FIG Genome Annotation System
66    
67    =head2 Introduction
68    
69    This is the main object for access to the SEED data store. The data store
70    itself is a combination of flat files and a database. The flat files can
71    be moved easily between systems and the database rebuilt as needed.
72    
73    A reduced set of this object's functions are available via the B<SFXlate>
74    object. The SFXlate object uses a single database to represent all its
75    genomic information. It provides a much smaller capability for updating
76    the data, and eliminates all similarities except for bidirectional best
77    hits.
78    
79    The key to making the FIG system work is proper configuration of the
80    C<FIG_Config.pm> file. This file contains names and URLs for the key
81    directories as well as the type and login information for the database.
82    
83    =cut
84    
85    #: Constructor FIG->new();
86    
87    =head2 Public Methods
88    
89    =head3 new
90    
91    C<< my $fig = FIG->new(); >>
92    
93    This is the constructor for a FIG object. It uses no parameters.
94    
95    =cut
96    
97  sub new {  sub new {
98      my($class) = @_;      my($class) = @_;
99    
# Line 70  Line 103 
103      # create a FIGrpc and return that as the return from this constructor.      # create a FIGrpc and return that as the return from this constructor.
104      #      #
105    
106      if ($ENV{FIG_URL} ne "" && $xmlrpc_available)      if ($ENV{FIG_URL} ne "" && $xmlrpc_available) {
107      {          Trace("Creating figrpc for '$ENV{FIG_URL}'") if T(0);
         print "Creating figrpc for '$ENV{FIG_URL}'\n";  
108          my $figrpc = new FIGrpc($ENV{FIG_URL});          my $figrpc = new FIGrpc($ENV{FIG_URL});
109          return $figrpc;          return $figrpc;
110      }      }
# Line 83  Line 115 
115          }, $class;          }, $class;
116  }  }
117    
118  sub get_system_name  
119  {  =head3 get_system_name
120    
121    C<< my $name = $fig->get_system_name; >>
122    
123    Returns C<seed>, indicating that this is object is using the SEED
124    database. The same method on an SFXlate object will return C<sprout>.
125    
126    =cut
127    #: Return Type $;
128    sub get_system_name {
129      return "seed";      return "seed";
130  }  }
131    
132    # Destructor: releases the database handle.
133    
134  sub DESTROY {  sub DESTROY {
135      my($self) = @_;      my($self) = @_;
136      my($rdbH);      my($rdbH);
137    
138      if ($rdbH = $self->db_handle)      if ($rdbH = $self->db_handle) {
     {  
139          $rdbH->DESTROY;          $rdbH->DESTROY;
140      }      }
141  }  }
142    
143    =head3 delete_genomes
144    
145    C<< $fig->delete_genomes(\@genomes); >>
146    
147    Delete the specified genomes from the data store. This requires making
148    system calls to move and delete files.
149    
150    =cut
151    #: Return Type ;
152  sub delete_genomes {  sub delete_genomes {
153      my($self,$genomes) = @_;      my($self,$genomes) = @_;
154      my $tmpD     = "$FIG_Config::temp/tmp.deleted.$$";      my $tmpD     = "$FIG_Config::temp/tmp.deleted.$$";
# Line 127  Line 177 
177      &run("rm -rf $FIG_Config::data.deleted");      &run("rm -rf $FIG_Config::data.deleted");
178  }  }
179    
180    =head3 add_genome
181    
182    C<< my $ok = $fig->add_genome($genomeF); >>
183    
184    Add a new genome to the data store. A genome's data is kept in a directory
185    by itself, underneath the main organism directory.
186    
187    =over 4
188    
189    =item genomeF
190    
191    Name of the directory containing the genome files.
192    
193    =item RETURN
194    
195    Returns TRUE if successful, else FALSE.
196    
197    =back
198    
199    =cut
200    #: Return Type $;
201  sub add_genome {  sub add_genome {
202      my($self,$genomeF) = @_;      my($self,$genomeF) = @_;
203    
# Line 185  Line 256 
256      return $rc;      return $rc;
257  }  }
258    
259  =pod  =head3 enqueue_similarities
   
 =head1 enqueue_similarities  
260    
261  usage: enqueue_similarities(\@sims)  usage: enqueue_similarities(\@sims)
262    
# Line 195  Line 264 
264  computation.  computation.
265    
266  =cut  =cut
267    #: Return Type ;
268  sub enqueue_similarities {  sub enqueue_similarities {
269      my($fids) = @_;      my($fids) = @_;
270      my $fid;      my $fid;
# Line 218  Line 288 
288      close(TMP);      close(TMP);
289  }  }
290    
291  =pod  =head3 create_sim_askfor_pool
   
 =head1 create_sim_askfor_pool  
292    
293  usage: create_sim_askfor_pool()  usage: create_sim_askfor_pool()
294    
# Line 238  Line 306 
306  initial status information.  initial status information.
307    
308  =cut  =cut
309    #: Return Type $;
310  sub create_sim_askfor_pool  sub create_sim_askfor_pool
311  {  {
312      my($self, $chunk_size) = @_;      my($self, $chunk_size) = @_;
# Line 404  Line 472 
472      return $cpool_id;      return $cpool_id;
473  }  }
474    
475  =pod  #=head3 get_sim_queue
476    #
477  =head1 get_sim_queue  #usage: get_sim_queue($pool_id, $all_sims)
478    #
479  usage: get_sim_queue($pool_id, $all_sims)  #Returns the sims in the given pool. If $all_sims is true, return the entire queue. Otherwise,
480    #just return the sims awaiting processing.
481  Returns the sims in the given pool. If $all_sims is true, return the entire queue. Otherwise,  #
482  just return the sims awaiting processing.  #=cut
   
 =cut  
483    
484  sub get_sim_queue  sub get_sim_queue
485  {  {
486      my($self, $pool_id, $all_sims) = @_;      my($self, $pool_id, $all_sims) = @_;
487  }  }
488    
489  =pod  =head3 get_active_sim_pools
   
 =head1 get_active_sim_pools  
490    
491  usage: get_active_sim_pools()  usage: get_active_sim_pools()
492    
# Line 430  Line 494 
494  computation.  computation.
495    
496  =cut  =cut
497    #: Return Type @;
498  sub get_active_sim_pools  sub get_active_sim_pools
499  {  {
500      my($self) = @_;      my($self) = @_;
# Line 443  Line 507 
507      return map { $_->[0] } @$res;      return map { $_->[0] } @$res;
508  }  }
509    
510  =pod  =head3 get_sim_pool_info
   
 =head1 get_sim_pool_info  
511    
512  usage: get_sim_pool_info($pool_id)  usage: get_sim_pool_info($pool_id)
513    
# Line 453  Line 515 
515  is a list ($total_entries, $n_finished, $n_assigned, $n_unassigned)  is a list ($total_entries, $n_finished, $n_assigned, $n_unassigned)
516    
517  =cut  =cut
518    #: Return Type @;
519  sub get_sim_pool_info  sub get_sim_pool_info
520  {  {
521      my($self, $pool_id) = @_;      my($self, $pool_id) = @_;
# Line 476  Line 538 
538      return ($total_entries, $n_finished, $n_assigned, $n_unassigned);      return ($total_entries, $n_finished, $n_assigned, $n_unassigned);
539  }  }
540    
541  =pod  #=head3 get_sim_chunk
542    #
543  =head1 get_sim_chunk  #usage: get_sim_chunk($n_seqs, $worker_id)
544    #
545  usage: get_sim_chunk($n_seqs, $worker_id)  #Returns a chunk of $n_seqs of work.
546    #
547  Returns a chunk of $n_seqs of work.  #From Ross, about how sims are processed:
548    #
549  From Ross, about how sims are processed:  #Here is how I process them:
550    #
551  Here is how I process them:  #
552    #    bash$ cd /Volumes/seed/olson/Sims/June22.out
553    #    bash$ for i in really*
554      bash$ cd /Volumes/seed/olson/Sims/June22.out  #    > do
555      bash$ for i in really*  #    > cat  < $i >> /Volumes/laptop/new.sims
556      > do  #    > done
557      > cat  < $i >> /Volumes/laptop/new.sims  #
558      > done  #
559    #Then, I need to "reformat" them by adding to columns to each one
560    # and split the result into files of about 3M each This I do using
561  Then, I need to "reformat" them by adding to columns to each one  #
562   and split the result into files of about 3M each This I do using  #reduce_sims /Volumes/laptop/NR/NewNR/peg.synonyms.june21  300 < /Volumes/laptop/new.sims |
563    #    reformat_sims /Volumes/laptop/NR/NewNR/checked.nr.june21   > /Volumes/laptop/reformated.sims
564  reduce_sims /Volumes/laptop/NR/NewNR/peg.synonyms.june21  300 < /Volumes/laptop/new.sims |  #rm /Volumes/laptop/new.sims
565      reformat_sims /Volumes/laptop/NR/NewNR/checked.nr.june21   > /Volumes/laptop/reformated.sims  #split_sims /Volumes/laptop/NewSims sims.june24  reformated.sims
566  rm /Volumes/laptop/new.sims  #rm reformatted.sims
567  split_sims /Volumes/laptop/NewSims sims.june24  reformated.sims  #
568  rm reformatted.sims  #=cut
   
569    
 =cut  
570  sub get_sim_chunk  sub get_sim_chunk
571  {  {
572      my($self, $n_seqs, $worker_id) = @_;      my($self, $n_seqs, $worker_id) = @_;
# Line 514  Line 574 
574    
575  }  }
576    
577    =head3 get_local_hostname
578    
579    
580    =cut
581    
582  sub get_local_hostname {  sub get_local_hostname {
583    
584      #      #

Legend:
Removed from v.1.209  
changed lines
  Added in v.1.210

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3