[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.19, Sun Aug 14 23:32:08 2005 UTC revision 1.21, Fri Sep 9 20:40:41 2005 UTC
# Line 576  Line 576 
576  =item RETURN  =item RETURN
577    
578  Returns a list of the feature's contig segments. The locations are returned as a list in a list  Returns a list of the feature's contig segments. The locations are returned as a list in a list
579  context and as a space-delimited string in a scalar context.  context and as a comma-delimited string in a scalar context.
580    
581  =back  =back
582    
# Line 619  Line 619 
619          push @retVal, "${contigID}_$beg$dir$len";          push @retVal, "${contigID}_$beg$dir$len";
620      }      }
621      # Return the list in the format indicated by the context.      # Return the list in the format indicated by the context.
622      return (wantarray ? @retVal : join(' ', @retVal));      return (wantarray ? @retVal : join(',', @retVal));
623  }  }
624    
625  =head3 ParseLocation  =head3 ParseLocation
# Line 1521  Line 1521 
1521          # Determine the ordering to place on the evidence items. If we're          # Determine the ordering to place on the evidence items. If we're
1522          # inverted, we want to see feature 2 before feature 1 (descending); otherwise,          # inverted, we want to see feature 2 before feature 1 (descending); otherwise,
1523          # we want feature 1 before feature 2 (normal).          # we want feature 1 before feature 2 (normal).
1524            Trace("Coupling evidence for ($peg1, $peg2) with inversion flag $inverted.") if T(Coupling => 4);
1525          my $ordering = ($inverted ? "DESC" : "");          my $ordering = ($inverted ? "DESC" : "");
1526          # Get the coupling evidence.          # Get the coupling evidence.
1527          my @evidenceList = $self->GetAll(['IsEvidencedBy', 'PCH', 'UsesAsEvidence'],          my @evidenceList = $self->GetAll(['IsEvidencedBy', 'PCH', 'UsesAsEvidence'],
# Line 1534  Line 1535 
1535          while (@evidenceList > 0) {          while (@evidenceList > 0) {
1536              my $peg1Data = shift @evidenceList;              my $peg1Data = shift @evidenceList;
1537              my $peg2Data = shift @evidenceList;              my $peg2Data = shift @evidenceList;
1538                Trace("Peg 1 is " . $peg1Data->[1] . " and Peg 2 is " . $peg2Data->[1] . ".") if T(Coupling => 4);
1539              push @retVal, [$peg1Data->[1], $peg2Data->[1], $peg1Data->[0]];              push @retVal, [$peg1Data->[1], $peg2Data->[1], $peg1Data->[0]];
1540          }          }
1541      }      }
# Line 2503  Line 2505 
2505  C<< my %subsystems = $sprout->SubsystemsOf($featureID); >>  C<< my %subsystems = $sprout->SubsystemsOf($featureID); >>
2506    
2507  Return a hash describing all the subsystems in which a feature participates. Each subsystem is mapped  Return a hash describing all the subsystems in which a feature participates. Each subsystem is mapped
2508  to the role the feature performs.  to the roles the feature performs.
2509    
2510  =over 4  =over 4
2511    
# Line 2513  Line 2515 
2515    
2516  =item RETURN  =item RETURN
2517    
2518  Returns a hash mapping all the feature's subsystems to the feature's role.  Returns a hash mapping all the feature's subsystems to a list of the feature's roles.
2519    
2520  =back  =back
2521    
2522  =cut  =cut
2523  #: Return Type %;  #: Return Type %@;
2524  sub SubsystemsOf {  sub SubsystemsOf {
2525      # Get the parameters.      # Get the parameters.
2526      my ($self, $featureID) = @_;      my ($self, $featureID) = @_;
# Line 2530  Line 2532 
2532      my %retVal = ();      my %retVal = ();
2533      # Loop through the results, adding them to the hash.      # Loop through the results, adding them to the hash.
2534      for my $record (@subsystems) {      for my $record (@subsystems) {
2535          $retVal{$record->[0]} = $record->[1];          my ($subsys, $role) = @{$record};
2536            if (exists $retVal{$subsys}) {
2537                push @{$retVal{$subsys}}, $role;
2538            } else {
2539                $retVal{$subsys} = [$role];
2540            }
2541      }      }
2542      # Return the hash.      # Return the hash.
2543      return %retVal;      return %retVal;

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.21

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3