[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.54, Thu Feb 16 04:10:07 2006 UTC revision 1.57, Sat May 13 03:10:15 2006 UTC
# Line 62  Line 62 
62    
63  * B<xmlFileName> name of the XML file containing the database definition (default C<SproutDBD.xml>)  * B<xmlFileName> name of the XML file containing the database definition (default C<SproutDBD.xml>)
64    
65  * B<userData> user name and password, delimited by a slash (default C<root/>)  * B<userData> user name and password, delimited by a slash (default same as SEED)
66    
67  * B<port> connection port (default C<0>)  * B<port> connection port (default C<0>)
68    
69    * B<sock> connection socket (default same as SEED)
70    
71  * B<maxSegmentLength> maximum number of residues per feature segment, (default C<4500>)  * B<maxSegmentLength> maximum number of residues per feature segment, (default C<4500>)
72    
73  * B<maxSequenceLength> maximum number of residues per sequence, (default C<8000>)  * B<maxSequenceLength> maximum number of residues per sequence, (default C<8000>)
# Line 98  Line 100 
100                                                          # user name and password                                                          # user name and password
101                         port         => $FIG_Config::dbport,                         port         => $FIG_Config::dbport,
102                                                          # database connection port                                                          # database connection port
103                           sock         => $FIG_Config::dbsock,
104                         maxSegmentLength => 4500,        # maximum feature segment length                         maxSegmentLength => 4500,        # maximum feature segment length
105                         maxSequenceLength => 8000,       # maximum contig sequence length                         maxSequenceLength => 8000,       # maximum contig sequence length
106                         noDBOpen     => 0,               # 1 to suppress the database open                         noDBOpen     => 0,               # 1 to suppress the database open
# Line 111  Line 114 
114      my $dbh;      my $dbh;
115      if (! $optionTable->{noDBOpen}) {      if (! $optionTable->{noDBOpen}) {
116          $dbh = DBKernel->new($optionTable->{dbType}, $dbName, $userName,          $dbh = DBKernel->new($optionTable->{dbType}, $dbName, $userName,
117                                  $password, $optionTable->{port});                                  $password, $optionTable->{port}, undef, $optionTable->{sock});
118      }      }
119      # Create the ERDB object.      # Create the ERDB object.
120      my $xmlFileName = "$optionTable->{xmlFileName}";      my $xmlFileName = "$optionTable->{xmlFileName}";
# Line 740  Line 743 
743  should be of the form returned by L</featureLocation> when in a list context. In other words,  should be of the form returned by L</featureLocation> when in a list context. In other words,
744  each location is of the form I<contigID>C<_>I<begin>I<dir>I<end>.  each location is of the form I<contigID>C<_>I<begin>I<dir>I<end>.
745    
746    For example, the following would return the DNA sequence for contig C<83333.1:NC_000913>
747    between positions 1401 and 1532, inclusive.
748    
749        my $sequence = $sprout->DNASeq('83333.1:NC_000913_1401_1532');
750    
751  =over 4  =over 4
752    
753  =item locationList  =item locationList
754    
755  List of location specifiers, each in the form I<contigID>C<_>I<begin>I<dir>I<end> (see  List of location specifiers, each in the form I<contigID>C<_>I<begin>I<dir>I<len> or
756  L</FeatureLocation> for more about this format).  I<contigID>C<_>I<begin>C<_>I<end> (see L</FeatureLocation> for more about this format).
757    
758  =item RETURN  =item RETURN
759    
# Line 1522  Line 1530 
1530    
1531  C<< my $genomeID = $sprout->GenomeOf($featureID); >>  C<< my $genomeID = $sprout->GenomeOf($featureID); >>
1532    
1533  Return the genome that contains a specified feature.  Return the genome that contains a specified feature or contig.
1534    
1535  =over 4  =over 4
1536    
1537  =item featureID  =item featureID
1538    
1539  ID of the feature whose genome is desired.  ID of the feature or contig whose genome is desired.
1540    
1541  =item RETURN  =item RETURN
1542    
1543  Returns the ID of the genome for the specified feature. If the feature is not found, returns  Returns the ID of the genome for the specified feature or contig. If the feature or contig is not
1544  an undefined value.  found, returns an undefined value.
1545    
1546  =back  =back
1547    
# Line 1542  Line 1550 
1550  sub GenomeOf {  sub GenomeOf {
1551      # Get the parameters.      # Get the parameters.
1552      my ($self, $featureID) = @_;      my ($self, $featureID) = @_;
1553      # Create a query to find the genome associated with the feature.      # Create a query to find the genome associated with the incoming ID.
1554      my $query = $self->Get(['IsLocatedIn', 'HasContig'], "IsLocatedIn(from-link) = ?", [$featureID]);      my $query = $self->Get(['IsLocatedIn', 'HasContig'], "IsLocatedIn(from-link) = ? OR HasContig(to-link) = ?",
1555                               [$featureID, $featureID]);
1556      # Declare the return value.      # Declare the return value.
1557      my $retVal;      my $retVal;
1558      # Get the genome ID.      # Get the genome ID.
# Line 2730  Line 2739 
2739      return @retVal;      return @retVal;
2740  }  }
2741    
2742    
2743    
2744  =head3 RelatedFeatures  =head3 RelatedFeatures
2745    
2746  C<< my @relatedList = $sprout->RelatedFeatures($featureID, $function, $userID); >>  C<< my @relatedList = $sprout->RelatedFeatures($featureID, $function, $userID); >>

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.57

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3