126 |
if (! defined $subsysFile || $subsysFile eq '') { |
if (! defined $subsysFile || $subsysFile eq '') { |
127 |
# Here we want all the subsystems. |
# Here we want all the subsystems. |
128 |
%subsystems = map { $_ => 1 } $fig->all_subsystems(); |
%subsystems = map { $_ => 1 } $fig->all_subsystems(); |
129 |
} elsif (ref $subsysFile eq 'ARRAY') { |
} else { |
130 |
|
my $type = ref $subsysFile; |
131 |
|
if ($type eq 'ARRAY') { |
132 |
# Here the user passed in a list of subsystems. |
# Here the user passed in a list of subsystems. |
133 |
%subsystems = map { $_ => 1 } @{$subsysFile}; |
%subsystems = map { $_ => 1 } @{$subsysFile}; |
134 |
} elsif (ref $subsysFile eq 'SCALAR') { |
} elsif (! $type || $type eq 'SCALAR') { |
135 |
# Here the list of subsystems is in a file. |
# Here the list of subsystems is in a file. |
136 |
if (! -e $subsysFile) { |
if (! -e $subsysFile) { |
137 |
# It's an error if the file does not exist. |
# It's an error if the file does not exist. |
144 |
} else { |
} else { |
145 |
Confess("Invalid subsystem parameter in SproutLoad constructor."); |
Confess("Invalid subsystem parameter in SproutLoad constructor."); |
146 |
} |
} |
147 |
|
} |
148 |
# Get the data directory from the Sprout object. |
# Get the data directory from the Sprout object. |
149 |
my ($directory) = $sprout->LoadInfo(); |
my ($directory) = $sprout->LoadInfo(); |
150 |
# Create the Sprout load object. |
# Create the Sprout load object. |
222 |
# Get the genus, species, and strain from the scientific name. Note that we append |
# Get the genus, species, and strain from the scientific name. Note that we append |
223 |
# the genome ID to the strain. In some cases this is the totality of the strain name. |
# the genome ID to the strain. In some cases this is the totality of the strain name. |
224 |
my ($genus, $species, @extraData) = split / /, $self->{fig}->genus_species($genomeID); |
my ($genus, $species, @extraData) = split / /, $self->{fig}->genus_species($genomeID); |
225 |
my $extra = join " ", @extraData, "[genomeID]"; |
my $extra = join " ", @extraData, "[$genomeID]"; |
226 |
# Get the full taxonomy. |
# Get the full taxonomy. |
227 |
my $taxonomy = $fig->taxonomy_of($genomeID); |
my $taxonomy = $fig->taxonomy_of($genomeID); |
228 |
# Output the genome record. |
# Output the genome record. |
433 |
# Split the tuple. |
# Split the tuple. |
434 |
my ($featureID, $locations, $aliases, $type) = @{$featureData}; |
my ($featureID, $locations, $aliases, $type) = @{$featureData}; |
435 |
# Create the feature record. |
# Create the feature record. |
436 |
$loadFeature->Put($featureID, 1, $type); |
$loadFeature->Put("$genomeID:$featureID", 1, $type); |
437 |
# Create the aliases. |
# Create the aliases. |
438 |
for my $alias (split /\s*,\s*/, $aliases) { |
for my $alias (split /\s*,\s*/, $aliases) { |
439 |
$loadFeatureAlias->Put($featureID, $alias); |
$loadFeatureAlias->Put($featureID, $alias); |