[Bio] / Sprout / Sprout.pm Repository:
ViewVC logotype

Diff of /Sprout/Sprout.pm

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

revision 1.13, Thu May 5 03:14:03 2005 UTC revision 1.14, Thu Jun 9 19:06:55 2005 UTC
# Line 1349  Line 1349 
1349  sub CoupledFeatures {  sub CoupledFeatures {
1350          # Get the parameters.          # Get the parameters.
1351          my ($self, $featureID) = @_;          my ($self, $featureID) = @_;
1352          # Create a query to retrieve the functionally-coupled features. Note that we depend on the          # Create a query to retrieve the functionally-coupled features.
1353          # fact that the functional coupling is physically paired. If (A,B) is in the database, then          my $query = $self->Get(['ParticipatesInCoupling', 'Coupling'],
1354          # (B,A) will also be found.                                                     "ParticipatesInCoupling(from-link) = ?", [$featureID]);
         my $query = $self->Get(['IsClusteredOnChromosomeWith'],  
                                                    "IsClusteredOnChromosomeWith(from-link) = ?", [$featureID]);  
1355          # This value will be set to TRUE if we find at least one coupled feature.          # This value will be set to TRUE if we find at least one coupled feature.
1356          my $found = 0;          my $found = 0;
1357          # Create the return hash.          # Create the return hash.
1358          my %retVal = ();          my %retVal = ();
1359          # Retrieve the relationship records and store them in the hash.          # Retrieve the relationship records and store them in the hash.
1360          while (my $clustering = $query->Fetch()) {          while (my $clustering = $query->Fetch()) {
1361                  my ($otherFeatureID, $score) = $clustering->Values(['IsClusteredOnChromosomeWith(to-link)',                  # Get the ID and score of the coupling.
1362                                                                      'IsClusteredOnChromosomeWith(score)']);                  my ($couplingID, $score) = $clustering->Values(['Coupling(id)',
1363                                                                                    'Coupling(score)']);
1364                    # The coupling ID contains the two feature IDs separated by a space. We use
1365                    # this information to find the ID of the other feature.
1366                    my ($fid1, $fid2) = split / /, $couplingID;
1367                    my $otherFeatureID = ($featureID eq $fid1 ? $fid2 : $fid1);
1368                    # Attach the other feature's score to its ID.
1369                  $retVal{$otherFeatureID} = $score;                  $retVal{$otherFeatureID} = $score;
1370                  $found = 1;                  $found = 1;
1371          }          }

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3