\r
id = str.nextToken();\r
id = id.substring(1);\r
- if(id.indexOf("UniProt/Swiss-Prot")>-1)\r
- {\r
- id = id.substring(id.indexOf("UniProt/Swiss-Prot|") + 19);\r
- if(id.indexOf("|")>-1)\r
- id = id.substring(id.indexOf("|") + 1);\r
- }\r
-\r
+ com.stevesoft.pat.Regex dbId = new com.stevesoft.pat.Regex("[A-Za-z-]+/[A-Za-z-]+\\|(\\w+)\\|(.+)");\r
+ if (dbId.search(id))\r
+ {\r
+ String dbid = dbId.stringMatched(1);\r
+ String idname = dbId.stringMatched(2);\r
+ if (idname.length()>0 && idname.indexOf("_") > -1)\r
+ {\r
+ id = idname; // just use friendly name // JBPNote: we may lose uniprot standardised ID here.\r
+ }\r
+ else\r
+ {\r
+ id = dbid; // use dbid to ensure sensible queries\r
+ }\r
+\r
+ }\r
if (id.indexOf("/") > 0 ) {\r
\r
StringTokenizer st = new StringTokenizer(id,"/");\r