Bugfix for SRS 5.1

Tim Cutts timc at chiark.greenend.org.uk
Thu Sep 9 07:17:01 EST 1999


For those of you still using SRS 5.1, I have found and fixed a bug in
its handling of $Library objects.  Hope this is of help to those who
can't or don't wish to upgrade to SRS 6.

SYMPTOMS:

If your .i and .it files do not have the same name as databases
generated within them, $Library objects have .iFile and .itFile
attributes to tell SRS where these files are.  Unfortunately, these
attributes are then ignored in two common cases:

a)  Trying to retrieve the Structure or Info links from the library
    description page returns an empty page.  For an example of how
    this is broken, try looking at the information for dbSNP_SNP on
    the EBI SRS5 server (http://srs.ebi.ac.uk/) 

b)  The .it file for your database is ignored if you pull up field
    info pages.

The bug does *NOT* seem to exist in SRS 6, as far as I can tell from the
EBI SRS 6 server.

PATCH:

The following patch to $SRSSOU/library.c fixes the bug in SRS 5.1:


--- library.c.orig	Thu Sep  9 12:58:31 1999
+++ library.c	Thu Sep  9 12:52:50 1999
@@ -1,11 +1,11 @@
 /*****************************************************************************/
-char library_ID[] = "$Id: library.c,v 1.39 1998/01/08 12:50:36 srs Exp $";
+char library_ID[] = "$Id: library.c,v 1.1 1999/09/09 11:01:39 pubseq Exp pubseq $";
 /*
 **
 **    $RCSfile: library.c,v $
-**    $Revision: 1.39 $
-**    $Date: 1998/01/08 12:50:36 $
-**    $Author: srs $
+**    $Revision: 1.1 $
+**    $Date: 1999/09/09 11:01:39 $
+**    $Author: pubseq $
 **
 **
 **
@@ -312,6 +312,38 @@
 
 
 
+/**API* LibIcaFileName ********************************************************
+** 
+** 	Returns the library file name.
+** 
+** 	INPUT:	    library object [R]
+**                  option: "info", "syntax", "structure"
+** 	        IMPLICIT:
+** 
+** 	RETURNS:    library file name stub if found
+**                  NULL if the library name is unknown
+*/ 
+
+char *LibIcaFileName (SLBo *lib, char* option)
+{
+  char *r = lib->nam;
+  switch (tolower(option[1])) {
+  case 'n': { /* info */
+    if (lib->itFile[0] != '\0') {
+      r = lib->itFile;
+    }
+    break;
+  }
+  case 't': { /* structure */
+    if (lib->iFile[0] != '\0') {
+      r = lib->iFile;
+    }
+    break;
+  }
+  }
+  return r;
+}
+
 /**API* LibName ***************************************************************
 ** 
 ** 	Returns the library name.
@@ -434,7 +466,7 @@
   else
     StrClear (&name);
 
-  strcpy (tmp, LibName (lib));
+  strcpy (tmp, LibIcaFileName (lib, option));
   SmEdit (tmp, SMxLOWCASE);
   StrSetS (&name, "SRSDB:");
   StrAppS (&name, tmp);




More information about the Bio-srs mailing list