X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fjmol%2FPDBFileWithJmol.java;h=69cb8bd2320714635bc29a9997f641aa3897f33a;hb=9ac8472a4a1db8f17916f15690483af3bf97c495;hp=240ea7bc00b4df37bbe05cb157360fcbf1123945;hpb=fac668afe0509dd43d360b921f5ba4eda8601887;p=jalview.git diff --git a/src/jalview/ext/jmol/PDBFileWithJmol.java b/src/jalview/ext/jmol/PDBFileWithJmol.java index 240ea7b..69cb8bd 100644 --- a/src/jalview/ext/jmol/PDBFileWithJmol.java +++ b/src/jalview/ext/jmol/PDBFileWithJmol.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -45,7 +45,6 @@ import org.jmol.modelset.ModelSet; import org.jmol.modelsetbio.BioModel; import org.jmol.modelsetbio.BioPolymer; import org.jmol.viewer.Viewer; -import org.openscience.jmol.app.JmolApp; /** * Import and process PDB files with Jmol @@ -56,9 +55,6 @@ import org.openscience.jmol.app.JmolApp; public class PDBFileWithJmol extends AlignFile implements JmolStatusListener { - - JmolApp jmolApp = null; - Viewer viewer = null; public PDBFileWithJmol(String inFile, String type) throws IOException @@ -73,7 +69,6 @@ public class PDBFileWithJmol extends AlignFile implements public PDBFileWithJmol() { - // TODO Auto-generated constructor stub } /** @@ -84,22 +79,16 @@ public class PDBFileWithJmol extends AlignFile implements private Viewer getJmolData() { if (viewer == null) - { // note that -o -n -x are all implied // TODO check for Jmol 14.2 - jmolApp = new JmolApp(); - jmolApp.isDataOnly = true; - jmolApp.haveConsole = false; - jmolApp.haveDisplay = false; + { try { viewer = (Viewer) JmolViewer.allocateViewer(null, null, null, null, null, "-x -o -n", this); - viewer.setScreenDimension(jmolApp.startupWidth, - jmolApp.startupHeight); - jmolApp.startViewer(viewer, null, false); } catch (ClassCastException x) { - throw new Error(MessageManager.formatMessage("error.jmol_version_not_compatible_with_jalview_version", new String[]{JmolViewer.getJmolVersion()}), - x); + throw new Error(MessageManager.formatMessage( + "error.jmol_version_not_compatible_with_jalview_version", + new String[] { JmolViewer.getJmolVersion() }), x); } } return viewer; @@ -242,6 +231,20 @@ public class PDBFileWithJmol extends AlignFile implements lastrnum = group.getResno(); } seq[len] = group.getGroup1(); + + /* + * JAL-1828 replace a modified amino acid with its standard + * equivalent (e.g. MSE with MET->M) to maximise sequence matching + */ + String threeLetterCode = group.getGroup3(); + String canonical = ResidueProperties + .getCanonicalAminoAcid(threeLetterCode); + if (canonical != null + && !canonical.equalsIgnoreCase(threeLetterCode)) + { + seq[len] = ResidueProperties + .getSingleCharacterCode(canonical); + } switch (group.getProteinStructureSubType()) { case HELIX310: