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

Diff of /FigKernelPackages/NRTools.pm

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

revision 1.1, Wed Jun 13 22:11:20 2007 UTC revision 1.2, Wed Sep 5 21:01:22 2007 UTC
# Line 4  Line 4 
4    
5  package NRTools;  package NRTools;
6    
7    use strict;
8    
9  use base qw(Exporter);  use base qw(Exporter);
10  use vars qw(@EXPORT);  use vars qw(@EXPORT);
11    
12  @EXPORT = qw(scan_NR_dir scan_seed_dir);  eval {
13        require Job48;
14        import Job48;
15    };
16    
17    @EXPORT = qw(scan_NR_dir scan_seed_dir scan_rast_jobs);
18    
19    
20  =head3 scan_NR_dir()  =head3 scan_NR_dir()
# Line 21  Line 28 
28    
29  sub scan_NR_dir  sub scan_NR_dir
30  {  {
31      my($nr_hash, $dir) = @_;      my($nr_hash, $dir, $options) = @_;
32    
33      my $dh = new DirHandle($dir);      my $dh = new DirHandle($dir);
34      while (defined($_ = $dh->read()))      while (defined($_ = $dh->read()))
35      {      {
36          next if /^\./;          next if /^\./;
37            next if $options->{skip} and /$options->{skip}/;
38          my $path = "$dir/$_";          my $path = "$dir/$_";
39          my $fasta = "$path/fasta";          my $fasta = "$path/fasta";
40          if (-f $fasta)          if (-f $fasta)
# Line 89  Line 97 
97      $dh->close();      $dh->close();
98  }  }
99    
100    =head3 scan_seed_dir()
101    
102    usage: @jobs = scan_rast_jobs($dir)
103    
104    Scan the given RAST job directory, finding all completed jobs that are marked
105    with submit.seed == 1.
106    
107    =cut
108    
109    sub scan_rast_jobs
110    {
111        my($jobs, $dir) = @_;
112    
113        my $dh = new DirHandle($dir);
114    
115        while (defined($_ = $dh->read()))
116        {
117            next unless /^\d+$/;
118    
119            my $job = Job48->new("$dir/$_");
120            next unless $job;
121            next unless $job->meta->get_metadata("status.final") eq  "complete";
122            next unless $job->meta->get_metadata("submit.seed") == 1;
123    
124            push(@$jobs, $job);
125        }
126    }
127    
128  1;  1;
129    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3