120 |
# an omitted access code can be defaulted to 1. |
# an omitted access code can be defaulted to 1. |
121 |
for my $genomeLine (@genomeList) { |
for my $genomeLine (@genomeList) { |
122 |
my ($genomeID, $accessCode) = split("\t", $genomeLine); |
my ($genomeID, $accessCode) = split("\t", $genomeLine); |
123 |
if (undef $accessCode) { |
if (! defined($accessCode)) { |
124 |
$accessCode = 1; |
$accessCode = 1; |
125 |
} |
} |
126 |
$genomes{$genomeID} = $accessCode; |
$genomes{$genomeID} = $accessCode; |
609 |
Trace("Processing features for genome $genomeID.") if T(3); |
Trace("Processing features for genome $genomeID.") if T(3); |
610 |
# Get the feature list for this genome. |
# Get the feature list for this genome. |
611 |
my $features = $fig->all_features_detailed($genomeID); |
my $features = $fig->all_features_detailed($genomeID); |
612 |
|
# Count the BBHs we find. |
613 |
|
my $bbhCount = 0; |
614 |
# Loop through the features. |
# Loop through the features. |
615 |
for my $featureData (@{$features}) { |
for my $featureData (@{$features}) { |
616 |
# Split the tuple. |
# Split the tuple. |
626 |
if ($genomeHash->{$targetGenomeID}) { |
if ($genomeHash->{$targetGenomeID}) { |
627 |
$loadIsBidirectionalBestHitOf->Put($featureID, $targetID, $targetGenomeID, |
$loadIsBidirectionalBestHitOf->Put($featureID, $targetID, $targetGenomeID, |
628 |
$score); |
$score); |
629 |
|
$bbhCount++; |
630 |
} |
} |
631 |
} |
} |
632 |
} |
} |
633 |
|
Trace("$bbhCount BBHs found for $genomeID.") if T(3); |
634 |
} |
} |
635 |
} |
} |
636 |
# Finish the loads. |
# Finish the loads. |
742 |
my $curator = $sub->get_curator(); |
my $curator = $sub->get_curator(); |
743 |
my $notes = $sub->get_notes(); |
my $notes = $sub->get_notes(); |
744 |
$loadSubsystem->Put($subsysID, $curator, $notes); |
$loadSubsystem->Put($subsysID, $curator, $notes); |
745 |
my $class = $fig->subsystem_classification($subsysID); |
my $classList = $fig->subsystem_classification($subsysID); |
746 |
if ($class) { |
my @classes = @$classList; |
747 |
|
if (@classes) { |
748 |
|
for my $class (@classes) { |
749 |
$loadSubsystemClass->Put($subsysID, $class); |
$loadSubsystemClass->Put($subsysID, $class); |
750 |
} |
} |
751 |
|
} |
752 |
# Connect it to its roles. Each role is a column in the subsystem spreadsheet. |
# Connect it to its roles. Each role is a column in the subsystem spreadsheet. |
753 |
for (my $col = 0; defined($roleID = $sub->get_role($col)); $col++) { |
for (my $col = 0; defined($roleID = $sub->get_role($col)); $col++) { |
754 |
# Connect to this role. |
# Connect to this role. |
1513 |
The following relations are loaded by this method. |
The following relations are loaded by this method. |
1514 |
|
|
1515 |
Family |
Family |
1516 |
ContainsFeature |
IsFamilyForFeature |
1517 |
|
|
1518 |
The source information for these relations is taken from the C<families_for_protein>, |
The source information for these relations is taken from the C<families_for_protein>, |
1519 |
C<family_function>, and C<sz_family> methods of the B<FIG> object. |
C<family_function>, and C<sz_family> methods of the B<FIG> object. |
1537 |
my $genomeHash = $self->{genomes}; |
my $genomeHash = $self->{genomes}; |
1538 |
# Create load objects for the tables we're loading. |
# Create load objects for the tables we're loading. |
1539 |
my $loadFamily = $self->_TableLoader('Family'); |
my $loadFamily = $self->_TableLoader('Family'); |
1540 |
my $loadContainsFeature = $self->_TableLoader('ContainsFeature'); |
my $loadIsFamilyForFeature = $self->_TableLoader('IsFamilyForFeature'); |
1541 |
if ($self->{options}->{loadOnly}) { |
if ($self->{options}->{loadOnly}) { |
1542 |
Trace("Loading from existing files.") if T(2); |
Trace("Loading from existing files.") if T(2); |
1543 |
} else { |
} else { |
1549 |
Trace("Processing features for $genomeID.") if T(2); |
Trace("Processing features for $genomeID.") if T(2); |
1550 |
# Loop through this genome's PEGs. |
# Loop through this genome's PEGs. |
1551 |
for my $fid ($fig->all_features($genomeID, "peg")) { |
for my $fid ($fig->all_features($genomeID, "peg")) { |
1552 |
$loadContainsFeature->Add("features", 1); |
$loadIsFamilyForFeature->Add("features", 1); |
1553 |
# Get this feature's families. |
# Get this feature's families. |
1554 |
my @families = $fig->families_for_protein($fid); |
my @families = $fig->families_for_protein($fid); |
1555 |
# Loop through the families, connecting them to the feature. |
# Loop through the families, connecting them to the feature. |
1556 |
for my $family (@families) { |
for my $family (@families) { |
1557 |
$loadContainsFeature->Put($family, $fid); |
$loadIsFamilyForFeature->Put($family, $fid); |
1558 |
# If this is a new family, create a record for it. |
# If this is a new family, create a record for it. |
1559 |
if (! exists $familyHash{$family}) { |
if (! exists $familyHash{$family}) { |
1560 |
$familyHash{$family} = 1; |
$familyHash{$family} = 1; |