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

Diff of /Sprout/FeatureSproutLoader.pm

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

revision 1.6, Mon Jan 19 21:46:21 2009 UTC revision 1.7, Mon Mar 2 22:22:54 2009 UTC
# Line 148  Line 148 
148                  # feature ID, the taxonomy, and the organism name.                  # feature ID, the taxonomy, and the organism name.
149                  my @keywords = ($genomeID, $featureID, $fig->genus_species($genomeID),                  my @keywords = ($genomeID, $featureID, $fig->genus_species($genomeID),
150                                  $fig->taxonomy_of($genomeID));                                  $fig->taxonomy_of($genomeID));
151                  # Create the aliases.                  # We need to insure we don't put multiple copies of the same alias
152                    # in the keyword list, so we'll put all aliases found in this hash.
153                    my %aliasHash;
154                    # Loop through the aliases, recording the normal and natural forms/
155                  for my $alias (split /,/, $aliases) {                  for my $alias (split /,/, $aliases) {
156                      # Connect this alias to this feature and make an Alias record for it.                      # Save the alias.
157                      $self->PutR(IsAliasOf => $alias, $featureID);                      $aliasHash{$alias} = 1;
158                      $self->PutE(FeatureAlias => $alias);                      # Check for a natural form.
159                      # Add it to the keyword list.                      my $natural = AliasAnalysis::Format(natural => $alias);
160                      push @keywords, $alias;                      if (defined $natural) {
161                      # If this is a locus tag, also add its natural form as a keyword.                          # A natural form was found, so we add it to the alias
162                      my $naturalName = AliasAnalysis::Type(LocusTag => $alias);                          # list.
163                      if ($naturalName) {                          $aliasHash{$natural} = 1;
164                          push @keywords, $naturalName;                      } elsif ($alias =~ /^[A-Z]{3}\d+$/) {
165                            # Here it's not a recognized type, but it's probably a
166                            # locus tag, so we create a prefixed version.
167                            my $normalized = AliasAnalysis::Normalize(LocusTag => $alias);
168                            $aliasHash{$normalized} = 1;
169                      }                      }
170                  }                  }
171                  # Add the corresponding IDs. We ask for 2-tuples of the form (id, database).                  # Add the corresponding IDs. We ask for 2-tuples of the form (id, database).
172                  my @corresponders = $fig->get_corresponding_ids($featureID, 1);                  my @corresponders = $fig->get_corresponding_ids($featureID, 1);
173                  for my $tuple (@corresponders) {                  for my $tuple (@corresponders) {
174                      my ($id, $xdb) = @{$tuple};                      my ($id, $xdb) = @{$tuple};
175                      # Ignore SEED: that's us. Also ignore contig IDs. Those are due to a bug.                      # Ignore SEED: that's us. Also ignore contig IDs. Those result from a bug
176                        # at PIR.
177                      if ($xdb ne 'SEED' && ! ($xdb eq 'RefSeq' && $id =~ /^[A-Z][A-Z]_\d+$/)) {                      if ($xdb ne 'SEED' && ! ($xdb eq 'RefSeq' && $id =~ /^[A-Z][A-Z]_\d+$/)) {
178                          # Connect this ID to the feature and mark its database.                          # Connect this ID to the feature and mark its database.
179                          $self->PutR(IsAlsoFoundIn => $featureID, $xdb,                          $self->PutR(IsAlsoFoundIn => $featureID, $xdb,
180                                     alias => $id);                                     alias => $id);
181                          $self->PutE(ExternalDatabase => $xdb);                          $self->PutE(ExternalDatabase => $xdb);
182                          # Add it as a keyword and an alias.                          # Compute the ID's normalized form.
183                          push @keywords, $id;                          my $normalized = AliasAnalysis::Normalize($xdb => $id);
184                          $self->PutR(IsAliasOf => $id, $featureID);                          # Add both to the alias hash.
185                          $self->PutE(FeatureAlias => $id);                          $aliasHash{$id} = 1;
186                            $aliasHash{$normalized} = 1;
187                        }
188                      }                      }
189                    # Create the aliases.
190                    for my $alias (sort keys %aliasHash) {
191                        # Connect this alias to this feature and make an Alias record for it.
192                        $self->PutR(IsAliasOf => $alias, $featureID);
193                        $self->PutE(FeatureAlias => $alias);
194                        # Add it to the keyword list.
195                        push @keywords, $alias;
196                  }                  }
197                  Trace("Assignment for $featureID is: $assignment") if T(ERDBLoadGroup => 4);                  Trace("Assignment for $featureID is: $assignment") if T(ERDBLoadGroup => 4);
198                  # Break the assignment into words and shove it onto the                  # Break the assignment into words and shove it onto the

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3