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

Diff of /Sprout/SproutLoad.pm

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

revision 1.94, Tue Sep 16 18:42:40 2008 UTC revision 1.95, Sat Sep 20 14:33:28 2008 UTC
# Line 657  Line 657 
657                      if (exists $attributeHash{Phobius}) {                      if (exists $attributeHash{Phobius}) {
658                          # This will be a hash of two keys (transmembrane and signal) to                          # This will be a hash of two keys (transmembrane and signal) to
659                          # location strings. If there's no value, we stuff in an empty string.                          # location strings. If there's no value, we stuff in an empty string.
660                          $signalList = ($attributeHash{Phobius}->{signal} || "");                          $signalList = GetCommaList($attributeHash{Phobius}->{signal});
661                          $transList = ($attributeHash{Phobius}->{transmembrane} || "");                          $transList = GetCommaList($attributeHash{Phobius}->{transmembrane});
662                      }                      }
663                      # Here are some more numbers: isoelectric point, molecular weight, and                      # Here are some more numbers: isoelectric point, molecular weight, and
664                      # the similar-to-human flag.                      # the similar-to-human flag.
# Line 2245  Line 2245 
2245      return $retVal;      return $retVal;
2246  }  }
2247    
2248    =head3 GetCommaList
2249    
2250        my $string = GetCommaList($value);
2251    
2252    Create a comma-separated list of the values in a list reference. If the
2253    list reference is a scalar, it will be returned unchanged. If it is
2254    undefined, an empty string will be returned. The idea is that we may be
2255    looking at a string, a list, or nothing, but whatever comes out will be a
2256    string.
2257    
2258    =over 4
2259    
2260    =item value
2261    
2262    Reference to a list of values to be assembled into the return string.
2263    
2264    =item RETURN
2265    
2266    Returns a scalar string containing the content of the input value.
2267    
2268    =back
2269    
2270    =cut
2271    
2272    sub GetCommaList {
2273        # Get the parameters.
2274        my ($value) = @_;
2275        # Declare the return variable.
2276        my $retVal = "";
2277        # Only proceed if we have an input value.
2278        if (defined $value) {
2279            # Analyze the input value.
2280            if (ref $value eq 'ARRAY') {
2281                # Here it's a list reference.
2282                $retVal = join(", ", @$value);
2283            } else {
2284                # Here it's not. Flatten it to a scalar.
2285                $retVal = "$value";
2286            }
2287        }
2288        # Return the result.
2289        return $retVal;
2290    }
2291    
2292    
2293  1;  1;

Legend:
Removed from v.1.94  
changed lines
  Added in v.1.95

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3