132 |
# Load the list of trusted subsystems. |
# Load the list of trusted subsystems. |
133 |
my %subsystems = (); |
my %subsystems = (); |
134 |
if (! defined $subsysFile || $subsysFile eq '') { |
if (! defined $subsysFile || $subsysFile eq '') { |
135 |
# Here we want all the subsystems. |
# Here we want all the NMPDR subsystems. First we get the whole list. |
136 |
%subsystems = map { $_ => 1 } $fig->all_subsystems(); |
my @subs = $fig->all_subsystems(); |
137 |
|
# Loop through, checking for the NMPDR file. |
138 |
|
for my $sub (@subs) { |
139 |
|
if (-e "$FIG_Config::data/Subsystems/$sub/NMPDR") { |
140 |
|
$subsystems{$sub} = 1; |
141 |
|
} |
142 |
|
} |
143 |
} else { |
} else { |
144 |
my $type = ref $subsysFile; |
my $type = ref $subsysFile; |
145 |
if ($type eq 'ARRAY') { |
if ($type eq 'ARRAY') { |
256 |
$loadGenome->Add("genomeIn"); |
$loadGenome->Add("genomeIn"); |
257 |
# The access code comes in via the genome hash. |
# The access code comes in via the genome hash. |
258 |
my $accessCode = $genomeHash->{$genomeID}; |
my $accessCode = $genomeHash->{$genomeID}; |
259 |
# Get the genus, species, and strain from the scientific name. Note that we append |
# Get the genus, species, and strain from the scientific name. |
|
# the genome ID to the strain. In some cases this is the totality of the strain name. |
|
260 |
my ($genus, $species, @extraData) = split / /, $self->{fig}->genus_species($genomeID); |
my ($genus, $species, @extraData) = split / /, $self->{fig}->genus_species($genomeID); |
261 |
my $extra = join " ", @extraData, "[$genomeID]"; |
my $extra = join " ", @extraData; |
262 |
# Get the full taxonomy. |
# Get the full taxonomy. |
263 |
my $taxonomy = $fig->taxonomy_of($genomeID); |
my $taxonomy = $fig->taxonomy_of($genomeID); |
264 |
# Output the genome record. |
# Output the genome record. |
441 |
FeatureTranslation |
FeatureTranslation |
442 |
FeatureUpstream |
FeatureUpstream |
443 |
IsLocatedIn |
IsLocatedIn |
444 |
|
HasFeature |
445 |
|
|
446 |
=over 4 |
=over 4 |
447 |
|
|
467 |
my $loadFeatureLink = $self->_TableLoader('FeatureLink'); |
my $loadFeatureLink = $self->_TableLoader('FeatureLink'); |
468 |
my $loadFeatureTranslation = $self->_TableLoader('FeatureTranslation'); |
my $loadFeatureTranslation = $self->_TableLoader('FeatureTranslation'); |
469 |
my $loadFeatureUpstream = $self->_TableLoader('FeatureUpstream'); |
my $loadFeatureUpstream = $self->_TableLoader('FeatureUpstream'); |
470 |
|
my $loadHasFeature = $self->_TableLoader('HasFeature'); |
471 |
# Get the maximum sequence size. We need this later for splitting up the |
# Get the maximum sequence size. We need this later for splitting up the |
472 |
# locations. |
# locations. |
473 |
my $chunkSize = $self->{sprout}->MaxSegment(); |
my $chunkSize = $self->{sprout}->MaxSegment(); |
488 |
my ($featureID, $locations, undef, $type) = @{$featureData}; |
my ($featureID, $locations, undef, $type) = @{$featureData}; |
489 |
# Create the feature record. |
# Create the feature record. |
490 |
$loadFeature->Put($featureID, 1, $type); |
$loadFeature->Put($featureID, 1, $type); |
491 |
|
# Link it to the parent genome. |
492 |
|
$loadHasFeature->Put($genomeID, $featureID, $type); |
493 |
# Create the aliases. |
# Create the aliases. |
494 |
for my $alias ($fig->feature_aliases($featureID)) { |
for my $alias ($fig->feature_aliases($featureID)) { |
495 |
$loadFeatureAlias->Put($featureID, $alias); |
$loadFeatureAlias->Put($featureID, $alias); |
706 |
my ($genomeID, $roleID); |
my ($genomeID, $roleID); |
707 |
my %roleData = (); |
my %roleData = (); |
708 |
for my $subsysID (@subsysIDs) { |
for my $subsysID (@subsysIDs) { |
|
Trace("Creating subsystem $subsysID.") if T(3); |
|
|
$loadSubsystem->Add("subsystemIn"); |
|
709 |
# Get the subsystem object. |
# Get the subsystem object. |
710 |
my $sub = $fig->get_subsystem($subsysID); |
my $sub = $fig->get_subsystem($subsysID); |
711 |
|
# Only proceed if the subsystem has a spreadsheet. |
712 |
|
if (! $sub->{empty_ss}) { |
713 |
|
Trace("Creating subsystem $subsysID.") if T(3); |
714 |
|
$loadSubsystem->Add("subsystemIn"); |
715 |
# Create the subsystem record. |
# Create the subsystem record. |
716 |
my $curator = $sub->get_curator(); |
my $curator = $sub->get_curator(); |
717 |
my $notes = $sub->get_notes(); |
my $notes = $sub->get_notes(); |
812 |
# Connect the subset to the subsystem. |
# Connect the subset to the subsystem. |
813 |
$loadHasRoleSubset->Put($subsysID, $actualID); |
$loadHasRoleSubset->Put($subsysID, $actualID); |
814 |
# Connect the subset to its roles. |
# Connect the subset to its roles. |
815 |
my @roles = $sub->get_subset($subsetID); |
my @roles = $sub->get_subsetC_roles($subsetID); |
816 |
for my $roleID (@roles) { |
for my $roleID (@roles) { |
817 |
$loadConsistsOfRoles->Put($actualID, $roleID); |
$loadConsistsOfRoles->Put($actualID, $roleID); |
818 |
} |
} |
865 |
} |
} |
866 |
} |
} |
867 |
} |
} |
868 |
|
} |
869 |
# Finish the load. |
# Finish the load. |
870 |
my $retVal = $self->_FinishAll(); |
my $retVal = $self->_FinishAll(); |
871 |
return $retVal; |
return $retVal; |
1472 |
# Here we really need to finish. |
# Here we really need to finish. |
1473 |
Trace("Finishing $relName.") if T(2); |
Trace("Finishing $relName.") if T(2); |
1474 |
my $stats = $loader->Finish(); |
my $stats = $loader->Finish(); |
1475 |
if ($self->{options}->{dbLoad} && ! $loader->Ignore) { |
if ($self->{options}->{dbLoad}) { |
1476 |
# Here we want to use the load file just created to load the database. |
# Here we want to use the load file just created to load the database. |
1477 |
Trace("Loading relation $relName.") if T(2); |
Trace("Loading relation $relName.") if T(2); |
1478 |
my $newStats = $self->{sprout}->LoadUpdate(1, [$relName]); |
my $newStats = $self->{sprout}->LoadUpdate(1, [$relName]); |