X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FIdentifyFile.java;h=01282ea1f353930f03d92ed64d728c30b8f7c401;hb=6a44f113099e7ee83deada4d8426cd98757c2425;hp=348b085fe01176e6b8d1b974caa64f0f4c35aaf7;hpb=a6afc82877599e6ad2c52f01249c36338f251983;p=jalview.git diff --git a/src/jalview/io/IdentifyFile.java b/src/jalview/io/IdentifyFile.java index 348b085..01282ea 100755 --- a/src/jalview/io/IdentifyFile.java +++ b/src/jalview/io/IdentifyFile.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer -* Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle +* Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -76,6 +76,13 @@ public class IdentifyFile { data = data.toUpperCase(); + if ( (data.indexOf("# STOCKHOLM") > -1)) + { + reply = "STH"; + + break; + } + if ((data.indexOf("#") == 0) || (data.length() < 1)) { continue; @@ -115,19 +122,31 @@ public class IdentifyFile // could be BLC file, read next line to confirm data = reader.readLine(); - if (data.indexOf(">") > -1 || data.indexOf("*") >-1 ) + if (data.indexOf(">") > -1) { reply = "BLC"; } else { + //Is this a single line BLC file? + reader.readLine(); + String data2 = reader.readLine(); + if ( data2 != null + && data.indexOf("*")>-1 + && data.indexOf("*")==data2.indexOf("*")) + { + reply = "BLC"; + } + else + { reply = "FASTA"; + } } break; } - else if (data.indexOf("HEADER") > -1 || - data.indexOf("ATOM") > -1) + else if (data.indexOf("HEADER") == 0 || + data.indexOf("ATOM") == 0) { reply = "PDB"; break;