X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FIdentifyFile.java;h=01282ea1f353930f03d92ed64d728c30b8f7c401;hb=2202f8ba9f000c811358937a571c5cd4a017a403;hp=20407692fa7c61711d0fce987fda49fd935448e8;hpb=1c472d54a12783c4be933b83d47217b7d56b167f;p=jalview.git diff --git a/src/jalview/io/IdentifyFile.java b/src/jalview/io/IdentifyFile.java index 2040769..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,17 +122,41 @@ 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") == 0 || + data.indexOf("ATOM") == 0) + { + reply = "PDB"; + break; + } + else if (data.indexOf(":") < data.indexOf(",")) // && data.indexOf(",")