[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.16, Sat Jan 3 06:03:43 2004 UTC revision 1.17, Sat Jan 3 14:13:48 2004 UTC
# Line 2726  Line 2726 
2726          my $file = "$FIG_Config::organisms/$genome/annotations";          my $file = "$FIG_Config::organisms/$genome/annotations";
2727          my $fileno = $self->file2N($file);          my $fileno = $self->file2N($file);
2728          my $time_made = time;          my $time_made = time;
2729            my $ma   = ($annotation =~ /^Set master function to/);
2730    
2731    
2732          if (open(TMP,">>$file"))          if (open(TMP,">>$file"))
2733          {          {
# Line 2739  Line 2741 
2741              chmod 0777, $file;              chmod 0777, $file;
2742              my $ln = $seek2 - $seek1;              my $ln = $seek2 - $seek1;
2743              my $rdbH = $self->db_handle;              my $rdbH = $self->db_handle;
2744              if ($rdbH->SQL("INSERT INTO annotation_seeks ( fid, dateof, who, fileno, seek, len ) VALUES ( \'$feature_id\', $time_made, \'$user\', $fileno, $seek1, $ln )"))              if ($rdbH->SQL("INSERT INTO annotation_seeks ( fid, dateof, who, ma, fileno, seek, len ) VALUES ( \'$feature_id\', $time_made, \'$user\', \'$ma\', $fileno, $seek1, $ln )"))
2745              {              {
2746                  return 1;                  return 1;
2747              }              }
# Line 2803  Line 2805 
2805      return $readC;      return $readC;
2806  }  }
2807    
2808    sub assignments_made {
2809        my($self,$genomes,$who,$date) = @_;
2810        my($relational_db_response,$entry,$fid,$fileno,$seek,$len,$ann);
2811    
2812        my %genomes = map { $_ => 1 } @$genomes;
2813        $date = defined($date) ? $date-1 : 0;
2814        my @assignments = ();
2815        my $rdbH = $self->db_handle;
2816        if ($who eq "master")
2817        {
2818            $relational_db_response = $rdbH->SQL("SELECT fid, fileno, seek, len  FROM annotation_seeks WHERE ((ma = \'1\') AND (dateof > $date))");
2819        }
2820        else
2821        {
2822            $relational_db_response = $rdbH->SQL("SELECT fid, fileno, seek, len  FROM annotation_seeks WHERE (( who = \'$who\' ) AND (dateof > $date))");
2823        }
2824    
2825        if ($relational_db_response && (@$relational_db_response > 0))
2826        {
2827            foreach $entry (@$relational_db_response)
2828            {
2829                ($fid,$fileno,$seek,$len) = @$entry;
2830                if (($fid =~ /^fig\|(\d+\.\d+)/) && $genomes{$1})
2831                {
2832                    $ann = $self->read_annotation($fileno,$seek,$len);
2833    
2834                    if (($ann =~ /^(fig\|\d+\.\d+\.peg\.\d+)\n(\d+)\n(\S+)\nSet ([^\n]*)function[^\n]*\n(\S[^\n]+\S)/s) &&
2835                        (($who eq $3) || (($4 eq "master ") && ($who eq "master"))) &&
2836                        ($2 >= $date))
2837                    {
2838                        push(@assignments,[$1,$5]);
2839                    }
2840                }
2841            }
2842        }
2843        return @assignments;
2844    }
2845    
2846  ################################# Indexing Features and Functional Roles  ####################################  ################################# Indexing Features and Functional Roles  ####################################
2847    
2848  =pod  =pod

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3