[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.69, Fri Jun 23 01:34:42 2006 UTC revision 1.71, Sun Jun 25 00:07:22 2006 UTC
# Line 12  Line 12 
12      use DBObject;      use DBObject;
13      use Tracer;      use Tracer;
14      use FIGRules;      use FIGRules;
15        use FidCheck;
16      use Stats;      use Stats;
17      use POSIX qw(strftime);      use POSIX qw(strftime);
18    
# Line 388  Line 389 
389          my $counting = ($count == 1 ? "contig" : "contigs");          my $counting = ($count == 1 ? "contig" : "contigs");
390          # Build the option tag.          # Build the option tag.
391          $retVal .= "<option value=\"$genomeID\">$genus $species $strain ($genomeID) [$count $counting]</option>\n";          $retVal .= "<option value=\"$genomeID\">$genus $species $strain ($genomeID) [$count $counting]</option>\n";
392            Trace("Option tag built for $genomeID: $genus $species $strain.") if T(3);
393      }      }
394      # Close the SELECT tag.      # Close the SELECT tag.
395      $retVal .= "</select>\n";      $retVal .= "</select>\n";
# Line 2217  Line 2219 
2219      return @retVal;      return @retVal;
2220  }  }
2221    
 =head3 Exists  
   
 C<< my $found = $sprout->Exists($entityName, $entityID); >>  
   
 Return TRUE if an entity exists, else FALSE.  
   
 =over 4  
   
 =item entityName  
   
 Name of the entity type (e.g. C<Feature>) relevant to the existence check.  
   
 =item entityID  
   
 ID of the entity instance whose existence is to be checked.  
   
 =item RETURN  
   
 Returns TRUE if the entity instance exists, else FALSE.  
   
 =back  
   
 =cut  
 #: Return Type $;  
 sub Exists {  
     # Get the parameters.  
     my ($self, $entityName, $entityID) = @_;  
     # Check for the entity instance.  
     Trace("Checking existence of $entityName with ID=$entityID.") if T(4);  
     my $testInstance = $self->GetEntity($entityName, $entityID);  
     # Return an existence indicator.  
     my $retVal = ($testInstance ? 1 : 0);  
     return $retVal;  
 }  
   
2222  =head3 FeatureTranslation  =head3 FeatureTranslation
2223    
2224  C<< my $translation = $sprout->FeatureTranslation($featureID); >>  C<< my $translation = $sprout->FeatureTranslation($featureID); >>
# Line 2789  Line 2756 
2756      return @retVal;      return @retVal;
2757  }  }
2758    
   
   
2759  =head3 RelatedFeatures  =head3 RelatedFeatures
2760    
2761  C<< my @relatedList = $sprout->RelatedFeatures($featureID, $function, $userID); >>  C<< my @relatedList = $sprout->RelatedFeatures($featureID, $function, $userID); >>
# Line 3042  Line 3007 
3007      return %retVal;      return %retVal;
3008  }  }
3009    
3010    =head3 Sims
3011    
3012    C<< my $simList = $sprout->Sims($fid, $maxN, $maxP, $select, $max_expand, $filters); >>
3013    
3014    Get a list of similarities for a specified feature. Similarity information is not kept in the
3015    Sprout database; rather, they are retrieved from a network server. The similarities are
3016    returned as B<Sim> objects. A Sim object is actually a list reference that has been blessed
3017    so that its elements can be accessed by name.
3018    
3019    Similarities can be either raw or expanded. The raw similarities are basic
3020    hits between features with similar DNA. Expanding a raw similarity drags in any
3021    features considered substantially identical. So, for example, if features B<A1>,
3022    B<A2>, and B<A3> are all substatially identical to B<A>, then a raw similarity
3023    B<[C,A]> would be expanded to B<[C,A] [C,A1] [C,A2] [C,A3]>.
3024    
3025    =over 4
3026    
3027    =item fid
3028    
3029    ID of the feature whose similarities are desired.
3030    
3031    =item maxN
3032    
3033    Maximum number of similarities to return.
3034    
3035    =item maxP
3036    
3037    Minumum allowable similarity score.
3038    
3039    =item select
3040    
3041    Selection criterion: C<raw> means only raw similarities are returned; C<fig>
3042    means only similarities to FIG features are returned; C<all> means all expanded
3043    similarities are returned; and C<figx> means similarities are expanded until the
3044    number of FIG features equals the maximum.
3045    
3046    =item max_expand
3047    
3048    The maximum number of features to expand.
3049    
3050    =item filters
3051    
3052    Reference to a hash containing filter information, or a subroutine that can be
3053    used to filter the sims.
3054    
3055    =item RETURN
3056    
3057    Returns a reference to a list of similarity objects, or C<undef> if an error
3058    occurred.
3059    
3060    =back
3061    
3062    =cut
3063    
3064    sub Sims {
3065        # Get the parameters.
3066        my ($self, $fid, $maxN, $maxP, $select, $max_expand, $filters) = @_;
3067        # Create the shim object to test for deleted FIDs.
3068        my $shim = FidCheck->new($self);
3069        # Ask the network for sims.
3070        my $retVal = FIGRules::GetNetworkSims($shim, $fid, {}, $maxN, $maxP, $select, $max_expand, $filters);
3071        # Return the result.
3072        return $retVal;
3073    }
3074    
3075  =head3 GetGroups  =head3 GetGroups
3076    
3077  C<< my %groups = $sprout->GetGroups(\@groupList); >>  C<< my %groups = $sprout->GetGroups(\@groupList); >>

Legend:
Removed from v.1.69  
changed lines
  Added in v.1.71

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3