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

Diff of /Sprout/Sapling.pm

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

revision 1.27, Wed Dec 16 01:45:19 2009 UTC revision 1.28, Thu Dec 24 16:45:02 2009 UTC
# Line 304  Line 304 
304  }  }
305    
306    
307    =head3 IsProteinID
308    
309        my $md5 = $sap->IsProteinID($identifier);
310    
311    Check for a protein identifier. If a protein identifier is found, the
312    corresponding protein sequence ID will be returned; otherwise, an
313    undefined value will be returned. A protein identifier is either a
314    raw protein sequence ID, an ID preceded by C<md5|>, or an ID preceded by
315    C<gnl|md5|>
316    
317    =over 4
318    
319    =item identifier
320    
321    Identifier to test.
322    
323    =item RETURN
324    
325    Returns the MD5 code from the protein identifier, or C<undef> if the incoming
326    string is not a protein identifier.
327    
328    =back
329    
330    =cut
331    
332    sub IsProteinID {
333        # Get the parameters.
334        my ($self, $identifier) = @_;
335        # Declare the return variable.
336        my $retVal;
337        # Check the input.
338        if ($identifier =~ /^(?:gnl\|)?(?:md5\|)?([0-9a-f]{32})$/) {
339            $retVal = $1;
340        }
341        # Return the result.
342        return $retVal;
343    }
344    
345    
346  =head3 Assignment  =head3 Assignment
347    
348      my $assignment = $sapling->Assignment($fid);      my $assignment = $sapling->Assignment($fid);

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3