package jalview.structures.models;
+import java.util.ArrayList;
+import java.util.List;
+
import jalview.api.StructureSelectionManagerProvider;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
+import jalview.structure.AtomSpec;
import jalview.structure.StructureListener;
import jalview.structure.StructureSelectionManager;
+import jalview.util.Comparison;
import jalview.util.MessageManager;
-import java.awt.event.ComponentEvent;
-import java.util.ArrayList;
-import java.util.List;
-
/**
+ *
* A base class to hold common function for protein structure model binding.
* Initial version created by refactoring JMol and Chimera binding models, but
* other structure viewers could in principle be accommodated in future.
protected boolean colourBySequence = true;
+ private boolean nucleotide;
+
/**
* Constructor
*
{
this.ssm = ssm;
this.sequence = sequenceIs;
+ this.nucleotide = Comparison.isNucleotide(sequenceIs);
this.chains = chains;
this.pdbEntry = pdbentry;
this.protocol = protocol;
addSequenceAndChain(pe, seq, null);
}
+ /**
+ * add the given sequences to the mapping scope for the given pdb file handle
+ *
+ * @param pdbFile
+ * - pdbFile identifier
+ * @param seq
+ * - set of sequences it can be mapped to
+ */
+ public void addSequenceForStructFile(String pdbFile, SequenceI[] seq)
+ {
+ for (int pe = 0; pe < getPdbCount(); pe++)
+ {
+ if (getPdbEntry(pe).getFile().equals(pdbFile))
+ {
+ addSequence(pe, seq);
+ }
+ }
+ }
+
+ @Override
+ public void highlightAtoms(List<AtomSpec> atoms)
+ {
+ if (atoms != null)
+ {
+ for (AtomSpec atom : atoms)
+ {
+ highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(),
+ atom.getChain(), atom.getPdbFile());
+ }
+ }
+ }
+
+ protected abstract void highlightAtom(int atomIndex, int pdbResNum,
+ String chain, String pdbFile);
+
+ protected boolean isNucleotide()
+ {
+ return this.nucleotide;
+ }
}
\ No newline at end of file