/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*/
package jalview.ext.jmol;
-import jalview.api.AlignmentViewPanel;
-import jalview.api.FeatureRenderer;
-import jalview.api.SequenceRenderer;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.ColumnSelection;
-import jalview.datamodel.PDBEntry;
-import jalview.datamodel.SequenceI;
-import jalview.io.AppletFormatAdapter;
-import jalview.schemes.ColourSchemeI;
-import jalview.schemes.ResidueProperties;
-import jalview.structure.StructureMapping;
-import jalview.structure.StructureMappingcommandSet;
-import jalview.structure.StructureSelectionManager;
-import jalview.structures.models.AAStructureBindingModel;
-import jalview.util.MessageManager;
-
import java.awt.Color;
import java.awt.Container;
import java.awt.event.ComponentEvent;
import java.io.File;
import java.net.URL;
import java.security.AccessControlException;
-import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.List;
import java.util.Map;
import java.util.Vector;
import org.jmol.constant.EnumCallback;
import org.jmol.popup.JmolPopup;
+import jalview.api.AlignmentViewPanel;
+import jalview.api.FeatureRenderer;
+import jalview.api.SequenceRenderer;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.SequenceI;
+import jalview.io.AppletFormatAdapter;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ResidueProperties;
+import jalview.structure.StructureMapping;
+import jalview.structure.StructureMappingcommandSet;
+import jalview.structure.StructureSelectionManager;
+import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.MessageManager;
+
public abstract class JalviewJmolBinding extends AAStructureBindingModel
implements JmolStatusListener, JmolSelectionListener,
ComponentListener
command.append(1 + pdbfnum);
command.append(".1} {");
command.append(1 + refStructure);
- command.append(".1} SUBSET {*.CA | *.P} ATOMS ");
+ // conformation=1 excludes alternate locations for CA (JAL-1757)
+ command.append(".1} SUBSET {(*.CA | *.P) and conformation=1} ATOMS ");
// form the matched pair strings
String sep = "";
return;
}
- String res;
- int index;
- Color col;
jmolHistory(false);
- // TODO: Switch between nucleotide or aa selection expressions
- Enumeration en = ResidueProperties.aa3Hash.keys();
- StringBuffer command = new StringBuffer("select *;color white;");
- while (en.hasMoreElements())
+ StringBuilder command = new StringBuilder(128);
+ command.append("select *;color white;");
+ List<String> residueSet = ResidueProperties.getResidues(isNucleotide(),
+ false);
+ for (String res : residueSet)
{
- res = en.nextElement().toString();
- index = ((Integer) ResidueProperties.aa3Hash.get(res)).intValue();
- if (index > 20)
- {
- continue;
- }
-
- col = cs.findColour(ResidueProperties.aa[index].charAt(0));
-
+ Color col = cs.findColour(res.charAt(0));
command.append("select " + res + ";color[" + col.getRed() + ","
+ col.getGreen() + "," + col.getBlue() + "];");
}
jmolHistory(true);
}
- /**
- *
- * @param pdbfile
- * @return text report of alignment between pdbfile and any associated
- * alignment sequences
- */
- public String printMapping(String pdbfile)
- {
- return getSsm().printMapping(pdbfile);
- }
-
@Override
public void resizeInnerPanel(String data)
{