8001937d67c6b02d1390fe011da38097927aee26
hartera
  Wed Jun 4 15:56:37 2014 -0700
Added code to handle casewhere there is no version number for the retrogene id instead of reporting an error.
diff --git src/hg/hgc/retroClick.c src/hg/hgc/retroClick.c
index 2fc497d..6bfdef8 100644
--- src/hg/hgc/retroClick.c
+++ src/hg/hgc/retroClick.c
@@ -56,43 +56,50 @@
  * form a gene set that is mapped again, have ids in the form
  * db:NM_012345.1_1.1, where db is the source organism, and '_1' is added so
  * that db:NM_012345.1_1 uniquely identifies the source. */
 
 safef(idBuf, sizeof(idBuf), "%s", mi->pg->name);
 id = idBuf;
 
 /* find various parts */
 colon = strchr(id, ':');
 dot = strchr(id, '.');
 if (dot != NULL)
     {
     under = strchr(dot, '_');
     dash = strchr(dot, '-');
     }
-if ((dot == NULL) || (dash == NULL))
-    errAbort("can't parse accession from srcId: %s", mi->pg->name);
+else 
+    dash = strchr(id, '-');
+
+/* if there is no dash, then this is not the correct type of id so report error
+   but no dot is acceptable */ 
+if (dash == NULL)
+    errAbort("Can't parse accession from srcId: %s", mi->pg->name);
 mi->indirect = (colon != NULL);
 
 /* id used to get sequence is before `-'.  For direct, it excludes
- * genbank version */
+   genbank version so only perform this if the version number is present */
+
 *dash = '\0';
-if (!mi->indirect)
+if ((!mi->indirect) && (dot != NULL))
     *dot = '\0';
 safef(mi->seqId, sizeof(mi->seqId), "%s", id);
 
 /* now pull out genbank accession for obtaining description */
 id = (colon != NULL) ? colon+1 : id;
+if (dot != NULL)
     *dot = '\0';
 
 safef(mi->gbAcc, sizeof(mi->gbAcc), "%s", id);
 if (under != NULL)
     *under = '\0';
 //mi->gbVer = sqlSigned(dot+1);
 }
 
 static void getGenbankInfo(struct sqlConnection *conn, struct mappingInfo *mi)
 /* get source gene info and version from gbCdnaInfo and save in mi */
 {
 char query[512], **row;
 struct sqlResult *sr;
 char *defDb = database;