From bcd90892385ad223ee55e5e8876d68a4c13b8b5a Mon Sep 17 00:00:00 2001 From: Rhoda Kinsella <rhoda@ebi.ac.uk> Date: Thu, 31 Jul 2008 13:37:12 +0000 Subject: [PATCH] Added subroutine add_synonyms used by the DBASSParser.pm --- .../xref_mapping/XrefParser/BaseParser.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/misc-scripts/xref_mapping/XrefParser/BaseParser.pm b/misc-scripts/xref_mapping/XrefParser/BaseParser.pm index 2b17425e87..912ce342ad 100644 --- a/misc-scripts/xref_mapping/XrefParser/BaseParser.pm +++ b/misc-scripts/xref_mapping/XrefParser/BaseParser.pm @@ -1799,6 +1799,23 @@ sub add_to_syn{ } } + +sub add_synonym{ + my ($self, $xref_id, $syn) = @_; + + my $add_synonym_sth; + + if(!defined($add_synonym_sth)){ + $add_synonym_sth = $dbi->prepare("INSERT INTO synonym VALUES(?,?)"); + } + + $add_synonym_sth->execute( $xref_id, $syn ) + or croak( $dbi->errstr() . "\n $xref_id\n $syn\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) -- GitLab