[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.55, Wed Mar 31 11:14:47 2004 UTC revision 1.56, Wed Mar 31 16:32:22 2004 UTC
# Line 2898  Line 2898 
2898      my($relational_db_response,$entry,$fid,$fileno,$seek,$len,$ann);      my($relational_db_response,$entry,$fid,$fileno,$seek,$len,$ann);
2899      my($epoch_date,$when,%sofar,$x);      my($epoch_date,$when,%sofar,$x);
2900    
2901        if (! defined($genomes)) { $genomes = [$self->genomes] }
2902    
2903      my %genomes = map { $_ => 1 } @$genomes;      my %genomes = map { $_ => 1 } @$genomes;
2904      if ($date =~ /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/)      if ($date =~ /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/)
2905      {      {
# Line 2945  Line 2947 
2947      return @assignments;      return @assignments;
2948  }  }
2949    
2950    sub annotations_made {
2951        my($self,$genomes,$who,$date) = @_;
2952        my($relational_db_response,$entry,$fid,$fileno,$seek,$len,$ann);
2953        my($epoch_date,$when,@annotations);
2954    
2955        if (! defined($genomes)) { $genomes = [$self->genomes] }
2956    
2957        my %genomes = map { $_ => 1 } @$genomes;
2958        if ($date =~ /^(\d{1,2})\/(\d{1,2})\/(\d{4})$/)
2959        {
2960            my($mm,$dd,$yyyy) = ($1,$2,$3);
2961            $epoch_date = &Time::Local::timelocal(0,0,0,$dd,$mm-1,$yyyy-1900,0,0,0);
2962        }
2963        else
2964        {
2965            $epoch_date = 0;
2966        }
2967        $epoch_date = defined($epoch_date) ? $epoch_date-1 : 0;
2968        my @annotations = ();
2969        my $rdbH = $self->db_handle;
2970        if ($who eq "master")
2971        {
2972            $relational_db_response = $rdbH->SQL("SELECT fid, dateof, fileno, seek, len  FROM annotation_seeks WHERE ((ma = \'1\') AND (dateof > $epoch_date))");
2973        }
2974        else
2975        {
2976            $relational_db_response = $rdbH->SQL("SELECT fid, dateof, fileno, seek, len  FROM annotation_seeks WHERE (( who = \'$who\' ) AND (dateof > $epoch_date))");
2977        }
2978    
2979        if ($relational_db_response && (@$relational_db_response > 0))
2980        {
2981            foreach $entry (@$relational_db_response)
2982            {
2983                ($fid,$when,$fileno,$seek,$len) = @$entry;
2984                if (($fid =~ /^fig\|(\d+\.\d+)/) && $genomes{$1})
2985                {
2986                    $ann = $self->read_annotation($fileno,$seek,$len);
2987    
2988                    if (($ann =~ /^(fig\|\d+\.\d+\.peg\.\d+)\n(\d+)\n(\S+)\n(.*\S)/s) &&
2989                        (($who eq $3) || (($4 eq "master ") && ($who eq "master"))) &&
2990                        ($2 >= $epoch_date))
2991                    {
2992                        push(@annotations,[$1,$2,$3,$4]);
2993                    }
2994                }
2995            }
2996        }
2997        return @annotations;
2998    }
2999    
3000  ################################# Indexing Features and Functional Roles  ####################################  ################################# Indexing Features and Functional Roles  ####################################
3001    
3002  =pod  =pod

Legend:
Removed from v.1.55  
changed lines
  Added in v.1.56

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3