/*
- * 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.0b2)
+ * Copyright (C) 2015 The Jalview Authors
*
* This file is part of Jalview.
*
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
public class PDBFileWithJmol extends AlignFile implements
JmolStatusListener
{
-
- JmolApp jmolApp = null;
-
Viewer viewer = null;
public PDBFileWithJmol(String inFile, String type) throws IOException
public PDBFileWithJmol()
{
- // TODO Auto-generated constructor stub
}
/**
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;
newseq[p] = cinds[seq[p]] == nonGap ? ngc : seq[p];
if (secstr[p] >= 'A' && secstr[p] <= 'z')
{
- asecstr[p] = new Annotation("" + secstr[p], null,
- secstrcode[p], Float.NaN);
+ try
+ {
+ asecstr[p] = new Annotation("" + secstr[p], null,
+ secstrcode[p], Float.NaN);
+ } catch (ArrayIndexOutOfBoundsException e)
+ {
+ // skip - patch for JAL-1836
+ }
}
}
String modelTitle = (String) ms
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: