[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.96, Thu Sep 25 23:28: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 1156  Line 1156 
1156                  }                  }
1157                  # Create the HasProperty entry for this feature/property association.                  # Create the HasProperty entry for this feature/property association.
1158                  $loadHasProperty->Put($fid, $propertyID, $url);                  $loadHasProperty->Put($fid, $propertyID, $url);
1159                    $propertyCount++;
1160              }              }
1161              # Update the statistics.              # Update the statistics.
1162              Trace("$propertyCount attributes processed.") if T(3);              Trace("$propertyCount attributes processed.") if T(3);
# Line 2245  Line 2246 
2246      return $retVal;      return $retVal;
2247  }  }
2248    
2249    =head3 GetCommaList
2250    
2251        my $string = GetCommaList($value);
2252    
2253    Create a comma-separated list of the values in a list reference. If the
2254    list reference is a scalar, it will be returned unchanged. If it is
2255    undefined, an empty string will be returned. The idea is that we may be
2256    looking at a string, a list, or nothing, but whatever comes out will be a
2257    string.
2258    
2259    =over 4
2260    
2261    =item value
2262    
2263    Reference to a list of values to be assembled into the return string.
2264    
2265    =item RETURN
2266    
2267    Returns a scalar string containing the content of the input value.
2268    
2269    =back
2270    
2271    =cut
2272    
2273    sub GetCommaList {
2274        # Get the parameters.
2275        my ($value) = @_;
2276        # Declare the return variable.
2277        my $retVal = "";
2278        # Only proceed if we have an input value.
2279        if (defined $value) {
2280            # Analyze the input value.
2281            if (ref $value eq 'ARRAY') {
2282                # Here it's a list reference.
2283                $retVal = join(", ", @$value);
2284            } else {
2285                # Here it's not. Flatten it to a scalar.
2286                $retVal = "$value";
2287            }
2288        }
2289        # Return the result.
2290        return $retVal;
2291    }
2292    
2293    
2294  1;  1;

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3