Skip to content
Snippets Groups Projects
Commit ba096cfc authored by Ian Longden's avatar Ian Longden
Browse files

added routine to add synonyms given accesion and source id

parent 335a213a
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ my $add_xref_sth = undef;
my $add_direct_xref_sth = undef;
my $add_dependent_xref_sth = undef;
my $get_xref_sth = undef;
my $add_synonym_sth = undef;
my $dbi;
my %dependent_sources;
......@@ -826,6 +827,21 @@ sub add_to_xrefs{
}
sub add_to_syn{
my ($self, $acc, $source_id, $syn) = @_;
if(!defined($add_synonym_sth)){
$add_synonym_sth = $dbi->prepare("INSERT INTO synonym VALUES(?,?)");
}
my $xref_id = get_xref($acc, $source_id);
if(defined($xref_id)){
$add_synonym_sth->execute($xref_id, $syn) || die "$dbi->errstr \n $xref_id\n $syn\n";
}
else{
die "Could not find acc $acc in xref table source = $source_id\n";
}
}
# --------------------------------------------------------------------------------
# Add a single record to the direct_xref table.
# Note that an xref must already have been added to the xref table (xref_id passed as 1st arg)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment