/*\r
* Jalview - A Sequence Alignment Editor and Viewer\r
-* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
+* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
*\r
* This program is free software; you can redistribute it and/or\r
* modify it under the terms of the GNU General Public License\r
{\r
data = data.toUpperCase();\r
\r
+ if ( (data.indexOf("# STOCKHOLM") > -1))\r
+ {\r
+ reply = "STH";\r
+\r
+ break;\r
+ }\r
+\r
if ((data.indexOf("#") == 0) || (data.length() < 1))\r
{\r
continue;\r
// could be BLC file, read next line to confirm\r
data = reader.readLine();\r
\r
- if (data.indexOf(">") > -1 || data.indexOf("*") >-1 )\r
+ if (data.indexOf(">") > -1)\r
{\r
reply = "BLC";\r
}\r
else\r
{\r
+ //Is this a single line BLC file?\r
+ reader.readLine();\r
+ String data2 = reader.readLine();\r
+ if ( data2 != null\r
+ && data.indexOf("*")>-1\r
+ && data.indexOf("*")==data2.indexOf("*"))\r
+ {\r
+ reply = "BLC";\r
+ }\r
+ else\r
+ {\r
reply = "FASTA";\r
+ }\r
}\r
\r
break;\r
- }\r
- else if (data.indexOf(":")<data.indexOf(",")) // && data.indexOf(",")<data.indexOf(",", data.indexOf(",")))\r
- {\r
- // file looks like a concise JNet file\r
- reply="JnetFile";\r
- break;\r
- }\r
+ }\r
+ else if (data.indexOf("HEADER") == 0 ||\r
+ data.indexOf("ATOM") == 0)\r
+ {\r
+ reply = "PDB";\r
+ break;\r
+ }\r
+ else if (data.indexOf(":") < data.indexOf(",")) // && data.indexOf(",")<data.indexOf(",", data.indexOf(",")))\r
+ {\r
+ // file looks like a concise JNet file\r
+ reply = "JnetFile";\r
+ break;\r
+ }\r
}\r
\r
reader.close();\r
System.err.println("File Identification failed!\n" + ex);\r
return error;\r
}\r
+\r
return reply;\r
}\r
}\r