From a56dab3cea2628b469fdc1818b067e851f6101d6 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Thu, 18 Jan 2018 14:23:05 +0000 Subject: [PATCH 1/1] JAL-2805 disabled Nexus file identification(as its parser is unreliable) --- src/jalview/io/FileFormat.java | 61 +++++++++++++++++++------------------- src/jalview/io/IdentifyFile.java | 18 ++++++----- 2 files changed, 40 insertions(+), 39 deletions(-) diff --git a/src/jalview/io/FileFormat.java b/src/jalview/io/FileFormat.java index 3b54f38..ceb72be 100644 --- a/src/jalview/io/FileFormat.java +++ b/src/jalview/io/FileFormat.java @@ -22,7 +22,6 @@ package jalview.io; import jalview.datamodel.AlignmentI; import jalview.datamodel.PDBEntry; -import jalview.ext.forester.io.NexusFile; import jalview.ext.forester.io.PhyloXmlFile; import jalview.ext.jmol.JmolParser; import jalview.structure.StructureImportSettings; @@ -376,36 +375,36 @@ public enum FileFormat implements FileFormatI return false; } }, - Nexus("Nexus", "nex,nexus,nx,tre", true, true) - { - - @Override - public AlignmentFileReaderI getReader(FileParse source) - throws IOException - { - return new NexusFile(source); - } - - @Override - public AlignmentFileWriterI getWriter(AlignmentI al) - { - // handle within Aptx? - return null; - } - - @Override - public boolean isTextFormat() - { - return true; - } - - @Override - public boolean isTreeFile() - { - return true; - } - - }, + // Nexus("Nexus", "nex,nexus,nx,tre", true, true) + // { + // + // @Override + // public AlignmentFileReaderI getReader(FileParse source) + // throws IOException + // { + // return new NexusFile(source); + // } + // + // @Override + // public AlignmentFileWriterI getWriter(AlignmentI al) + // { + // // handle within Aptx? + // return null; + // } + // + // @Override + // public boolean isTextFormat() + // { + // return true; + // } + // + // @Override + // public boolean isTreeFile() + // { + // return true; + // } + // + // }, PhyloXML("PhyloXML", "phyloxml,phylo.xml,pxml", true, true) { diff --git a/src/jalview/io/IdentifyFile.java b/src/jalview/io/IdentifyFile.java index a7ed592..1d0a3d2 100755 --- a/src/jalview/io/IdentifyFile.java +++ b/src/jalview/io/IdentifyFile.java @@ -350,14 +350,16 @@ public class IdentifyFile reply = FileFormat.PhyloXML; break; } - else if (((identifier.startsWith("nexus")) - || (identifier.startsWith("#nexus")) - || (identifier.startsWith("# nexus")) - || (identifier.startsWith("begin")))) - { - reply = FileFormat.Nexus; - break; - } + // commented out, nexus parser is troublesome + + // else if (((identifier.startsWith("nexus")) + // || (identifier.startsWith("#nexus")) + // || (identifier.startsWith("# nexus")) + // || (identifier.startsWith("begin")))) + // { + // reply = FileFormat.Nexus; + // break; + // } } lineswereskipped = true; // this means there was some junk before any // key file signature -- 1.7.10.2