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

Diff of /Sprout/LoaderUtils.pm

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

revision 1.2, Mon Feb 1 20:14:28 2010 UTC revision 1.3, Mon Jan 24 03:52:18 2011 UTC
# Line 75  Line 75 
75      return $retVal;      return $retVal;
76  }  }
77    
 =head3 RolesForLoading  
   
     my ($roles, $errors) = RolesForLoading($function);  
   
 Split a functional assignment into roles. If the functional assignment  
 seems suspicious, it will be flagged as invalid. A count will be returned  
 of the number of roles that are rejected because they are too long.  
   
 =over 4  
   
 =item function  
   
 Functional assignment to parse.  
   
 =item RETURN  
   
 Returns a two-element list. The first is either a reference to a list of  
 roles, or an undefined value (indicating a suspicious functional assignment).  
 The second is the number of roles that are rejected for being too long.  
   
 =back  
   
 =cut  
   
 sub RolesForLoading {  
     # Get the parameters.  
     my ($function) = @_;  
     # Declare the return variables.  
     my ($roles, $errors) = (undef, 0);  
     # Only proceed if there are no suspicious elements in the functional assignment.  
     if (! ($function =~ /\b(?:similarit|blast\b|fasta|identity)|%|E=/i)) {  
         # Initialize the return list.  
         $roles = [];  
         # Split the function into roles.  
         my @roles = roles_of_function($function);  
         # Keep only the good roles.  
         for my $role (@roles) {  
             if (length($role) > 250) {  
                 $errors++;  
             } else {  
                 push @$roles, $role;  
             }  
         }  
     }  
     # Return the results.  
     return ($roles, $errors);  
 }  
   
   
78    
79  1;  1;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3