Package org.jmol.util
Class JmolMolecule
java.lang.Object
org.jmol.util.JmolMolecule
- Direct Known Subclasses:
SmilesSearch
an independent class utilizing only org.jmol.api.JmolNode, not org.jmol.modelset.Atom
for use in finding molecules in models and SMILES strings
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
int[]
int
int[]
javajs.util.BS
int[]
int
int
int
int
int
int
Node[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final JmolMolecule[]
addMolecule
(JmolMolecule[] molecules, int iMolecule, Node[] atoms, int iAtom, javajs.util.BS bsBranch, int modelIndex, int indexInModel, javajs.util.BS bsExclude) private static JmolMolecule[]
allocateArray
(JmolMolecule[] molecules, int len) static javajs.util.BS
getBitSetForMF
(Atom[] at, javajs.util.BS bsAtoms, String mf) static javajs.util.BS
getBranchBitSet
(Node[] atoms, int atomIndex, javajs.util.BS bsToTest, javajs.util.Lst<javajs.util.BS> biobranches, int atomIndexNot, boolean allowCyclic, boolean allowBioResidue) given a set of atoms, a subset of atoms to test, two atoms that start the branch, and whether or not to allow the branch to cycle back on itself, deliver the set of atoms constituting this branch.static javajs.util.BS
getBranchesForInversion
(Node[] at, int atomIndex, javajs.util.BS bsToTest) private static boolean
getCovalentlyConnectedBitSet
(Node[] atoms, Node atom, javajs.util.BS bsToTest, boolean allowCyclic, boolean allowBioResidue, javajs.util.Lst<javajs.util.BS> biobranches, javajs.util.BS bsResult, Node origAtom, Node prevAtom) getMolecularFormula
(boolean includeMissingHydrogens, float[] wts, boolean isEmpirical) static String
getMolecularFormulaAtoms
(Node[] atoms, javajs.util.BS bsSelected, float[] wts, boolean isEmpirical) getMolecularFormulaImpl
(boolean includeMissingHydrogens, float[] wts, boolean isEmpirical) static final JmolMolecule[]
getMolecules
(Node[] atoms, javajs.util.BS[] bsModelAtoms, javajs.util.Lst<javajs.util.BS> biobranches, javajs.util.BS bsExclude) Creates an array of JmolMolecules from a set of atoms in the form of simple JmolNodes.private static JmolMolecule
initialize
(Node[] nodes, int moleculeIndex, int firstAtomIndex, javajs.util.BS atomList, int modelIndex, int indexInModel)
-
Field Details
-
nodes
-
moleculeIndex
public int moleculeIndex -
modelIndex
public int modelIndex -
indexInModel
public int indexInModel -
firstAtomIndex
public int firstAtomIndex -
ac
public int ac -
nElements
public int nElements -
elementCounts
public int[] elementCounts -
altElementCounts
public int[] altElementCounts -
elementNumberMax
public int elementNumberMax -
altElementMax
public int altElementMax -
mf
-
atomList
public javajs.util.BS atomList -
atNos
public int[] atNos
-
-
Constructor Details
-
JmolMolecule
public JmolMolecule()
-
-
Method Details
-
getMolecules
public static final JmolMolecule[] getMolecules(Node[] atoms, javajs.util.BS[] bsModelAtoms, javajs.util.Lst<javajs.util.BS> biobranches, javajs.util.BS bsExclude) Creates an array of JmolMolecules from a set of atoms in the form of simple JmolNodes. Allows for appending onto an already established set of branches (from BioPolymer).- Parameters:
atoms
- set of atoms to checkbsModelAtoms
- per-model atom list, or nullbiobranches
- pre-defined connections, like bonds but not to be followed internallybsExclude
- TODO- Returns:
- an array of JmolMolecules
-
getBranchBitSet
public static javajs.util.BS getBranchBitSet(Node[] atoms, int atomIndex, javajs.util.BS bsToTest, javajs.util.Lst<javajs.util.BS> biobranches, int atomIndexNot, boolean allowCyclic, boolean allowBioResidue) given a set of atoms, a subset of atoms to test, two atoms that start the branch, and whether or not to allow the branch to cycle back on itself, deliver the set of atoms constituting this branch.- Parameters:
atoms
-atomIndex
- the first atom of the branchbsToTest
- some subset of those atomsbiobranches
- pre-determined groups of connected atomsatomIndexNot
- the "root" atom stopping branch development; often a ring atom; if -1, then this method will return all atoms in a connected set of atoms.allowCyclic
- allowallowBioResidue
- TODO- Returns:
- a bitset of atoms along this branch
-
addMolecule
public static final JmolMolecule[] addMolecule(JmolMolecule[] molecules, int iMolecule, Node[] atoms, int iAtom, javajs.util.BS bsBranch, int modelIndex, int indexInModel, javajs.util.BS bsExclude) -
getMolecularFormulaAtoms
-
getMolecularFormula
public String getMolecularFormula(boolean includeMissingHydrogens, float[] wts, boolean isEmpirical) -
getMolecularFormulaImpl
public String getMolecularFormulaImpl(boolean includeMissingHydrogens, float[] wts, boolean isEmpirical) -
initialize
private static JmolMolecule initialize(Node[] nodes, int moleculeIndex, int firstAtomIndex, javajs.util.BS atomList, int modelIndex, int indexInModel) -
getCovalentlyConnectedBitSet
-
allocateArray
-
getBitSetForMF
-
getBranchesForInversion
public static javajs.util.BS getBranchesForInversion(Node[] at, int atomIndex, javajs.util.BS bsToTest)
-