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

Diff of /FigKernelPackages/ANNO.pm

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

revision 1.6, Wed Aug 25 15:49:01 2010 UTC revision 1.7, Thu Sep 30 17:10:49 2010 UTC
# Line 204  Line 204 
204  =item RETURN  =item RETURN
205    
206  Returns a hash mapping each incoming ID to a list of hit regions. Each hit  Returns a hash mapping each incoming ID to a list of hit regions. Each hit
207  region is a 5-tuple consisting of (0) the number of matches to the function, (1) the  region is a n-tuple consisting of (0) the number of matches to the function, (1) the
208  start location, (2) the stop location, (3) the proposed function, and (4) the name  start location, (2) the stop location, (3) the proposed function, (4) the name
209  of the Genome Set from which the gene is likely to have originated.  of the Genome Set from which the gene is likely to have originated, (5) the ID
210    number of the OTU (or C<undef> if the OTU was not found), and (6) the IDs of the
211    roles represented in the function, if any of them have IDs.
212    
213    
214  =back  =back
215    
# Line 224  Line 227 
227      my $kmer = $args->{-kmer};      my $kmer = $args->{-kmer};
228      # Declare the return variable.      # Declare the return variable.
229      my $retVal = {};      my $retVal = {};
230        # Get the sapling database.
231        my $sap = $self->{db};
232      # Get the sequence tuples.      # Get the sequence tuples.
233      my $seqs = ServerThing::GetIdList(-seqs => $args);      my $seqs = ServerThing::GetIdList(-seqs => $args);
234      # Loop through the sequences, finding assignments.      # Loop through the sequences, finding assignments.
# Line 233  Line 238 
238          # Compute the assignment.          # Compute the assignment.
239          my $assignment = $kmers->assign_functions_to_PEGs_in_DNA($kmer, $seq,          my $assignment = $kmers->assign_functions_to_PEGs_in_DNA($kmer, $seq,
240                                                                   $minHits, $maxGap);                                                                   $minHits, $maxGap);
241            # Loop through the assignments, adding the function and OTU IDs.
242            for my $tuple (@$assignment) {
243                # Extract the function and OTU.
244                my $function = $tuple->[3];
245                my $otu = $tuple->[4];
246                # Get the IDs for the roles (if any).
247                my @roleIdx;
248                if ($function) {
249                    # We have a function, so split it into roles.
250                    my @roles = roles_of_function($function);
251                    # Accumulate the IDs for the roles found.
252                    for my $role (@roles) {
253                        push @roleIdx, $sap->GetEntityValues(Role => $role, ['role-index']);
254                    }
255                }
256                # Get the ID for the OTU (if any).
257                my $otuIdx;
258                if ($otu) {
259                    ($otuIdx) = $sap->GetFlat("Genome IsCollectedInto",
260                                'Genome(scientific-name) = ?', [$otu],
261                                'IsCollectedInto(to-link)');
262                }
263                # Update the tuple.
264                splice @$tuple, 5, undef, $otuIdx, @roleIdx;
265            }
266          # Store the result.          # Store the result.
267          $retVal->{$id} = $assignment;          $retVal->{$id} = $assignment;
268      }      }

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3