id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
114,600
cdk/cdk
legacy/src/main/java/org/openscience/cdk/ringsearch/SSSRFinder.java
SSSRFinder.getEquivalenceClassesSizeVector
public int[] getEquivalenceClassesSizeVector() { List equivalenceClasses = cycleBasis().equivalenceClasses(); int[] result = new int[equivalenceClasses.size()]; for (int i = 0; i < equivalenceClasses.size(); i++) { result[i] = ((Collection) equivalenceClasses.get(i)).size(); ...
java
public int[] getEquivalenceClassesSizeVector() { List equivalenceClasses = cycleBasis().equivalenceClasses(); int[] result = new int[equivalenceClasses.size()]; for (int i = 0; i < equivalenceClasses.size(); i++) { result[i] = ((Collection) equivalenceClasses.get(i)).size(); ...
[ "public", "int", "[", "]", "getEquivalenceClassesSizeVector", "(", ")", "{", "List", "equivalenceClasses", "=", "cycleBasis", "(", ")", ".", "equivalenceClasses", "(", ")", ";", "int", "[", "]", "result", "=", "new", "int", "[", "equivalenceClasses", ".", "s...
Returns a vector containing the size of the "interchangeability" equivalence classes. The vector is uniquely defined for any SSSR of a molecule. @return An <code>int[]</code> containing the size of the equivalence classes in a SSSR
[ "Returns", "a", "vector", "containing", "the", "size", "of", "the", "interchangeability", "equivalence", "classes", ".", "The", "vector", "is", "uniquely", "defined", "for", "any", "SSSR", "of", "a", "molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/ringsearch/SSSRFinder.java#L157-L164
114,601
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java
Canon.label
public static long[] label(IAtomContainer container, int[][] g, long[] initial) { if (initial.length != g.length) throw new IllegalArgumentException("number of initial != number of atoms"); return new Canon(g, initial, terminalHydrogens(container, g), false).labelling; }
java
public static long[] label(IAtomContainer container, int[][] g, long[] initial) { if (initial.length != g.length) throw new IllegalArgumentException("number of initial != number of atoms"); return new Canon(g, initial, terminalHydrogens(container, g), false).labelling; }
[ "public", "static", "long", "[", "]", "label", "(", "IAtomContainer", "container", ",", "int", "[", "]", "[", "]", "g", ",", "long", "[", "]", "initial", ")", "{", "if", "(", "initial", ".", "length", "!=", "g", ".", "length", ")", "throw", "new", ...
Compute the canonical labels for the provided structure. The labelling does not consider isomer information or stereochemistry. This method allows provision of a custom array of initial invariants. The current implementation does not fully distinguish all structure topologies but in practise performs well in the majo...
[ "Compute", "the", "canonical", "labels", "for", "the", "provided", "structure", ".", "The", "labelling", "does", "not", "consider", "isomer", "information", "or", "stereochemistry", ".", "This", "method", "allows", "provision", "of", "a", "custom", "array", "of"...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java#L142-L146
114,602
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java
Canon.refine
private long[] refine(long[] invariants, boolean[] hydrogens) { int ord = g.length; InvariantRanker ranker = new InvariantRanker(ord); // current/next vertices, these only hold the vertices which are // equivalent int[] currVs = new int[ord]; int[] nextVs = new int[ord...
java
private long[] refine(long[] invariants, boolean[] hydrogens) { int ord = g.length; InvariantRanker ranker = new InvariantRanker(ord); // current/next vertices, these only hold the vertices which are // equivalent int[] currVs = new int[ord]; int[] nextVs = new int[ord...
[ "private", "long", "[", "]", "refine", "(", "long", "[", "]", "invariants", ",", "boolean", "[", "]", "hydrogens", ")", "{", "int", "ord", "=", "g", ".", "length", ";", "InvariantRanker", "ranker", "=", "new", "InvariantRanker", "(", "ord", ")", ";", ...
Internal - refine invariants to a canonical labelling and symmetry classes. @param invariants the invariants to refine (canonical labelling gets written here) @param hydrogens binary vector of terminal hydrogens @return the symmetry classes
[ "Internal", "-", "refine", "invariants", "to", "a", "canonical", "labelling", "and", "symmetry", "classes", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java#L201-L284
114,603
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java
Canon.atomicNumber
private static int atomicNumber(IAtom atom) { Integer elem = atom.getAtomicNumber(); if (elem != null) return elem; if (atom instanceof IPseudoAtom) return 0; throw new NullPointerException("a non-pseudoatom had unset atomic number"); }
java
private static int atomicNumber(IAtom atom) { Integer elem = atom.getAtomicNumber(); if (elem != null) return elem; if (atom instanceof IPseudoAtom) return 0; throw new NullPointerException("a non-pseudoatom had unset atomic number"); }
[ "private", "static", "int", "atomicNumber", "(", "IAtom", "atom", ")", "{", "Integer", "elem", "=", "atom", ".", "getAtomicNumber", "(", ")", ";", "if", "(", "elem", "!=", "null", ")", "return", "elem", ";", "if", "(", "atom", "instanceof", "IPseudoAtom"...
Access atomic number of atom defaulting to 0 for pseudo atoms. @param atom an atom @return the atomic number @throws NullPointerException the atom was non-pseudo at did not have an atomic number
[ "Access", "atomic", "number", "of", "atom", "defaulting", "to", "0", "for", "pseudo", "atoms", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java#L375-L380
114,604
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java
Canon.implH
private static int implH(IAtom atom) { Integer h = atom.getImplicitHydrogenCount(); if (h != null) return h; if (atom instanceof IPseudoAtom) return 0; throw new NullPointerException("a non-pseudoatom had unset hydrogen count"); }
java
private static int implH(IAtom atom) { Integer h = atom.getImplicitHydrogenCount(); if (h != null) return h; if (atom instanceof IPseudoAtom) return 0; throw new NullPointerException("a non-pseudoatom had unset hydrogen count"); }
[ "private", "static", "int", "implH", "(", "IAtom", "atom", ")", "{", "Integer", "h", "=", "atom", ".", "getImplicitHydrogenCount", "(", ")", ";", "if", "(", "h", "!=", "null", ")", "return", "h", ";", "if", "(", "atom", "instanceof", "IPseudoAtom", ")"...
Access implicit hydrogen count of the atom defaulting to 0 for pseudo atoms. @param atom an atom @return the implicit hydrogen count @throws NullPointerException the atom was non-pseudo at did not have an implicit hydrogen count
[ "Access", "implicit", "hydrogen", "count", "of", "the", "atom", "defaulting", "to", "0", "for", "pseudo", "atoms", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java#L391-L396
114,605
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java
Canon.charge
private static int charge(IAtom atom) { Integer charge = atom.getFormalCharge(); if (charge != null) return charge; return 0; }
java
private static int charge(IAtom atom) { Integer charge = atom.getFormalCharge(); if (charge != null) return charge; return 0; }
[ "private", "static", "int", "charge", "(", "IAtom", "atom", ")", "{", "Integer", "charge", "=", "atom", ".", "getFormalCharge", "(", ")", ";", "if", "(", "charge", "!=", "null", ")", "return", "charge", ";", "return", "0", ";", "}" ]
Access formal charge of an atom defaulting to 0 if undefined. @param atom an atom @return the formal charge
[ "Access", "formal", "charge", "of", "an", "atom", "defaulting", "to", "0", "if", "undefined", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java#L404-L408
114,606
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java
Canon.terminalHydrogens
static boolean[] terminalHydrogens(final IAtomContainer ac, final int[][] g) { final boolean[] hydrogens = new boolean[ac.getAtomCount()]; // we specifically don't check for null atomic number, this must be set. // if not, something major is wrong for (int i = 0; i < ac.getAtomCount();...
java
static boolean[] terminalHydrogens(final IAtomContainer ac, final int[][] g) { final boolean[] hydrogens = new boolean[ac.getAtomCount()]; // we specifically don't check for null atomic number, this must be set. // if not, something major is wrong for (int i = 0; i < ac.getAtomCount();...
[ "static", "boolean", "[", "]", "terminalHydrogens", "(", "final", "IAtomContainer", "ac", ",", "final", "int", "[", "]", "[", "]", "g", ")", "{", "final", "boolean", "[", "]", "hydrogens", "=", "new", "boolean", "[", "ac", ".", "getAtomCount", "(", ")"...
Locate explicit hydrogens that are attached to exactly one other atom. @param ac a structure @return binary set of terminal hydrogens
[ "Locate", "explicit", "hydrogens", "that", "are", "attached", "to", "exactly", "one", "other", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/invariant/Canon.java#L416-L430
114,607
cdk/cdk
base/core/src/main/java/org/openscience/cdk/io/random/RandomAccessReader.java
RandomAccessReader.readRecord
@Override public synchronized IChemObject readRecord(int record) throws Exception { String buffer = readContent(record); if (chemObjectReader == null) throw new CDKException("No chemobject reader!"); else { chemObjectReader.setReader(new StringReader(buffer)); ...
java
@Override public synchronized IChemObject readRecord(int record) throws Exception { String buffer = readContent(record); if (chemObjectReader == null) throw new CDKException("No chemobject reader!"); else { chemObjectReader.setReader(new StringReader(buffer)); ...
[ "@", "Override", "public", "synchronized", "IChemObject", "readRecord", "(", "int", "record", ")", "throws", "Exception", "{", "String", "buffer", "=", "readContent", "(", "record", ")", ";", "if", "(", "chemObjectReader", "==", "null", ")", "throw", "new", ...
Returns the object at given record No. Record numbers are zero-based!
[ "Returns", "the", "object", "at", "given", "record", "No", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/io/random/RandomAccessReader.java#L125-L135
114,608
cdk/cdk
base/core/src/main/java/org/openscience/cdk/io/random/RandomAccessReader.java
RandomAccessReader.readContent
protected String readContent(int record) throws IOException, CDKException { logger.debug("Current record ", record); if ((record < 0) || (record >= records)) { throw new CDKException("No such record " + record); } //fireFrameRead(); raFile.seek(index[record][0]); ...
java
protected String readContent(int record) throws IOException, CDKException { logger.debug("Current record ", record); if ((record < 0) || (record >= records)) { throw new CDKException("No such record " + record); } //fireFrameRead(); raFile.seek(index[record][0]); ...
[ "protected", "String", "readContent", "(", "int", "record", ")", "throws", "IOException", ",", "CDKException", "{", "logger", ".", "debug", "(", "\"Current record \"", ",", "record", ")", ";", "if", "(", "(", "record", "<", "0", ")", "||", "(", "record", ...
Reads the record text content into a String. @param record The record number @return A String representation of the record @throws java.io.IOException if error occurs during reading @throws org.openscience.cdk.exception.CDKException if the record number is invalid
[ "Reads", "the", "record", "text", "content", "into", "a", "String", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/io/random/RandomAccessReader.java#L145-L157
114,609
cdk/cdk
storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesGenerator.java
CxSmilesGenerator.inverse
private static int[] inverse(int[] perm) { int[] inv = new int[perm.length]; for (int i = 0, len = perm.length; i < len; i++) inv[perm[i]] = i; return inv; }
java
private static int[] inverse(int[] perm) { int[] inv = new int[perm.length]; for (int i = 0, len = perm.length; i < len; i++) inv[perm[i]] = i; return inv; }
[ "private", "static", "int", "[", "]", "inverse", "(", "int", "[", "]", "perm", ")", "{", "int", "[", "]", "inv", "=", "new", "int", "[", "perm", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ",", "len", "=", "perm", ".", "length"...
calculate the inverse of a permutation
[ "calculate", "the", "inverse", "of", "a", "permutation" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesGenerator.java#L43-L48
114,610
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/config/isotopes/IsotopeReader.java
IsotopeReader.readIsotopes
public List<IIsotope> readIsotopes() { List<IIsotope> isotopes = new ArrayList<IIsotope>(); try { parser.setFeature("http://xml.org/sax/features/validation", false); logger.info("Deactivated validation"); } catch (SAXException exception) { logger.warn("Cannot ...
java
public List<IIsotope> readIsotopes() { List<IIsotope> isotopes = new ArrayList<IIsotope>(); try { parser.setFeature("http://xml.org/sax/features/validation", false); logger.info("Deactivated validation"); } catch (SAXException exception) { logger.warn("Cannot ...
[ "public", "List", "<", "IIsotope", ">", "readIsotopes", "(", ")", "{", "List", "<", "IIsotope", ">", "isotopes", "=", "new", "ArrayList", "<", "IIsotope", ">", "(", ")", ";", "try", "{", "parser", ".", "setFeature", "(", "\"http://xml.org/sax/features/valida...
Triggers the XML parsing of the data file and returns the read Isotopes. It turns of XML validation before parsing. @return a List of Isotope's. Returns an empty list is some reading error occurred.
[ "Triggers", "the", "XML", "parsing", "of", "the", "data", "file", "and", "returns", "the", "read", "Isotopes", ".", "It", "turns", "of", "XML", "validation", "before", "parsing", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/config/isotopes/IsotopeReader.java#L125-L148
114,611
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java
ReactionManipulator.getAllProducts
public static IAtomContainerSet getAllProducts(IReaction reaction) { IAtomContainerSet moleculeSet = reaction.getBuilder().newInstance(IAtomContainerSet.class); IAtomContainerSet products = reaction.getProducts(); for (int i = 0; i < products.getAtomContainerCount(); i++) { moleculeS...
java
public static IAtomContainerSet getAllProducts(IReaction reaction) { IAtomContainerSet moleculeSet = reaction.getBuilder().newInstance(IAtomContainerSet.class); IAtomContainerSet products = reaction.getProducts(); for (int i = 0; i < products.getAtomContainerCount(); i++) { moleculeS...
[ "public", "static", "IAtomContainerSet", "getAllProducts", "(", "IReaction", "reaction", ")", "{", "IAtomContainerSet", "moleculeSet", "=", "reaction", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IAtomContainerSet", ".", "class", ")", ";", "IAtomContainer...
get all products of a IReaction @param reaction The IReaction @return The IAtomContainerSet
[ "get", "all", "products", "of", "a", "IReaction" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java#L163-L170
114,612
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java
ReactionManipulator.getAllReactants
public static IAtomContainerSet getAllReactants(IReaction reaction) { IAtomContainerSet moleculeSet = reaction.getBuilder().newInstance(IAtomContainerSet.class); IAtomContainerSet reactants = reaction.getReactants(); for (int i = 0; i < reactants.getAtomContainerCount(); i++) { molec...
java
public static IAtomContainerSet getAllReactants(IReaction reaction) { IAtomContainerSet moleculeSet = reaction.getBuilder().newInstance(IAtomContainerSet.class); IAtomContainerSet reactants = reaction.getReactants(); for (int i = 0; i < reactants.getAtomContainerCount(); i++) { molec...
[ "public", "static", "IAtomContainerSet", "getAllReactants", "(", "IReaction", "reaction", ")", "{", "IAtomContainerSet", "moleculeSet", "=", "reaction", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IAtomContainerSet", ".", "class", ")", ";", "IAtomContaine...
get all reactants of a IReaction @param reaction The IReaction @return The IAtomContainerSet
[ "get", "all", "reactants", "of", "a", "IReaction" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java#L178-L185
114,613
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java
ReactionManipulator.reverse
public static IReaction reverse(IReaction reaction) { IReaction reversedReaction = reaction.getBuilder().newInstance(IReaction.class); if (reaction.getDirection() == IReaction.Direction.BIDIRECTIONAL) { reversedReaction.setDirection(IReaction.Direction.BIDIRECTIONAL); } else if (reac...
java
public static IReaction reverse(IReaction reaction) { IReaction reversedReaction = reaction.getBuilder().newInstance(IReaction.class); if (reaction.getDirection() == IReaction.Direction.BIDIRECTIONAL) { reversedReaction.setDirection(IReaction.Direction.BIDIRECTIONAL); } else if (reac...
[ "public", "static", "IReaction", "reverse", "(", "IReaction", "reaction", ")", "{", "IReaction", "reversedReaction", "=", "reaction", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IReaction", ".", "class", ")", ";", "if", "(", "reaction", ".", "getD...
Returns a new Reaction object which is the reverse of the given Reaction. @param reaction the reaction being considered @return the reverse reaction
[ "Returns", "a", "new", "Reaction", "object", "which", "is", "the", "reverse", "of", "the", "given", "Reaction", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java#L202-L222
114,614
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java
ReactionManipulator.getMappedChemObject
public static IChemObject getMappedChemObject(IReaction reaction, IChemObject chemObject) { for (IMapping mapping : reaction.mappings()) { if (mapping.getChemObject(0).equals(chemObject)) { return mapping.getChemObject(1); } else if (mapping.getChemObject(1).equals(chemOb...
java
public static IChemObject getMappedChemObject(IReaction reaction, IChemObject chemObject) { for (IMapping mapping : reaction.mappings()) { if (mapping.getChemObject(0).equals(chemObject)) { return mapping.getChemObject(1); } else if (mapping.getChemObject(1).equals(chemOb...
[ "public", "static", "IChemObject", "getMappedChemObject", "(", "IReaction", "reaction", ",", "IChemObject", "chemObject", ")", "{", "for", "(", "IMapping", "mapping", ":", "reaction", ".", "mappings", "(", ")", ")", "{", "if", "(", "mapping", ".", "getChemObje...
get the IAtom which is mapped @param reaction The IReaction which contains the mapping @param chemObject The IChemObject which will be searched its mapped IChemObject @return The mapped IChemObject
[ "get", "the", "IAtom", "which", "is", "mapped" ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java#L297-L304
114,615
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java
ReactionManipulator.assignRoleAndGrp
private static void assignRoleAndGrp(IAtomContainer mol, ReactionRole role, int grpId) { for (IAtom atom : mol.atoms()) { atom.setProperty(CDKConstants.REACTION_ROLE, role); atom.setProperty(CDKConstants.REACTION_GROUP, grpId); } }
java
private static void assignRoleAndGrp(IAtomContainer mol, ReactionRole role, int grpId) { for (IAtom atom : mol.atoms()) { atom.setProperty(CDKConstants.REACTION_ROLE, role); atom.setProperty(CDKConstants.REACTION_GROUP, grpId); } }
[ "private", "static", "void", "assignRoleAndGrp", "(", "IAtomContainer", "mol", ",", "ReactionRole", "role", ",", "int", "grpId", ")", "{", "for", "(", "IAtom", "atom", ":", "mol", ".", "atoms", "(", ")", ")", "{", "atom", ".", "setProperty", "(", "CDKCon...
Assigns a reaction role and group id to all atoms in a molecule. @param mol molecule @param role role to assign @param grpId group id
[ "Assigns", "a", "reaction", "role", "and", "group", "id", "to", "all", "atoms", "in", "a", "molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionManipulator.java#L313-L318
114,616
cdk/cdk
tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreAtom.java
PharmacophoreAtom.setMatchingAtoms
public void setMatchingAtoms(int[] atomIndices) { this.matchingAtoms = new int[atomIndices.length]; System.arraycopy(atomIndices, 0, this.matchingAtoms, 0, atomIndices.length); Arrays.sort(matchingAtoms); }
java
public void setMatchingAtoms(int[] atomIndices) { this.matchingAtoms = new int[atomIndices.length]; System.arraycopy(atomIndices, 0, this.matchingAtoms, 0, atomIndices.length); Arrays.sort(matchingAtoms); }
[ "public", "void", "setMatchingAtoms", "(", "int", "[", "]", "atomIndices", ")", "{", "this", ".", "matchingAtoms", "=", "new", "int", "[", "atomIndices", ".", "length", "]", ";", "System", ".", "arraycopy", "(", "atomIndices", ",", "0", ",", "this", ".",...
Set the atoms of a target molecule that correspond to this group. This method is generally only useful in the context of pharmacophore matching @param atomIndices The indicies of the atoms in a molecule that match the pattern for this group. @see #getMatchingAtoms() @see org.openscience.cdk.pharmacophore.Pharmacophor...
[ "Set", "the", "atoms", "of", "a", "target", "molecule", "that", "correspond", "to", "this", "group", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreAtom.java#L131-L135
114,617
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java
StereoTool.isSquarePlanar
public static boolean isSquarePlanar(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD) { Point3d pointA = atomA.getPoint3d(); Point3d pointB = atomB.getPoint3d(); Point3d pointC = atomC.getPoint3d(); Point3d pointD = atomD.getPoint3d(); return isSquarePlanar(pointA, pointB, po...
java
public static boolean isSquarePlanar(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD) { Point3d pointA = atomA.getPoint3d(); Point3d pointB = atomB.getPoint3d(); Point3d pointC = atomC.getPoint3d(); Point3d pointD = atomD.getPoint3d(); return isSquarePlanar(pointA, pointB, po...
[ "public", "static", "boolean", "isSquarePlanar", "(", "IAtom", "atomA", ",", "IAtom", "atomB", ",", "IAtom", "atomC", ",", "IAtom", "atomD", ")", "{", "Point3d", "pointA", "=", "atomA", ".", "getPoint3d", "(", ")", ";", "Point3d", "pointB", "=", "atomB", ...
Checks these four atoms for square planarity. @param atomA an atom in the plane @param atomB an atom in the plane @param atomC an atom in the plane @param atomD an atom in the plane @return true if all the atoms are in the same plane
[ "Checks", "these", "four", "atoms", "for", "square", "planarity", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java#L92-L99
114,618
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java
StereoTool.isOctahedral
public static boolean isOctahedral(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE, IAtom atomF, IAtom atomG) { Point3d pointA = atomA.getPoint3d(); Point3d pointB = atomB.getPoint3d(); Point3d pointC = atomC.getPoint3d(); Point3d pointD = atomD.getPoint3d(); ...
java
public static boolean isOctahedral(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE, IAtom atomF, IAtom atomG) { Point3d pointA = atomA.getPoint3d(); Point3d pointB = atomB.getPoint3d(); Point3d pointC = atomC.getPoint3d(); Point3d pointD = atomD.getPoint3d(); ...
[ "public", "static", "boolean", "isOctahedral", "(", "IAtom", "atomA", ",", "IAtom", "atomB", ",", "IAtom", "atomC", ",", "IAtom", "atomD", ",", "IAtom", "atomE", ",", "IAtom", "atomF", ",", "IAtom", "atomG", ")", "{", "Point3d", "pointA", "=", "atomA", "...
Checks these 7 atoms to see if they are at the points of an octahedron. @param atomA one of the axial atoms @param atomB the central atom @param atomC one of the equatorial atoms @param atomD one of the equatorial atoms @param atomE one of the equatorial atoms @param atomF one of the equatorial atoms @param atomG the ...
[ "Checks", "these", "7", "atoms", "to", "see", "if", "they", "are", "at", "the", "points", "of", "an", "octahedron", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java#L205-L229
114,619
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java
StereoTool.isTrigonalBipyramidal
public static boolean isTrigonalBipyramidal(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE, IAtom atomF) { Point3d pointA = atomA.getPoint3d(); Point3d pointB = atomB.getPoint3d(); Point3d pointC = atomC.getPoint3d(); Point3d pointD = atomD.getPoint3d(); ...
java
public static boolean isTrigonalBipyramidal(IAtom atomA, IAtom atomB, IAtom atomC, IAtom atomD, IAtom atomE, IAtom atomF) { Point3d pointA = atomA.getPoint3d(); Point3d pointB = atomB.getPoint3d(); Point3d pointC = atomC.getPoint3d(); Point3d pointD = atomD.getPoint3d(); ...
[ "public", "static", "boolean", "isTrigonalBipyramidal", "(", "IAtom", "atomA", ",", "IAtom", "atomB", ",", "IAtom", "atomC", ",", "IAtom", "atomD", ",", "IAtom", "atomE", ",", "IAtom", "atomF", ")", "{", "Point3d", "pointA", "=", "atomA", ".", "getPoint3d", ...
Checks these 6 atoms to see if they form a trigonal-bipyramidal shape. @param atomA one of the axial atoms @param atomB the central atom @param atomC one of the equatorial atoms @param atomD one of the equatorial atoms @param atomE one of the equatorial atoms @param atomF the other axial atom @return true if the geome...
[ "Checks", "these", "6", "atoms", "to", "see", "if", "they", "form", "a", "trigonal", "-", "bipyramidal", "shape", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java#L242-L268
114,620
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java
StereoTool.getStereo
public static Stereo getStereo(IAtom atom1, IAtom atom2, IAtom atom3, IAtom atom4) { // a normal is calculated for the base atoms (2, 3, 4) and compared to // the first atom. PLUS indicates ACW. TetrahedralSign sign = StereoTool.getHandedness(atom2, atom3, atom4, atom1); if (sign == Te...
java
public static Stereo getStereo(IAtom atom1, IAtom atom2, IAtom atom3, IAtom atom4) { // a normal is calculated for the base atoms (2, 3, 4) and compared to // the first atom. PLUS indicates ACW. TetrahedralSign sign = StereoTool.getHandedness(atom2, atom3, atom4, atom1); if (sign == Te...
[ "public", "static", "Stereo", "getStereo", "(", "IAtom", "atom1", ",", "IAtom", "atom2", ",", "IAtom", "atom3", ",", "IAtom", "atom4", ")", "{", "// a normal is calculated for the base atoms (2, 3, 4) and compared to", "// the first atom. PLUS indicates ACW.", "TetrahedralSig...
Take four atoms, and return Stereo.CLOCKWISE or Stereo.ANTI_CLOCKWISE. The first atom is the one pointing towards the observer. @param atom1 the atom pointing towards the observer @param atom2 the second atom (points away) @param atom3 the third atom (points away) @param atom4 the fourth atom (points away) @return clo...
[ "Take", "four", "atoms", "and", "return", "Stereo", ".", "CLOCKWISE", "or", "Stereo", ".", "ANTI_CLOCKWISE", ".", "The", "first", "atom", "is", "the", "one", "pointing", "towards", "the", "observer", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java#L280-L291
114,621
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java
StereoTool.signedDistanceToPlane
public static double signedDistanceToPlane(Vector3d planeNormal, Point3d pointInPlane, Point3d point) { if (planeNormal == null) return Double.NaN; Vector3d pointPointDiff = new Vector3d(); pointPointDiff.sub(point, pointInPlane); return planeNormal.dot(pointPointDiff); }
java
public static double signedDistanceToPlane(Vector3d planeNormal, Point3d pointInPlane, Point3d point) { if (planeNormal == null) return Double.NaN; Vector3d pointPointDiff = new Vector3d(); pointPointDiff.sub(point, pointInPlane); return planeNormal.dot(pointPointDiff); }
[ "public", "static", "double", "signedDistanceToPlane", "(", "Vector3d", "planeNormal", ",", "Point3d", "pointInPlane", ",", "Point3d", "point", ")", "{", "if", "(", "planeNormal", "==", "null", ")", "return", "Double", ".", "NaN", ";", "Vector3d", "pointPointDif...
Given a normalized normal for a plane, any point in that plane, and a point, will return the distance between the plane and that point. @param planeNormal the normalized plane normal @param pointInPlane an arbitrary point in that plane @param point the point to measure @return the signed distance to the plane
[ "Given", "a", "normalized", "normal", "for", "a", "plane", "any", "point", "in", "that", "plane", "and", "a", "point", "will", "return", "the", "distance", "between", "the", "plane", "and", "that", "point", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/stereo/StereoTool.java#L367-L373
114,622
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java
BoundsCalculator.calculateBounds
public static Rectangle2D calculateBounds(IChemModel chemModel) { IAtomContainerSet moleculeSet = chemModel.getMoleculeSet(); IReactionSet reactionSet = chemModel.getReactionSet(); Rectangle2D totalBounds = new Rectangle2D.Double(); if (moleculeSet != null) { totalBounds = to...
java
public static Rectangle2D calculateBounds(IChemModel chemModel) { IAtomContainerSet moleculeSet = chemModel.getMoleculeSet(); IReactionSet reactionSet = chemModel.getReactionSet(); Rectangle2D totalBounds = new Rectangle2D.Double(); if (moleculeSet != null) { totalBounds = to...
[ "public", "static", "Rectangle2D", "calculateBounds", "(", "IChemModel", "chemModel", ")", "{", "IAtomContainerSet", "moleculeSet", "=", "chemModel", ".", "getMoleculeSet", "(", ")", ";", "IReactionSet", "reactionSet", "=", "chemModel", ".", "getReactionSet", "(", "...
Calculate the bounding rectangle for a chem model. @param chemModel the chem model to use @return the bounding rectangle of the chem model
[ "Calculate", "the", "bounding", "rectangle", "for", "a", "chem", "model", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java#L52-L63
114,623
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java
BoundsCalculator.calculateBounds
public static Rectangle2D calculateBounds(IReactionSet reactionSet) { Rectangle2D totalBounds = new Rectangle2D.Double(); for (IReaction reaction : reactionSet.reactions()) { Rectangle2D reactionBounds = calculateBounds(reaction); if (totalBounds.isEmpty()) { tota...
java
public static Rectangle2D calculateBounds(IReactionSet reactionSet) { Rectangle2D totalBounds = new Rectangle2D.Double(); for (IReaction reaction : reactionSet.reactions()) { Rectangle2D reactionBounds = calculateBounds(reaction); if (totalBounds.isEmpty()) { tota...
[ "public", "static", "Rectangle2D", "calculateBounds", "(", "IReactionSet", "reactionSet", ")", "{", "Rectangle2D", "totalBounds", "=", "new", "Rectangle2D", ".", "Double", "(", ")", ";", "for", "(", "IReaction", "reaction", ":", "reactionSet", ".", "reactions", ...
Calculate the bounding rectangle for a reaction set. @param reactionSet the reaction set to use @return the bounding rectangle of the reaction set
[ "Calculate", "the", "bounding", "rectangle", "for", "a", "reaction", "set", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java#L71-L82
114,624
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java
BoundsCalculator.calculateBounds
public static Rectangle2D calculateBounds(IReaction reaction) { // get the participants in the reaction IAtomContainerSet reactants = reaction.getReactants(); IAtomContainerSet products = reaction.getProducts(); if (reactants == null || products == null) return null; // determin...
java
public static Rectangle2D calculateBounds(IReaction reaction) { // get the participants in the reaction IAtomContainerSet reactants = reaction.getReactants(); IAtomContainerSet products = reaction.getProducts(); if (reactants == null || products == null) return null; // determin...
[ "public", "static", "Rectangle2D", "calculateBounds", "(", "IReaction", "reaction", ")", "{", "// get the participants in the reaction", "IAtomContainerSet", "reactants", "=", "reaction", ".", "getReactants", "(", ")", ";", "IAtomContainerSet", "products", "=", "reaction"...
Calculate the bounding rectangle for a reaction. @param reaction the reaction to use @return the bounding rectangle of the reaction
[ "Calculate", "the", "bounding", "rectangle", "for", "a", "reaction", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java#L90-L99
114,625
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java
BoundsCalculator.calculateBounds
public static Rectangle2D calculateBounds(IAtomContainerSet moleculeSet) { Rectangle2D totalBounds = new Rectangle2D.Double(); for (int i = 0; i < moleculeSet.getAtomContainerCount(); i++) { IAtomContainer container = moleculeSet.getAtomContainer(i); Rectangle2D acBounds = calcul...
java
public static Rectangle2D calculateBounds(IAtomContainerSet moleculeSet) { Rectangle2D totalBounds = new Rectangle2D.Double(); for (int i = 0; i < moleculeSet.getAtomContainerCount(); i++) { IAtomContainer container = moleculeSet.getAtomContainer(i); Rectangle2D acBounds = calcul...
[ "public", "static", "Rectangle2D", "calculateBounds", "(", "IAtomContainerSet", "moleculeSet", ")", "{", "Rectangle2D", "totalBounds", "=", "new", "Rectangle2D", ".", "Double", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "moleculeSet", "....
Calculate the bounding rectangle for a molecule set. @param moleculeSet the molecule set to use @return the bounding rectangle of the molecule set
[ "Calculate", "the", "bounding", "rectangle", "for", "a", "molecule", "set", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java#L107-L119
114,626
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java
BoundsCalculator.calculateBounds
public static Rectangle2D calculateBounds(IAtomContainer atomContainer) { // this is essential, otherwise a rectangle // of (+INF, -INF, +INF, -INF) is returned! if (atomContainer.getAtomCount() == 0) { return new Rectangle2D.Double(); } else if (atomContainer.getAtomCount() ...
java
public static Rectangle2D calculateBounds(IAtomContainer atomContainer) { // this is essential, otherwise a rectangle // of (+INF, -INF, +INF, -INF) is returned! if (atomContainer.getAtomCount() == 0) { return new Rectangle2D.Double(); } else if (atomContainer.getAtomCount() ...
[ "public", "static", "Rectangle2D", "calculateBounds", "(", "IAtomContainer", "atomContainer", ")", "{", "// this is essential, otherwise a rectangle", "// of (+INF, -INF, +INF, -INF) is returned!", "if", "(", "atomContainer", ".", "getAtomCount", "(", ")", "==", "0", ")", "...
Calculate the bounding rectangle for an atom container. @param atomContainer the atom container to use @return the bounding rectangle of the atom container
[ "Calculate", "the", "bounding", "rectangle", "for", "an", "atom", "container", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/BoundsCalculator.java#L127-L158
114,627
cdk/cdk
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java
DescriptorEngine.getDictionaryType
public String getDictionaryType(String identifier) { Entry[] dictEntries = dict.getEntries(); String specRef = getSpecRef(identifier); logger.debug("Got identifier: " + identifier); logger.debug("Final spec ref: " + specRef); for (Entry dictEntry : dictEntries) { i...
java
public String getDictionaryType(String identifier) { Entry[] dictEntries = dict.getEntries(); String specRef = getSpecRef(identifier); logger.debug("Got identifier: " + identifier); logger.debug("Final spec ref: " + specRef); for (Entry dictEntry : dictEntries) { i...
[ "public", "String", "getDictionaryType", "(", "String", "identifier", ")", "{", "Entry", "[", "]", "dictEntries", "=", "dict", ".", "getEntries", "(", ")", ";", "String", "specRef", "=", "getSpecRef", "(", "identifier", ")", ";", "logger", ".", "debug", "(...
Returns the type of the descriptor as defined in the descriptor dictionary. The method will look for the identifier specified by the user in the QSAR descriptor dictionary. If a corresponding entry is found, first child element that is called "isClassifiedAs" is returned. Note that the OWL descriptor spec allows both ...
[ "Returns", "the", "type", "of", "the", "descriptor", "as", "defined", "in", "the", "descriptor", "dictionary", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java#L238-L268
114,628
cdk/cdk
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java
DescriptorEngine.getDictionaryDefinition
public String getDictionaryDefinition(String identifier) { Entry[] dictEntries = dict.getEntries(); String specRef = getSpecRef(identifier); if (specRef == null) { logger.error("Cannot determine specification for id: ", identifier); return ""; } String d...
java
public String getDictionaryDefinition(String identifier) { Entry[] dictEntries = dict.getEntries(); String specRef = getSpecRef(identifier); if (specRef == null) { logger.error("Cannot determine specification for id: ", identifier); return ""; } String d...
[ "public", "String", "getDictionaryDefinition", "(", "String", "identifier", ")", "{", "Entry", "[", "]", "dictEntries", "=", "dict", ".", "getEntries", "(", ")", ";", "String", "specRef", "=", "getSpecRef", "(", "identifier", ")", ";", "if", "(", "specRef", ...
Gets the definition of the descriptor. All descriptors in the descriptor dictioanry will have a definition element. This function returns the value of that element. Many descriptors also have a description element which is more detailed. However the value of these elements can contain arbitrary mark up (such as MathML...
[ "Gets", "the", "definition", "of", "the", "descriptor", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java#L380-L398
114,629
cdk/cdk
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java
DescriptorEngine.getAvailableDictionaryClasses
public String[] getAvailableDictionaryClasses() { List<String> classList = new ArrayList<String>(); for (IImplementationSpecification spec : speclist) { String[] tmp = getDictionaryClass(spec); if (tmp != null) classList.addAll(Arrays.asList(tmp)); } Set<String> u...
java
public String[] getAvailableDictionaryClasses() { List<String> classList = new ArrayList<String>(); for (IImplementationSpecification spec : speclist) { String[] tmp = getDictionaryClass(spec); if (tmp != null) classList.addAll(Arrays.asList(tmp)); } Set<String> u...
[ "public", "String", "[", "]", "getAvailableDictionaryClasses", "(", ")", "{", "List", "<", "String", ">", "classList", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "IImplementationSpecification", "spec", ":", "speclist", ")", "{", ...
Get the all the unique dictionary classes that the descriptors belong to. @return An array containing the unique dictionary classes.
[ "Get", "the", "all", "the", "unique", "dictionary", "classes", "that", "the", "descriptors", "belong", "to", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java#L505-L513
114,630
cdk/cdk
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java
DescriptorEngine.getDescriptorClassNameByInterface
public static List<String> getDescriptorClassNameByInterface(String interfaceName, String[] jarFileNames) { if (interfaceName == null || interfaceName.equals("")) interfaceName = "IDescriptor"; if (!interfaceName.equals("IDescriptor") && !interfaceName.equals("IMolecularDescriptor") && ...
java
public static List<String> getDescriptorClassNameByInterface(String interfaceName, String[] jarFileNames) { if (interfaceName == null || interfaceName.equals("")) interfaceName = "IDescriptor"; if (!interfaceName.equals("IDescriptor") && !interfaceName.equals("IMolecularDescriptor") && ...
[ "public", "static", "List", "<", "String", ">", "getDescriptorClassNameByInterface", "(", "String", "interfaceName", ",", "String", "[", "]", "jarFileNames", ")", "{", "if", "(", "interfaceName", "==", "null", "||", "interfaceName", ".", "equals", "(", "\"\"", ...
Returns a list containing the classes that implement a specific interface. The interface name specified can be null or an empty string. In this case the interface name is automatcally set to <i>IDescriptor</i>. Specifying <i>IDescriptor</i> will return all available descriptor classes. Valid interface names are <ul> ...
[ "Returns", "a", "list", "containing", "the", "classes", "that", "implement", "a", "specific", "interface", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java#L537-L596
114,631
cdk/cdk
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java
DescriptorEngine.getDescriptorClassNameByPackage
public static List<String> getDescriptorClassNameByPackage(String packageName, String[] jarFileNames) { if (packageName == null || packageName.equals("")) { packageName = "org.openscience.cdk.qsar.descriptors"; } String[] jars; if (jarFileNames == null) { String...
java
public static List<String> getDescriptorClassNameByPackage(String packageName, String[] jarFileNames) { if (packageName == null || packageName.equals("")) { packageName = "org.openscience.cdk.qsar.descriptors"; } String[] jars; if (jarFileNames == null) { String...
[ "public", "static", "List", "<", "String", ">", "getDescriptorClassNameByPackage", "(", "String", "packageName", ",", "String", "[", "]", "jarFileNames", ")", "{", "if", "(", "packageName", "==", "null", "||", "packageName", ".", "equals", "(", "\"\"", ")", ...
Returns a list containing the classes found in the specified descriptor package. The package name specified can be null or an empty string. In this case the package name is automatcally set to "org.openscience.cdk.qsar.descriptors" and as a result will return classes corresponding to both atomic and molecular descript...
[ "Returns", "a", "list", "containing", "the", "classes", "found", "in", "the", "specified", "descriptor", "package", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/DescriptorEngine.java#L613-L653
114,632
cdk/cdk
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/WienerNumbersDescriptor.java
WienerNumbersDescriptor.calculate
@Override public DescriptorValue calculate(IAtomContainer atomContainer) { wienerNumbers = new DoubleArrayResult(2); double wienerPathNumber = 0; //wienerPath double wienerPolarityNumber = 0; //wienerPol matr = ConnectionMatrix.getMatrix(AtomContainerManipulator.removeHydrogens(atom...
java
@Override public DescriptorValue calculate(IAtomContainer atomContainer) { wienerNumbers = new DoubleArrayResult(2); double wienerPathNumber = 0; //wienerPath double wienerPolarityNumber = 0; //wienerPol matr = ConnectionMatrix.getMatrix(AtomContainerManipulator.removeHydrogens(atom...
[ "@", "Override", "public", "DescriptorValue", "calculate", "(", "IAtomContainer", "atomContainer", ")", "{", "wienerNumbers", "=", "new", "DoubleArrayResult", "(", "2", ")", ";", "double", "wienerPathNumber", "=", "0", ";", "//wienerPath", "double", "wienerPolarityN...
Calculate the Wiener numbers. @param atomContainer The {@link IAtomContainer} for which this descriptor is to be calculated @return wiener numbers as array of 2 doubles
[ "Calculate", "the", "Wiener", "numbers", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/WienerNumbersDescriptor.java#L142-L168
114,633
cdk/cdk
app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java
Abbreviations.setEnabled
public boolean setEnabled(String label, boolean enabled) { return enabled ? labels.contains(label) && disabled.remove(label) : labels.contains(label) && disabled.add(label); }
java
public boolean setEnabled(String label, boolean enabled) { return enabled ? labels.contains(label) && disabled.remove(label) : labels.contains(label) && disabled.add(label); }
[ "public", "boolean", "setEnabled", "(", "String", "label", ",", "boolean", "enabled", ")", "{", "return", "enabled", "?", "labels", ".", "contains", "(", "label", ")", "&&", "disabled", ".", "remove", "(", "label", ")", ":", "labels", ".", "contains", "(...
Set whether an abbreviation is enabled or disabled. @param label the label (e.g. Ph, Et, Me, OAc, etc.) @param enabled flag the label as enabled or disabled @return the label state was modified
[ "Set", "whether", "an", "abbreviation", "is", "enabled", "or", "disabled", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java#L166-L169
114,634
cdk/cdk
app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java
Abbreviations.countUpper
private int countUpper(String str) { if (str == null) return 0; int num = 0; for (int i = 0; i < str.length(); i++) if (Character.isUpperCase(str.charAt(i))) num++; return num; }
java
private int countUpper(String str) { if (str == null) return 0; int num = 0; for (int i = 0; i < str.length(); i++) if (Character.isUpperCase(str.charAt(i))) num++; return num; }
[ "private", "int", "countUpper", "(", "String", "str", ")", "{", "if", "(", "str", "==", "null", ")", "return", "0", ";", "int", "num", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "str", ".", "length", "(", ")", ";", "i", ...
Count number of upper case chars.
[ "Count", "number", "of", "upper", "case", "chars", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java#L592-L600
114,635
cdk/cdk
app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java
Abbreviations.matchExact
private IQueryAtom matchExact(final IAtomContainer mol, final IAtom atom) { final IChemObjectBuilder bldr = atom.getBuilder(); int elem = atom.getAtomicNumber(); // attach atom skipped if (elem == 0) return null; int hcnt = atom.getImplicitHydrogenCount(); ...
java
private IQueryAtom matchExact(final IAtomContainer mol, final IAtom atom) { final IChemObjectBuilder bldr = atom.getBuilder(); int elem = atom.getAtomicNumber(); // attach atom skipped if (elem == 0) return null; int hcnt = atom.getImplicitHydrogenCount(); ...
[ "private", "IQueryAtom", "matchExact", "(", "final", "IAtomContainer", "mol", ",", "final", "IAtom", "atom", ")", "{", "final", "IChemObjectBuilder", "bldr", "=", "atom", ".", "getBuilder", "(", ")", ";", "int", "elem", "=", "atom", ".", "getAtomicNumber", "...
Make a query atom that matches atomic number, h count, valence, and connectivity. This effectively provides an exact match for that atom type. @param mol molecule @param atom atom of molecule @return the query atom (null if attachment point)
[ "Make", "a", "query", "atom", "that", "matches", "atomic", "number", "h", "count", "valence", "and", "connectivity", ".", "This", "effectively", "provides", "an", "exact", "match", "for", "that", "atom", "type", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java#L693-L718
114,636
cdk/cdk
app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java
Abbreviations.add
public boolean add(String line) throws InvalidSmilesException { return add(smipar.parseSmiles(line), getSmilesSuffix(line)); }
java
public boolean add(String line) throws InvalidSmilesException { return add(smipar.parseSmiles(line), getSmilesSuffix(line)); }
[ "public", "boolean", "add", "(", "String", "line", ")", "throws", "InvalidSmilesException", "{", "return", "add", "(", "smipar", ".", "parseSmiles", "(", "line", ")", ",", "getSmilesSuffix", "(", "line", ")", ")", ";", "}" ]
Convenience method to add an abbreviation from a SMILES string. @param line the smiles to add with a title (the label) @return the abbreviation was added, will be false if no title supplied @throws InvalidSmilesException the SMILES was not valid
[ "Convenience", "method", "to", "add", "an", "abbreviation", "from", "a", "SMILES", "string", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java#L786-L788
114,637
cdk/cdk
app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java
Abbreviations.loadFromFile
public int loadFromFile(final String path) throws IOException { InputStream in = null; try { in = getClass().getResourceAsStream(path); if (in != null) return loadSmiles(in); File file = new File(path); if (file.exists() && file.canRead()) ...
java
public int loadFromFile(final String path) throws IOException { InputStream in = null; try { in = getClass().getResourceAsStream(path); if (in != null) return loadSmiles(in); File file = new File(path); if (file.exists() && file.canRead()) ...
[ "public", "int", "loadFromFile", "(", "final", "String", "path", ")", "throws", "IOException", "{", "InputStream", "in", "=", "null", ";", "try", "{", "in", "=", "getClass", "(", ")", ".", "getResourceAsStream", "(", "path", ")", ";", "if", "(", "in", ...
Load a set of abbreviations from a classpath resource or file in SMILES format. The title is seperated by a space. <pre> *c1ccccc1 Ph *c1ccccc1 OAc </pre> <p> Available: <dl> <dt>obabel_superatoms.smi</dt> <dd><a href="https://www.github.com/openbabel/superatoms"><code>https://www.github.com/openbabel/superatoms</code...
[ "Load", "a", "set", "of", "abbreviations", "from", "a", "classpath", "resource", "or", "file", "in", "SMILES", "format", ".", "The", "title", "is", "seperated", "by", "a", "space", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Abbreviations.java#L906-L920
114,638
cdk/cdk
display/render/src/main/java/org/openscience/cdk/renderer/color/RasmolColors.java
RasmolColors.getAtomColor
@Override public Color getAtomColor(IAtom atom, Color defaultColor) { Color color = defaultColor; String symbol = atom.getSymbol(); if (colorMap.containsKey(symbol)) { color = colorMap.get(symbol); } return color; }
java
@Override public Color getAtomColor(IAtom atom, Color defaultColor) { Color color = defaultColor; String symbol = atom.getSymbol(); if (colorMap.containsKey(symbol)) { color = colorMap.get(symbol); } return color; }
[ "@", "Override", "public", "Color", "getAtomColor", "(", "IAtom", "atom", ",", "Color", "defaultColor", ")", "{", "Color", "color", "=", "defaultColor", ";", "String", "symbol", "=", "atom", ".", "getSymbol", "(", ")", ";", "if", "(", "colorMap", ".", "c...
Returns the Rasmol color for the given atom's element, or defaults to the given color if no color is defined. @param atom IAtom to get a color for @param defaultColor Color returned if this scheme does not define a color for the passed IAtom @return the atom's color according to this coloring schem...
[ "Returns", "the", "Rasmol", "color", "for", "the", "given", "atom", "s", "element", "or", "defaults", "to", "the", "given", "color", "if", "no", "color", "is", "defined", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/color/RasmolColors.java#L101-L109
114,639
cdk/cdk
base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/StereoMatch.java
StereoMatch.findHydrogen
private IAtom findHydrogen(final IAtom[] atoms) { for (final IAtom a : atoms) { if (Integer.valueOf(1).equals(a.getAtomicNumber())) return a; } return null; }
java
private IAtom findHydrogen(final IAtom[] atoms) { for (final IAtom a : atoms) { if (Integer.valueOf(1).equals(a.getAtomicNumber())) return a; } return null; }
[ "private", "IAtom", "findHydrogen", "(", "final", "IAtom", "[", "]", "atoms", ")", "{", "for", "(", "final", "IAtom", "a", ":", "atoms", ")", "{", "if", "(", "Integer", ".", "valueOf", "(", "1", ")", ".", "equals", "(", "a", ".", "getAtomicNumber", ...
Given an array of atoms, find the first hydrogen atom. @param atoms array of non-null atoms. @return a hydrogen atom
[ "Given", "an", "array", "of", "atoms", "find", "the", "first", "hydrogen", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/StereoMatch.java#L263-L268
114,640
cdk/cdk
legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java
MoleculeBuilder.buildChain
private IAtomContainer buildChain(int length, boolean isMainCyclic) { IAtomContainer currentChain; if (length > 0) { //If is cyclic if (isMainCyclic) { //Rely on CDK's ring class constructor to generate our cyclic molecules. currentChain = currentM...
java
private IAtomContainer buildChain(int length, boolean isMainCyclic) { IAtomContainer currentChain; if (length > 0) { //If is cyclic if (isMainCyclic) { //Rely on CDK's ring class constructor to generate our cyclic molecules. currentChain = currentM...
[ "private", "IAtomContainer", "buildChain", "(", "int", "length", ",", "boolean", "isMainCyclic", ")", "{", "IAtomContainer", "currentChain", ";", "if", "(", "length", ">", "0", ")", "{", "//If is cyclic", "if", "(", "isMainCyclic", ")", "{", "//Rely on CDK's rin...
Builds the main chain which may act as a foundation for futher working groups. @param mainChain The parsed prefix which depicts the chain's length. @param isMainCyclic A flag to show if the molecule is a ring. 0 means not a ring, 1 means is a ring. @return A Molecule containing the requested chain.
[ "Builds", "the", "main", "chain", "which", "may", "act", "as", "a", "foundation", "for", "futher", "working", "groups", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java#L80-L97
114,641
cdk/cdk
legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java
MoleculeBuilder.getMetalAtomicSymbol
String getMetalAtomicSymbol(String metalName) { if ("aluminium".equals(metalName)) { return "Al"; } else if ("magnesium".equals(metalName)) { return "Mg"; } else if ("gallium".equals(metalName)) { return "Ga"; } else if ("indium".equals(metalName)) { ...
java
String getMetalAtomicSymbol(String metalName) { if ("aluminium".equals(metalName)) { return "Al"; } else if ("magnesium".equals(metalName)) { return "Mg"; } else if ("gallium".equals(metalName)) { return "Ga"; } else if ("indium".equals(metalName)) { ...
[ "String", "getMetalAtomicSymbol", "(", "String", "metalName", ")", "{", "if", "(", "\"aluminium\"", ".", "equals", "(", "metalName", ")", ")", "{", "return", "\"Al\"", ";", "}", "else", "if", "(", "\"magnesium\"", ".", "equals", "(", "metalName", ")", ")",...
Translates a metal's name into it's atomic symbol. @param metalName The name of the metal, e.g. lead @return The given metal's atomic symbol e.g. Pb or null if none exist.
[ "Translates", "a", "metal", "s", "name", "into", "it", "s", "atomic", "symbol", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java#L341-L367
114,642
cdk/cdk
legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java
MoleculeBuilder.addAtom
private void addAtom(String newAtomType, IAtom otherConnectingAtom, Order bondOrder, int hydrogenCount) { //Create the new atom and bond. IAtom newAtom = currentMolecule.getBuilder().newInstance(IAtom.class, newAtomType); newAtom.setImplicitHydrogenCount(hydrogenCount); IBond newBond = c...
java
private void addAtom(String newAtomType, IAtom otherConnectingAtom, Order bondOrder, int hydrogenCount) { //Create the new atom and bond. IAtom newAtom = currentMolecule.getBuilder().newInstance(IAtom.class, newAtomType); newAtom.setImplicitHydrogenCount(hydrogenCount); IBond newBond = c...
[ "private", "void", "addAtom", "(", "String", "newAtomType", ",", "IAtom", "otherConnectingAtom", ",", "Order", "bondOrder", ",", "int", "hydrogenCount", ")", "{", "//Create the new atom and bond.", "IAtom", "newAtom", "=", "currentMolecule", ".", "getBuilder", "(", ...
Adds an atom to the current molecule. @param newAtomType The atomic symbol for the atom. @param otherConnectingAtom An atom already in the molecule which the new one should connect to. @param bondOrder The order of the bond to use to join the two atoms. @param hydrogenCount The number of hydrogen atoms connected to th...
[ "Adds", "an", "atom", "to", "the", "current", "molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java#L378-L387
114,643
cdk/cdk
legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java
MoleculeBuilder.addHeads
private void addHeads(List<AttachedGroup> attachedSubstituents) { Iterator<AttachedGroup> substituentsIterator = attachedSubstituents.iterator(); while (substituentsIterator.hasNext()) { AttachedGroup attachedSubstituent = substituentsIterator.next(); Iterator<Token> locationsIt...
java
private void addHeads(List<AttachedGroup> attachedSubstituents) { Iterator<AttachedGroup> substituentsIterator = attachedSubstituents.iterator(); while (substituentsIterator.hasNext()) { AttachedGroup attachedSubstituent = substituentsIterator.next(); Iterator<Token> locationsIt...
[ "private", "void", "addHeads", "(", "List", "<", "AttachedGroup", ">", "attachedSubstituents", ")", "{", "Iterator", "<", "AttachedGroup", ">", "substituentsIterator", "=", "attachedSubstituents", ".", "iterator", "(", ")", ";", "while", "(", "substituentsIterator",...
Adds other chains to the main chain connected at the specified atom. @param attachedSubstituents A vector of AttachedGroup's representing substituents.
[ "Adds", "other", "chains", "to", "the", "main", "chain", "connected", "at", "the", "specified", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java#L394-L422
114,644
cdk/cdk
legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java
MoleculeBuilder.buildMolecule
protected IAtomContainer buildMolecule(int mainChain, List<AttachedGroup> attachedSubstituents, List<AttachedGroup> attachedGroups, boolean isMainCyclic, String name) throws ParseException, CDKException { //Set up the molecle's name currentMolecule.setID(name); //Build the main chain...
java
protected IAtomContainer buildMolecule(int mainChain, List<AttachedGroup> attachedSubstituents, List<AttachedGroup> attachedGroups, boolean isMainCyclic, String name) throws ParseException, CDKException { //Set up the molecle's name currentMolecule.setID(name); //Build the main chain...
[ "protected", "IAtomContainer", "buildMolecule", "(", "int", "mainChain", ",", "List", "<", "AttachedGroup", ">", "attachedSubstituents", ",", "List", "<", "AttachedGroup", ">", "attachedGroups", ",", "boolean", "isMainCyclic", ",", "String", "name", ")", "throws", ...
Start of the process of building a molecule from the parsed data. Passes the parsed tokens to other functions which build up the Molecule. @param mainChain The string representation of the length of the main chain. @param attachedSubstituents A vector of AttachedGroup's representing substituents. @param attachedGroups...
[ "Start", "of", "the", "process", "of", "building", "a", "molecule", "from", "the", "parsed", "data", ".", "Passes", "the", "parsed", "tokens", "to", "other", "functions", "which", "build", "up", "the", "Molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/iupac/parser/MoleculeBuilder.java#L434-L463
114,645
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getAtomCount
public static int getAtomCount(IMolecularFormula formula) { int count = 0; for (IIsotope isotope : formula.isotopes()) { count += formula.getIsotopeCount(isotope); } return count; }
java
public static int getAtomCount(IMolecularFormula formula) { int count = 0; for (IIsotope isotope : formula.isotopes()) { count += formula.getIsotopeCount(isotope); } return count; }
[ "public", "static", "int", "getAtomCount", "(", "IMolecularFormula", "formula", ")", "{", "int", "count", "=", "0", ";", "for", "(", "IIsotope", "isotope", ":", "formula", ".", "isotopes", "(", ")", ")", "{", "count", "+=", "formula", ".", "getIsotopeCount...
Checks a set of Nodes for the occurrence of each isotopes instance in the molecular formula. In short number of atoms. @param formula The MolecularFormula to check @return The occurrence total
[ "Checks", "a", "set", "of", "Nodes", "for", "the", "occurrence", "of", "each", "isotopes", "instance", "in", "the", "molecular", "formula", ".", "In", "short", "number", "of", "atoms", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L109-L116
114,646
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getElementCount
public static int getElementCount(IMolecularFormula formula, IElement element) { int count = 0; for (IIsotope isotope : formula.isotopes()) { if (isotope.getSymbol().equals(element.getSymbol())) count += formula.getIsotopeCount(isotope); } return count; }
java
public static int getElementCount(IMolecularFormula formula, IElement element) { int count = 0; for (IIsotope isotope : formula.isotopes()) { if (isotope.getSymbol().equals(element.getSymbol())) count += formula.getIsotopeCount(isotope); } return count; }
[ "public", "static", "int", "getElementCount", "(", "IMolecularFormula", "formula", ",", "IElement", "element", ")", "{", "int", "count", "=", "0", ";", "for", "(", "IIsotope", "isotope", ":", "formula", ".", "isotopes", "(", ")", ")", "{", "if", "(", "is...
Checks a set of Nodes for the occurrence of the isotopes in the molecular formula from a particular IElement. It returns 0 if the element does not exist. The search is based only on the IElement. @param formula The MolecularFormula to check @param element The IElement object @return The occurrence of this...
[ "Checks", "a", "set", "of", "Nodes", "for", "the", "occurrence", "of", "the", "isotopes", "in", "the", "molecular", "formula", "from", "a", "particular", "IElement", ".", "It", "returns", "0", "if", "the", "element", "does", "not", "exist", ".", "The", "...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L127-L134
114,647
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getElementCount
public static int getElementCount(IMolecularFormula formula, IIsotope isotope) { return getElementCount(formula, formula.getBuilder().newInstance(IElement.class, isotope)); }
java
public static int getElementCount(IMolecularFormula formula, IIsotope isotope) { return getElementCount(formula, formula.getBuilder().newInstance(IElement.class, isotope)); }
[ "public", "static", "int", "getElementCount", "(", "IMolecularFormula", "formula", ",", "IIsotope", "isotope", ")", "{", "return", "getElementCount", "(", "formula", ",", "formula", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IElement", ".", "class", ...
Occurrences of a given element from an isotope in a molecular formula. @param formula the formula @param isotope isotope of an element @return number of the times the element occurs @see #getElementCount(IMolecularFormula, IElement)
[ "Occurrences", "of", "a", "given", "element", "from", "an", "isotope", "in", "a", "molecular", "formula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L144-L146
114,648
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getElementCount
public static int getElementCount(IMolecularFormula formula, String symbol) { return getElementCount(formula, formula.getBuilder().newInstance(IElement.class, symbol)); }
java
public static int getElementCount(IMolecularFormula formula, String symbol) { return getElementCount(formula, formula.getBuilder().newInstance(IElement.class, symbol)); }
[ "public", "static", "int", "getElementCount", "(", "IMolecularFormula", "formula", ",", "String", "symbol", ")", "{", "return", "getElementCount", "(", "formula", ",", "formula", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IElement", ".", "class", "...
Occurrences of a given element in a molecular formula. @param formula the formula @param symbol element symbol (e.g. C for carbon) @return number of the times the element occurs @see #getElementCount(IMolecularFormula, IElement)
[ "Occurrences", "of", "a", "given", "element", "in", "a", "molecular", "formula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L156-L158
114,649
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getIsotopes
public static List<IIsotope> getIsotopes(IMolecularFormula formula, IElement element) { List<IIsotope> isotopeList = new ArrayList<IIsotope>(); for (IIsotope isotope : formula.isotopes()) { if (isotope.getSymbol().equals(element.getSymbol())) isotopeList.add(isotope); } ret...
java
public static List<IIsotope> getIsotopes(IMolecularFormula formula, IElement element) { List<IIsotope> isotopeList = new ArrayList<IIsotope>(); for (IIsotope isotope : formula.isotopes()) { if (isotope.getSymbol().equals(element.getSymbol())) isotopeList.add(isotope); } ret...
[ "public", "static", "List", "<", "IIsotope", ">", "getIsotopes", "(", "IMolecularFormula", "formula", ",", "IElement", "element", ")", "{", "List", "<", "IIsotope", ">", "isotopeList", "=", "new", "ArrayList", "<", "IIsotope", ">", "(", ")", ";", "for", "(...
Get a list of IIsotope from a given IElement which is contained molecular. The search is based only on the IElement. @param formula The MolecularFormula to check @param element The IElement object @return The list with the IIsotopes in this molecular formula
[ "Get", "a", "list", "of", "IIsotope", "from", "a", "given", "IElement", "which", "is", "contained", "molecular", ".", "The", "search", "is", "based", "only", "on", "the", "IElement", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L168-L176
114,650
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.elements
public static List<IElement> elements(IMolecularFormula formula) { List<IElement> elementList = new ArrayList<IElement>(); List<String> stringList = new ArrayList<String>(); for (IIsotope isotope : formula.isotopes()) { if (!stringList.contains(isotope.getSymbol())) { ...
java
public static List<IElement> elements(IMolecularFormula formula) { List<IElement> elementList = new ArrayList<IElement>(); List<String> stringList = new ArrayList<String>(); for (IIsotope isotope : formula.isotopes()) { if (!stringList.contains(isotope.getSymbol())) { ...
[ "public", "static", "List", "<", "IElement", ">", "elements", "(", "IMolecularFormula", "formula", ")", "{", "List", "<", "IElement", ">", "elementList", "=", "new", "ArrayList", "<", "IElement", ">", "(", ")", ";", "List", "<", "String", ">", "stringList"...
Get a list of all Elements which are contained molecular. @param formula The MolecularFormula to check @return The list with the IElements in this molecular formula
[ "Get", "a", "list", "of", "all", "Elements", "which", "are", "contained", "molecular", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L185-L197
114,651
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.containsElement
public static boolean containsElement(IMolecularFormula formula, IElement element) { for (IIsotope isotope : formula.isotopes()) { if (element.getSymbol().equals(isotope.getSymbol())) return true; } return false; }
java
public static boolean containsElement(IMolecularFormula formula, IElement element) { for (IIsotope isotope : formula.isotopes()) { if (element.getSymbol().equals(isotope.getSymbol())) return true; } return false; }
[ "public", "static", "boolean", "containsElement", "(", "IMolecularFormula", "formula", ",", "IElement", "element", ")", "{", "for", "(", "IIsotope", "isotope", ":", "formula", ".", "isotopes", "(", ")", ")", "{", "if", "(", "element", ".", "getSymbol", "(", ...
True, if the MolecularFormula contains the given element as IIsotope object. @param formula IMolecularFormula molecularFormula @param element The element this MolecularFormula is searched for @return True, if the MolecularFormula contains the given element object
[ "True", "if", "the", "MolecularFormula", "contains", "the", "given", "element", "as", "IIsotope", "object", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L206-L213
114,652
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.removeElement
public static IMolecularFormula removeElement(IMolecularFormula formula, IElement element) { for (IIsotope isotope : getIsotopes(formula, element)) { formula.removeIsotope(isotope); } return formula; }
java
public static IMolecularFormula removeElement(IMolecularFormula formula, IElement element) { for (IIsotope isotope : getIsotopes(formula, element)) { formula.removeIsotope(isotope); } return formula; }
[ "public", "static", "IMolecularFormula", "removeElement", "(", "IMolecularFormula", "formula", ",", "IElement", "element", ")", "{", "for", "(", "IIsotope", "isotope", ":", "getIsotopes", "(", "formula", ",", "element", ")", ")", "{", "formula", ".", "removeIsot...
Removes all isotopes from a given element in the MolecularFormula. @param formula IMolecularFormula molecularFormula @param element The IElement of the IIsotopes to be removed @return The molecularFormula with the isotopes removed
[ "Removes", "all", "isotopes", "from", "a", "given", "element", "in", "the", "MolecularFormula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L222-L227
114,653
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getString
public static String getString(IMolecularFormula formula, boolean setOne) { if (containsElement(formula, formula.getBuilder().newInstance(IElement.class, "C"))) return getString(formula, generateOrderEle_Hill_WithCarbons(), setOne, false); else return getString(formula, generate...
java
public static String getString(IMolecularFormula formula, boolean setOne) { if (containsElement(formula, formula.getBuilder().newInstance(IElement.class, "C"))) return getString(formula, generateOrderEle_Hill_WithCarbons(), setOne, false); else return getString(formula, generate...
[ "public", "static", "String", "getString", "(", "IMolecularFormula", "formula", ",", "boolean", "setOne", ")", "{", "if", "(", "containsElement", "(", "formula", ",", "formula", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IElement", ".", "class", ...
Returns the string representation of the molecular formula. Based on Hill System. The Hill system is a system of writing chemical formulas such that the number of carbon atoms in a molecule is indicated first, the number of hydrogen atoms next, and then the number of all other chemical elements subsequently, in alphabe...
[ "Returns", "the", "string", "representation", "of", "the", "molecular", "formula", ".", "Based", "on", "Hill", "System", ".", "The", "Hill", "system", "is", "a", "system", "of", "writing", "chemical", "formulas", "such", "that", "the", "number", "of", "carbo...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L363-L369
114,654
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getMajorIsotopeMolecularFormula
public static IMolecularFormula getMajorIsotopeMolecularFormula(String stringMF, IChemObjectBuilder builder) { return getMolecularFormula(stringMF, true, builder); }
java
public static IMolecularFormula getMajorIsotopeMolecularFormula(String stringMF, IChemObjectBuilder builder) { return getMolecularFormula(stringMF, true, builder); }
[ "public", "static", "IMolecularFormula", "getMajorIsotopeMolecularFormula", "(", "String", "stringMF", ",", "IChemObjectBuilder", "builder", ")", "{", "return", "getMolecularFormula", "(", "stringMF", ",", "true", ",", "builder", ")", ";", "}" ]
Construct an instance of IMolecularFormula, initialized with a molecular formula string. The string is immediately analyzed and a set of Nodes is built based on this analysis. The hydrogens must be implicit. Major isotopes are being used. @param stringMF The molecularFormula string @param builder a IChemObjectBuild...
[ "Construct", "an", "instance", "of", "IMolecularFormula", "initialized", "with", "a", "molecular", "formula", "string", ".", "The", "string", "is", "immediately", "analyzed", "and", "a", "set", "of", "Nodes", "is", "built", "based", "on", "this", "analysis", "...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L591-L593
114,655
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getMolecularFormula
private static IMolecularFormula getMolecularFormula(String stringMF, IMolecularFormula formula, boolean assumeMajorIsotope) { if (stringMF.contains(".") || stringMF.contains("(") || stringMF.length() > 0 && stringMF.charAt(0) >= '0' && stringMF.charAt(0) <= '9') stringMF = simplifyMole...
java
private static IMolecularFormula getMolecularFormula(String stringMF, IMolecularFormula formula, boolean assumeMajorIsotope) { if (stringMF.contains(".") || stringMF.contains("(") || stringMF.length() > 0 && stringMF.charAt(0) >= '0' && stringMF.charAt(0) <= '9') stringMF = simplifyMole...
[ "private", "static", "IMolecularFormula", "getMolecularFormula", "(", "String", "stringMF", ",", "IMolecularFormula", "formula", ",", "boolean", "assumeMajorIsotope", ")", "{", "if", "(", "stringMF", ".", "contains", "(", "\".\"", ")", "||", "stringMF", ".", "cont...
Add to an instance of IMolecularFormula the elements extracts form molecular formula string. The string is immediately analyzed and a set of Nodes is built based on this analysis. The hydrogens are assumed to be implicit. The boolean indicates if the major isotope is to be assumed, or if no assumption is to be made. @...
[ "Add", "to", "an", "instance", "of", "IMolecularFormula", "the", "elements", "extracts", "form", "molecular", "formula", "string", ".", "The", "string", "is", "immediately", "analyzed", "and", "a", "set", "of", "Nodes", "is", "built", "based", "on", "this", ...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L724-L751
114,656
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.correctMass
private static double correctMass(double mass, Integer charge) { if (charge == null) return mass; double massE = 0.00054857990927; if (charge > 0) mass -= massE * charge; else if (charge < 0) mass += massE * Math.abs(charge); return mass; }
java
private static double correctMass(double mass, Integer charge) { if (charge == null) return mass; double massE = 0.00054857990927; if (charge > 0) mass -= massE * charge; else if (charge < 0) mass += massE * Math.abs(charge); return mass; }
[ "private", "static", "double", "correctMass", "(", "double", "mass", ",", "Integer", "charge", ")", "{", "if", "(", "charge", "==", "null", ")", "return", "mass", ";", "double", "massE", "=", "0.00054857990927", ";", "if", "(", "charge", ">", "0", ")", ...
Correct the mass according the charge of the IMmoleculeFormula. Negative charge will add the mass of one electron to the mass. @param mass The mass to correct @param charge The charge @return The mass with the correction
[ "Correct", "the", "mass", "according", "the", "charge", "of", "the", "IMmoleculeFormula", ".", "Negative", "charge", "will", "add", "the", "mass", "of", "one", "electron", "to", "the", "mass", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L825-L833
114,657
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getTotalMassNumber
public static double getTotalMassNumber(IMolecularFormula formula) { double mass = 0.0; for (IIsotope isotope : formula.isotopes()) { try { IIsotope isotope2 = Isotopes.getInstance().getMajorIsotope(isotope.getSymbol()); if (isotope2 != null) { ...
java
public static double getTotalMassNumber(IMolecularFormula formula) { double mass = 0.0; for (IIsotope isotope : formula.isotopes()) { try { IIsotope isotope2 = Isotopes.getInstance().getMajorIsotope(isotope.getSymbol()); if (isotope2 != null) { ...
[ "public", "static", "double", "getTotalMassNumber", "(", "IMolecularFormula", "formula", ")", "{", "double", "mass", "=", "0.0", ";", "for", "(", "IIsotope", "isotope", ":", "formula", ".", "isotopes", "(", ")", ")", "{", "try", "{", "IIsotope", "isotope2", ...
Get the summed mass number of all isotopes from an MolecularFormula. It assumes isotope masses to be preset, and returns 0.0 if not. @param formula The IMolecularFormula to calculate @return The summed nominal mass of all atoms in this MolecularFormula
[ "Get", "the", "summed", "mass", "number", "of", "all", "isotopes", "from", "an", "MolecularFormula", ".", "It", "assumes", "isotope", "masses", "to", "be", "preset", "and", "returns", "0", ".", "0", "if", "not", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L842-L855
114,658
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getTotalNaturalAbundance
public static double getTotalNaturalAbundance(IMolecularFormula formula) { double abundance = 1.0; for (IIsotope isotope : formula.isotopes()) { if (isotope.getNaturalAbundance() == null) return 0.0; abundance = abundance * Math.pow(isotope.getNaturalAbundance(), formula.getIsoto...
java
public static double getTotalNaturalAbundance(IMolecularFormula formula) { double abundance = 1.0; for (IIsotope isotope : formula.isotopes()) { if (isotope.getNaturalAbundance() == null) return 0.0; abundance = abundance * Math.pow(isotope.getNaturalAbundance(), formula.getIsoto...
[ "public", "static", "double", "getTotalNaturalAbundance", "(", "IMolecularFormula", "formula", ")", "{", "double", "abundance", "=", "1.0", ";", "for", "(", "IIsotope", "isotope", ":", "formula", ".", "isotopes", "(", ")", ")", "{", "if", "(", "isotope", "."...
Get the summed natural abundance of all isotopes from an MolecularFormula. Assumes abundances to be preset, and will return 0.0 if not. @param formula The IMolecularFormula to calculate @return The summed natural abundance of all isotopes in this MolecularFormula
[ "Get", "the", "summed", "natural", "abundance", "of", "all", "isotopes", "from", "an", "MolecularFormula", ".", "Assumes", "abundances", "to", "be", "preset", "and", "will", "return", "0", ".", "0", "if", "not", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L1004-L1011
114,659
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.getDBE
public static double getDBE(IMolecularFormula formula) throws CDKException { int valencies[] = new int[5]; IAtomContainer ac = getAtomContainer(formula); AtomTypeFactory factory = AtomTypeFactory.getInstance( "org/openscience/cdk/config/data/structgen_atomtypes.xml", ac.getBuilde...
java
public static double getDBE(IMolecularFormula formula) throws CDKException { int valencies[] = new int[5]; IAtomContainer ac = getAtomContainer(formula); AtomTypeFactory factory = AtomTypeFactory.getInstance( "org/openscience/cdk/config/data/structgen_atomtypes.xml", ac.getBuilde...
[ "public", "static", "double", "getDBE", "(", "IMolecularFormula", "formula", ")", "throws", "CDKException", "{", "int", "valencies", "[", "]", "=", "new", "int", "[", "5", "]", ";", "IAtomContainer", "ac", "=", "getAtomContainer", "(", "formula", ")", ";", ...
Returns the number of double bond equivalents in this molecule. @param formula The IMolecularFormula to calculate @return The number of DBEs @throws CDKException if DBE cannot be be evaluated @cdk.keyword DBE @cdk.keyword double bond equivalent
[ "Returns", "the", "number", "of", "double", "bond", "equivalents", "in", "this", "molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L1023-L1039
114,660
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.compare
public static boolean compare(IMolecularFormula formula1, IMolecularFormula formula2) { if (!Objects.equals(formula1.getCharge(), formula2.getCharge())) return false; if (formula1.getIsotopeCount() != formula2.getIsotopeCount()) return false; for (IIsotope isotope : formula1.isotopes()) { ...
java
public static boolean compare(IMolecularFormula formula1, IMolecularFormula formula2) { if (!Objects.equals(formula1.getCharge(), formula2.getCharge())) return false; if (formula1.getIsotopeCount() != formula2.getIsotopeCount()) return false; for (IIsotope isotope : formula1.isotopes()) { ...
[ "public", "static", "boolean", "compare", "(", "IMolecularFormula", "formula1", ",", "IMolecularFormula", "formula2", ")", "{", "if", "(", "!", "Objects", ".", "equals", "(", "formula1", ".", "getCharge", "(", ")", ",", "formula2", ".", "getCharge", "(", ")"...
Compare two IMolecularFormula looking at type and number of IIsotope and charge of the formula. @param formula1 The first IMolecularFormula @param formula2 The second IMolecularFormula @return True, if the both IMolecularFormula are the same
[ "Compare", "two", "IMolecularFormula", "looking", "at", "type", "and", "number", "of", "IIsotope", "and", "charge", "of", "the", "formula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L1217-L1236
114,661
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.muliplier
private static String muliplier(String formula, int factor) { String finalformula = ""; String recentElementSymbol = ""; String recentElementCountString = "0"; for (int f = 0; f < formula.length(); f++) { char thisChar = formula.charAt(f); if (f < formula.length()...
java
private static String muliplier(String formula, int factor) { String finalformula = ""; String recentElementSymbol = ""; String recentElementCountString = "0"; for (int f = 0; f < formula.length(); f++) { char thisChar = formula.charAt(f); if (f < formula.length()...
[ "private", "static", "String", "muliplier", "(", "String", "formula", ",", "int", "factor", ")", "{", "String", "finalformula", "=", "\"\"", ";", "String", "recentElementSymbol", "=", "\"\"", ";", "String", "recentElementCountString", "=", "\"0\"", ";", "for", ...
This method multiply all the element over a value. @param formula Formula to correct @param factor Factor to multiply @return Formula with the correction
[ "This", "method", "multiply", "all", "the", "element", "over", "a", "value", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L1431-L1458
114,662
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java
MolecularFormulaManipulator.adjustProtonation
public static boolean adjustProtonation(IMolecularFormula mf, int hcnt) { if (mf == null) throw new NullPointerException("No formula provided"); if (hcnt == 0) return false; // no protons to add final IChemObjectBuilder bldr = mf.getBuilder(); final int chg = mf.getCharg...
java
public static boolean adjustProtonation(IMolecularFormula mf, int hcnt) { if (mf == null) throw new NullPointerException("No formula provided"); if (hcnt == 0) return false; // no protons to add final IChemObjectBuilder bldr = mf.getBuilder(); final int chg = mf.getCharg...
[ "public", "static", "boolean", "adjustProtonation", "(", "IMolecularFormula", "mf", ",", "int", "hcnt", ")", "{", "if", "(", "mf", "==", "null", ")", "throw", "new", "NullPointerException", "(", "\"No formula provided\"", ")", ";", "if", "(", "hcnt", "==", "...
Adjust the protonation of a molecular formula. This utility method adjusts the hydrogen isotope count and charge at the same time. <pre> IMolecularFormula mf = MolecularFormulaManipulator.getMolecularFormula("[C6H5O]-", bldr); MolecularFormulaManipulator.adjustProtonation(mf, +1); // now "C6H6O" MolecularFormulaManipu...
[ "Adjust", "the", "protonation", "of", "a", "molecular", "formula", ".", "This", "utility", "method", "adjusts", "the", "hydrogen", "isotope", "count", "and", "charge", "at", "the", "same", "time", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaManipulator.java#L1487-L1532
114,663
cdk/cdk
tool/hash/src/main/java/org/openscience/cdk/hash/stereo/DoubleBondElementEncoderFactory.java
DoubleBondElementEncoderFactory.findOther
private static int findOther(int[] vs, int u, int x) { for (int v : vs) { if (v != u && v != x) return v; } throw new IllegalArgumentException("vs[] did not contain another vertex"); }
java
private static int findOther(int[] vs, int u, int x) { for (int v : vs) { if (v != u && v != x) return v; } throw new IllegalArgumentException("vs[] did not contain another vertex"); }
[ "private", "static", "int", "findOther", "(", "int", "[", "]", "vs", ",", "int", "u", ",", "int", "x", ")", "{", "for", "(", "int", "v", ":", "vs", ")", "{", "if", "(", "v", "!=", "u", "&&", "v", "!=", "x", ")", "return", "v", ";", "}", "...
Finds a vertex in 'vs' which is not 'u' or 'x'. . @param vs fixed size array of 3 elements @param u a vertex in 'vs' @param x another vertex in 'vs' @return the other vertex
[ "Finds", "a", "vertex", "in", "vs", "which", "is", "not", "u", "or", "x", ".", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/stereo/DoubleBondElementEncoderFactory.java#L127-L132
114,664
cdk/cdk
tool/hash/src/main/java/org/openscience/cdk/hash/stereo/DoubleBondElementEncoderFactory.java
DoubleBondElementEncoderFactory.indexMap
private static Map<IAtom, Integer> indexMap(Map<IAtom, Integer> map, IAtomContainer container) { if (map != null) return map; map = new HashMap<IAtom, Integer>(); for (IAtom a : container.atoms()) { map.put(a, map.size()); } return map; }
java
private static Map<IAtom, Integer> indexMap(Map<IAtom, Integer> map, IAtomContainer container) { if (map != null) return map; map = new HashMap<IAtom, Integer>(); for (IAtom a : container.atoms()) { map.put(a, map.size()); } return map; }
[ "private", "static", "Map", "<", "IAtom", ",", "Integer", ">", "indexMap", "(", "Map", "<", "IAtom", ",", "Integer", ">", "map", ",", "IAtomContainer", "container", ")", "{", "if", "(", "map", "!=", "null", ")", "return", "map", ";", "map", "=", "new...
Lazy creation of an atom index map. @param map existing map (possibly null) @param container the container we want the map for @return a usable atom to index map for the given container
[ "Lazy", "creation", "of", "an", "atom", "index", "map", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/stereo/DoubleBondElementEncoderFactory.java#L141-L148
114,665
cdk/cdk
tool/formula/src/main/java/org/openscience/cdk/formula/IsotopePatternGenerator.java
IsotopePatternGenerator.getIsotopes
public IsotopePattern getIsotopes(IMolecularFormula molFor) { if (builder == null) { try { isoFactory = Isotopes.getInstance(); builder = molFor.getBuilder(); } catch (Exception e) { e.printStackTrace(); } } Str...
java
public IsotopePattern getIsotopes(IMolecularFormula molFor) { if (builder == null) { try { isoFactory = Isotopes.getInstance(); builder = molFor.getBuilder(); } catch (Exception e) { e.printStackTrace(); } } Str...
[ "public", "IsotopePattern", "getIsotopes", "(", "IMolecularFormula", "molFor", ")", "{", "if", "(", "builder", "==", "null", ")", "{", "try", "{", "isoFactory", "=", "Isotopes", ".", "getInstance", "(", ")", ";", "builder", "=", "molFor", ".", "getBuilder", ...
Get all combinatorial chemical isotopes given a structure. @param molFor The IMolecularFormula to start @return A IsotopePattern object containing the different combinations
[ "Get", "all", "combinatorial", "chemical", "isotopes", "given", "a", "structure", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/IsotopePatternGenerator.java#L115-L158
114,666
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java
BasicAtomGenerator.canDraw
protected boolean canDraw(IAtom atom, IAtomContainer container, RendererModel model) { // don't draw atoms without coordinates if (!hasCoordinates(atom)) { return false; } // don't draw invisible hydrogens if (invisibleHydrogen(atom, model)) { return fals...
java
protected boolean canDraw(IAtom atom, IAtomContainer container, RendererModel model) { // don't draw atoms without coordinates if (!hasCoordinates(atom)) { return false; } // don't draw invisible hydrogens if (invisibleHydrogen(atom, model)) { return fals...
[ "protected", "boolean", "canDraw", "(", "IAtom", "atom", ",", "IAtomContainer", "container", ",", "RendererModel", "model", ")", "{", "// don't draw atoms without coordinates", "if", "(", "!", "hasCoordinates", "(", "atom", ")", ")", "{", "return", "false", ";", ...
Checks an atom to see if it should be drawn. There are three reasons not to draw an atom - a) no coordinates, b) an invisible hydrogen or c) an invisible carbon. @param atom the atom to check @param container the atom container the atom is part of @param model the renderer model @return true if the atom should be draw...
[ "Checks", "an", "atom", "to", "see", "if", "it", "should", "be", "drawn", ".", "There", "are", "three", "reasons", "not", "to", "draw", "an", "atom", "-", "a", ")", "no", "coordinates", "b", ")", "an", "invisible", "hydrogen", "or", "c", ")", "an", ...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java#L289-L306
114,667
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java
BasicAtomGenerator.generateCompactElement
public IRenderingElement generateCompactElement(IAtom atom, RendererModel model) { Point2d point = atom.getPoint2d(); double radius = (Double) model.get(AtomRadius.class) / model.getParameter(Scale.class).getValue(); double distance = 2 * radius; if (model.get(CompactShape.class) == Shap...
java
public IRenderingElement generateCompactElement(IAtom atom, RendererModel model) { Point2d point = atom.getPoint2d(); double radius = (Double) model.get(AtomRadius.class) / model.getParameter(Scale.class).getValue(); double distance = 2 * radius; if (model.get(CompactShape.class) == Shap...
[ "public", "IRenderingElement", "generateCompactElement", "(", "IAtom", "atom", ",", "RendererModel", "model", ")", "{", "Point2d", "point", "=", "atom", ".", "getPoint2d", "(", ")", ";", "double", "radius", "=", "(", "Double", ")", "model", ".", "get", "(", ...
Generate a compact element for an atom, such as a circle or a square, rather than text element. @param atom the atom to generate the compact element for @param model the renderer model @return a compact rendering element
[ "Generate", "a", "compact", "element", "for", "an", "atom", "such", "as", "a", "circle", "or", "a", "square", "rather", "than", "text", "element", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java#L341-L351
114,668
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java
BasicAtomGenerator.generateElement
public AtomSymbolElement generateElement(IAtom atom, int alignment, RendererModel model) { String text; if (atom instanceof IPseudoAtom) { text = ((IPseudoAtom) atom).getLabel(); } else { text = atom.getSymbol(); } return new AtomSymbolElement(atom.getPoin...
java
public AtomSymbolElement generateElement(IAtom atom, int alignment, RendererModel model) { String text; if (atom instanceof IPseudoAtom) { text = ((IPseudoAtom) atom).getLabel(); } else { text = atom.getSymbol(); } return new AtomSymbolElement(atom.getPoin...
[ "public", "AtomSymbolElement", "generateElement", "(", "IAtom", "atom", ",", "int", "alignment", ",", "RendererModel", "model", ")", "{", "String", "text", ";", "if", "(", "atom", "instanceof", "IPseudoAtom", ")", "{", "text", "=", "(", "(", "IPseudoAtom", "...
Generate an atom symbol element. @param atom the atom to use @param alignment the alignment of the atom's label @param model the renderer model @return an atom symbol element
[ "Generate", "an", "atom", "symbol", "element", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java#L361-L370
114,669
cdk/cdk
display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java
BasicAtomGenerator.showCarbon
protected boolean showCarbon(IAtom carbonAtom, IAtomContainer container, RendererModel model) { if ((Boolean) model.get(KekuleStructure.class)) return true; if (carbonAtom.getFormalCharge() != 0) return true; int connectedBondCount = container.getConnectedBondsList(carbonAtom).size(); ...
java
protected boolean showCarbon(IAtom carbonAtom, IAtomContainer container, RendererModel model) { if ((Boolean) model.get(KekuleStructure.class)) return true; if (carbonAtom.getFormalCharge() != 0) return true; int connectedBondCount = container.getConnectedBondsList(carbonAtom).size(); ...
[ "protected", "boolean", "showCarbon", "(", "IAtom", "carbonAtom", ",", "IAtomContainer", "container", ",", "RendererModel", "model", ")", "{", "if", "(", "(", "Boolean", ")", "model", ".", "get", "(", "KekuleStructure", ".", "class", ")", ")", "return", "tru...
Checks a carbon atom to see if it should be shown. @param carbonAtom the carbon atom to check @param container the atom container @param model the renderer model @return true if the carbon should be shown
[ "Checks", "a", "carbon", "atom", "to", "see", "if", "it", "should", "be", "shown", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicAtomGenerator.java#L380-L397
114,670
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AminoAcidManipulator.java
AminoAcidManipulator.removeAcidicOxygen
public static void removeAcidicOxygen(IAminoAcid acid) throws CDKException { if (acid.getCTerminus() == null) throw new CDKException("Cannot remove oxygen: C-terminus is not defined!"); java.util.List<IBond> bonds = acid.getConnectedBondsList(acid.getCTerminus()); // ok, look for the oxygen whi...
java
public static void removeAcidicOxygen(IAminoAcid acid) throws CDKException { if (acid.getCTerminus() == null) throw new CDKException("Cannot remove oxygen: C-terminus is not defined!"); java.util.List<IBond> bonds = acid.getConnectedBondsList(acid.getCTerminus()); // ok, look for the oxygen whi...
[ "public", "static", "void", "removeAcidicOxygen", "(", "IAminoAcid", "acid", ")", "throws", "CDKException", "{", "if", "(", "acid", ".", "getCTerminus", "(", ")", "==", "null", ")", "throw", "new", "CDKException", "(", "\"Cannot remove oxygen: C-terminus is not defi...
Removes the singly bonded oxygen from the acid group of the AminoAcid. @param acid AminoAcid from which to remove the oxygen @throws CDKException when the C-terminus is not defined for the given AminoAcid
[ "Removes", "the", "singly", "bonded", "oxygen", "from", "the", "acid", "group", "of", "the", "AminoAcid", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AminoAcidManipulator.java#L49-L64
114,671
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AminoAcidManipulator.java
AminoAcidManipulator.addAcidicOxygen
public static void addAcidicOxygen(IAminoAcid acid) throws CDKException { if (acid.getCTerminus() == null) throw new CDKException("Cannot add oxygen: C-terminus is not defined!"); IAtom acidicOxygen = acid.getBuilder().newInstance(IAtom.class, "O"); acid.addAtom(acidicOxygen); acid.addB...
java
public static void addAcidicOxygen(IAminoAcid acid) throws CDKException { if (acid.getCTerminus() == null) throw new CDKException("Cannot add oxygen: C-terminus is not defined!"); IAtom acidicOxygen = acid.getBuilder().newInstance(IAtom.class, "O"); acid.addAtom(acidicOxygen); acid.addB...
[ "public", "static", "void", "addAcidicOxygen", "(", "IAminoAcid", "acid", ")", "throws", "CDKException", "{", "if", "(", "acid", ".", "getCTerminus", "(", ")", "==", "null", ")", "throw", "new", "CDKException", "(", "\"Cannot add oxygen: C-terminus is not defined!\"...
Adds the singly bonded oxygen from the acid group of the AminoAcid. @param acid AminoAcid to which to add the oxygen @throws CDKException when the C-terminus is not defined for the given AminoAcid
[ "Adds", "the", "singly", "bonded", "oxygen", "from", "the", "acid", "group", "of", "the", "AminoAcid", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AminoAcidManipulator.java#L72-L79
114,672
cdk/cdk
legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java
MassToFormulaTool.setRestrictions
public void setRestrictions(List<IRule> rulesNew) throws CDKException { Iterator<IRule> itRules = rulesNew.iterator(); while (itRules.hasNext()) { IRule rule = itRules.next(); if (rule instanceof ElementRule) { mfRange = (MolecularFormulaRange) ((Object[]) rule.g...
java
public void setRestrictions(List<IRule> rulesNew) throws CDKException { Iterator<IRule> itRules = rulesNew.iterator(); while (itRules.hasNext()) { IRule rule = itRules.next(); if (rule instanceof ElementRule) { mfRange = (MolecularFormulaRange) ((Object[]) rule.g...
[ "public", "void", "setRestrictions", "(", "List", "<", "IRule", ">", "rulesNew", ")", "throws", "CDKException", "{", "Iterator", "<", "IRule", ">", "itRules", "=", "rulesNew", ".", "iterator", "(", ")", ";", "while", "(", "itRules", ".", "hasNext", "(", ...
Set the restrictions that must be presents in the molecular formula. @param rulesNew The restrictions to impose @see #getRestrictions() @see #setDefaultRestrictions() @see IRule
[ "Set", "the", "restrictions", "that", "must", "be", "presents", "in", "the", "molecular", "formula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L117-L166
114,673
cdk/cdk
legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java
MassToFormulaTool.setDefaultRestrictions
public void setDefaultRestrictions() { try { callDefaultRestrictions(); } catch (CDKException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
java
public void setDefaultRestrictions() { try { callDefaultRestrictions(); } catch (CDKException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
[ "public", "void", "setDefaultRestrictions", "(", ")", "{", "try", "{", "callDefaultRestrictions", "(", ")", ";", "}", "catch", "(", "CDKException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{"...
Set the default restrictions that must be presents in the molecular formula. @see #getRestrictions()
[ "Set", "the", "default", "restrictions", "that", "must", "be", "presents", "in", "the", "molecular", "formula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L184-L192
114,674
cdk/cdk
legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java
MassToFormulaTool.orderList
private List<IIsotope> orderList(List<IIsotope> isotopes_TO) { List<IIsotope> newOrderList = new ArrayList<IIsotope>(); for (int i = 0; i < orderElements.length; i++) { String symbol = orderElements[i]; Iterator<IIsotope> itIso = isotopes_TO.iterator(); while (itIso.h...
java
private List<IIsotope> orderList(List<IIsotope> isotopes_TO) { List<IIsotope> newOrderList = new ArrayList<IIsotope>(); for (int i = 0; i < orderElements.length; i++) { String symbol = orderElements[i]; Iterator<IIsotope> itIso = isotopes_TO.iterator(); while (itIso.h...
[ "private", "List", "<", "IIsotope", ">", "orderList", "(", "List", "<", "IIsotope", ">", "isotopes_TO", ")", "{", "List", "<", "IIsotope", ">", "newOrderList", "=", "new", "ArrayList", "<", "IIsotope", ">", "(", ")", ";", "for", "(", "int", "i", "=", ...
Put the order the List of IIsotope according the probability occurrence. @param isotopes_TO The List of IIsotope @return The list of IIsotope ordered
[ "Put", "the", "order", "the", "List", "of", "IIsotope", "according", "the", "probability", "occurrence", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L423-L436
114,675
cdk/cdk
legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java
MassToFormulaTool.getMaxOccurence
private int getMaxOccurence(double massTo, int element_pos, int[] matrix, List<IIsotope> isoToCond_new) { double massIn = isoToCond_new.get(element_pos).getExactMass(); double massToM = massTo; for (int i = 0; i < matrix.length; i++) if (i != element_pos) if (matrix[i] != 0) massToM ...
java
private int getMaxOccurence(double massTo, int element_pos, int[] matrix, List<IIsotope> isoToCond_new) { double massIn = isoToCond_new.get(element_pos).getExactMass(); double massToM = massTo; for (int i = 0; i < matrix.length; i++) if (i != element_pos) if (matrix[i] != 0) massToM ...
[ "private", "int", "getMaxOccurence", "(", "double", "massTo", ",", "int", "element_pos", ",", "int", "[", "]", "matrix", ",", "List", "<", "IIsotope", ">", "isoToCond_new", ")", "{", "double", "massIn", "=", "isoToCond_new", ".", "get", "(", "element_pos", ...
Get the maximal occurrence of this List. @param massTo @param element_pos @param matrix @param elemToCond_new @return The occurrence value
[ "Get", "the", "maximal", "occurrence", "of", "this", "List", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L469-L477
114,676
cdk/cdk
legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java
MassToFormulaTool.getFormula
private IMolecularFormula getFormula(List<IIsotope> isoToCond_new, int[] value_In) { IMolecularFormula mf = builder.newInstance(IMolecularFormula.class); for (int i = 0; i < isoToCond_new.size(); i++) { if (value_In[i] != 0) { for (int j = 0; j < value_In[i]; j++) ...
java
private IMolecularFormula getFormula(List<IIsotope> isoToCond_new, int[] value_In) { IMolecularFormula mf = builder.newInstance(IMolecularFormula.class); for (int i = 0; i < isoToCond_new.size(); i++) { if (value_In[i] != 0) { for (int j = 0; j < value_In[i]; j++) ...
[ "private", "IMolecularFormula", "getFormula", "(", "List", "<", "IIsotope", ">", "isoToCond_new", ",", "int", "[", "]", "value_In", ")", "{", "IMolecularFormula", "mf", "=", "builder", ".", "newInstance", "(", "IMolecularFormula", ".", "class", ")", ";", "for"...
Set the formula molecular as IMolecularFormula object. @param elemToCond_new List with IIsotope @param value_In Array matrix with occurrences @return The IMolecularFormula
[ "Set", "the", "formula", "molecular", "as", "IMolecularFormula", "object", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L486-L497
114,677
cdk/cdk
legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java
MassToFormulaTool.putInOrder
private IMolecularFormula putInOrder(IMolecularFormula formula) { IMolecularFormula new_formula = formula.getBuilder().newInstance(IMolecularFormula.class); for (int i = 0; i < orderElements.length; i++) { IElement element = builder.newInstance(IElement.class, orderElements[i]); ...
java
private IMolecularFormula putInOrder(IMolecularFormula formula) { IMolecularFormula new_formula = formula.getBuilder().newInstance(IMolecularFormula.class); for (int i = 0; i < orderElements.length; i++) { IElement element = builder.newInstance(IElement.class, orderElements[i]); ...
[ "private", "IMolecularFormula", "putInOrder", "(", "IMolecularFormula", "formula", ")", "{", "IMolecularFormula", "new_formula", "=", "formula", ".", "getBuilder", "(", ")", ".", "newInstance", "(", "IMolecularFormula", ".", "class", ")", ";", "for", "(", "int", ...
Put in order the elements of the molecular formula. @param formula The IMolecularFormula to put in order @return IMolecularFormula object
[ "Put", "in", "order", "the", "elements", "of", "the", "molecular", "formula", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L505-L519
114,678
cdk/cdk
legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java
MassToFormulaTool.calculateMassT
private double calculateMassT(List<IIsotope> isoToCond_new, int[] value_In) { double result = 0; for (int i = 0; i < isoToCond_new.size(); i++) { if (value_In[i] != 0) { result += isoToCond_new.get(i).getExactMass() * value_In[i]; } } return result...
java
private double calculateMassT(List<IIsotope> isoToCond_new, int[] value_In) { double result = 0; for (int i = 0; i < isoToCond_new.size(); i++) { if (value_In[i] != 0) { result += isoToCond_new.get(i).getExactMass() * value_In[i]; } } return result...
[ "private", "double", "calculateMassT", "(", "List", "<", "IIsotope", ">", "isoToCond_new", ",", "int", "[", "]", "value_In", ")", "{", "double", "result", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "isoToCond_new", ".", "size", "...
Calculate the mass total given the elements and their respective occurrences. @param elemToCond_new The IIsotope to calculate @param value_In Array matrix with occurrences @return The sum total
[ "Calculate", "the", "mass", "total", "given", "the", "elements", "and", "their", "respective", "occurrences", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L528-L536
114,679
cdk/cdk
legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java
MassToFormulaTool.returnOrdered
private IMolecularFormulaSet returnOrdered(double mass, IMolecularFormulaSet formulaSet) { IMolecularFormulaSet solutions_new = null; if (formulaSet.size() != 0) { double valueMin = 100; int i_final = 0; solutions_new = formulaSet.getBuilder().newInstance(IMolecular...
java
private IMolecularFormulaSet returnOrdered(double mass, IMolecularFormulaSet formulaSet) { IMolecularFormulaSet solutions_new = null; if (formulaSet.size() != 0) { double valueMin = 100; int i_final = 0; solutions_new = formulaSet.getBuilder().newInstance(IMolecular...
[ "private", "IMolecularFormulaSet", "returnOrdered", "(", "double", "mass", ",", "IMolecularFormulaSet", "formulaSet", ")", "{", "IMolecularFormulaSet", "solutions_new", "=", "null", ";", "if", "(", "formulaSet", ".", "size", "(", ")", "!=", "0", ")", "{", "doubl...
Return all molecular formulas but ordered according the tolerance difference between masses. @param mass The mass to analyze @param formulaSet The IMolecularFormulaSet to order @return The IMolecularFormulaSet ordered
[ "Return", "all", "molecular", "formulas", "but", "ordered", "according", "the", "tolerance", "difference", "between", "masses", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L545-L573
114,680
cdk/cdk
legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java
MassToFormulaTool.getMatrix
private int[][] getMatrix(int size) { logger.info("Creating matrix for isotopes combination"); int lengthM = (int) Math.pow(2, size); lengthM--;// less 1 because the matrix 00000 we don't need int[][] matrix = new int[lengthM][size]; int[] combi = new int[size]; for (in...
java
private int[][] getMatrix(int size) { logger.info("Creating matrix for isotopes combination"); int lengthM = (int) Math.pow(2, size); lengthM--;// less 1 because the matrix 00000 we don't need int[][] matrix = new int[lengthM][size]; int[] combi = new int[size]; for (in...
[ "private", "int", "[", "]", "[", "]", "getMatrix", "(", "int", "size", ")", "{", "logger", ".", "info", "(", "\"Creating matrix for isotopes combination\"", ")", ";", "int", "lengthM", "=", "(", "int", ")", "Math", ".", "pow", "(", "2", ",", "size", ")...
Get the corresponding matrix and create it. @param size Size of the matrix to be created @return the matrix with the permutations
[ "Get", "the", "corresponding", "matrix", "and", "create", "it", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/formula/MassToFormulaTool.java#L581-L625
114,681
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java
ChemFileManipulator.getAtomCount
public static int getAtomCount(IChemFile file) { int count = 0; for (int i = 0; i < file.getChemSequenceCount(); i++) { count += ChemSequenceManipulator.getAtomCount(file.getChemSequence(i)); } return count; }
java
public static int getAtomCount(IChemFile file) { int count = 0; for (int i = 0; i < file.getChemSequenceCount(); i++) { count += ChemSequenceManipulator.getAtomCount(file.getChemSequence(i)); } return count; }
[ "public", "static", "int", "getAtomCount", "(", "IChemFile", "file", ")", "{", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "file", ".", "getChemSequenceCount", "(", ")", ";", "i", "++", ")", "{", "count", "+=", ...
Get the total number of atoms inside an IChemFile. @param file The IChemFile object. @return The number of Atom object inside.
[ "Get", "the", "total", "number", "of", "atoms", "inside", "an", "IChemFile", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java#L53-L59
114,682
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java
ChemFileManipulator.getBondCount
public static int getBondCount(IChemFile file) { int count = 0; for (int i = 0; i < file.getChemSequenceCount(); i++) { count += ChemSequenceManipulator.getBondCount(file.getChemSequence(i)); } return count; }
java
public static int getBondCount(IChemFile file) { int count = 0; for (int i = 0; i < file.getChemSequenceCount(); i++) { count += ChemSequenceManipulator.getBondCount(file.getChemSequence(i)); } return count; }
[ "public", "static", "int", "getBondCount", "(", "IChemFile", "file", ")", "{", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "file", ".", "getChemSequenceCount", "(", ")", ";", "i", "++", ")", "{", "count", "+=", ...
Get the total number of bonds inside an IChemFile. @param file The IChemFile object. @return The number of Bond object inside.
[ "Get", "the", "total", "number", "of", "bonds", "inside", "an", "IChemFile", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java#L67-L73
114,683
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java
ChemFileManipulator.getAllChemObjects
public static List<IChemObject> getAllChemObjects(IChemFile file) { List<IChemObject> list = new ArrayList<IChemObject>(); //list.add(file); // should not add the original file for (int i = 0; i < file.getChemSequenceCount(); i++) { list.add(file.getChemSequence(i)); list...
java
public static List<IChemObject> getAllChemObjects(IChemFile file) { List<IChemObject> list = new ArrayList<IChemObject>(); //list.add(file); // should not add the original file for (int i = 0; i < file.getChemSequenceCount(); i++) { list.add(file.getChemSequence(i)); list...
[ "public", "static", "List", "<", "IChemObject", ">", "getAllChemObjects", "(", "IChemFile", "file", ")", "{", "List", "<", "IChemObject", ">", "list", "=", "new", "ArrayList", "<", "IChemObject", ">", "(", ")", ";", "//list.add(file); // should not add the origina...
Returns a List of all IChemObject inside a ChemFile. @return A list of all ChemObjects
[ "Returns", "a", "List", "of", "all", "IChemObject", "inside", "a", "ChemFile", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java#L80-L88
114,684
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java
ChemFileManipulator.getAllAtomContainers
public static List<IAtomContainer> getAllAtomContainers(IChemFile file) { List<IAtomContainer> acList = new ArrayList<IAtomContainer>(); for (IChemSequence sequence : file.chemSequences()) { acList.addAll(ChemSequenceManipulator.getAllAtomContainers(sequence)); } return acLis...
java
public static List<IAtomContainer> getAllAtomContainers(IChemFile file) { List<IAtomContainer> acList = new ArrayList<IAtomContainer>(); for (IChemSequence sequence : file.chemSequences()) { acList.addAll(ChemSequenceManipulator.getAllAtomContainers(sequence)); } return acLis...
[ "public", "static", "List", "<", "IAtomContainer", ">", "getAllAtomContainers", "(", "IChemFile", "file", ")", "{", "List", "<", "IAtomContainer", ">", "acList", "=", "new", "ArrayList", "<", "IAtomContainer", ">", "(", ")", ";", "for", "(", "IChemSequence", ...
Returns all the AtomContainer's of a ChemFile.
[ "Returns", "all", "the", "AtomContainer", "s", "of", "a", "ChemFile", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java#L102-L108
114,685
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java
ChemFileManipulator.getAllChemModels
public static List<IChemModel> getAllChemModels(IChemFile file) { List<IChemModel> modelsList = new ArrayList<IChemModel>(); for (int f = 0; f < file.getChemSequenceCount(); f++) { for (IChemModel model : file.getChemSequence(f).chemModels()) { modelsList.add(model); ...
java
public static List<IChemModel> getAllChemModels(IChemFile file) { List<IChemModel> modelsList = new ArrayList<IChemModel>(); for (int f = 0; f < file.getChemSequenceCount(); f++) { for (IChemModel model : file.getChemSequence(f).chemModels()) { modelsList.add(model); ...
[ "public", "static", "List", "<", "IChemModel", ">", "getAllChemModels", "(", "IChemFile", "file", ")", "{", "List", "<", "IChemModel", ">", "modelsList", "=", "new", "ArrayList", "<", "IChemModel", ">", "(", ")", ";", "for", "(", "int", "f", "=", "0", ...
Get a list of all ChemModels inside an IChemFile. @param file The IChemFile object. @return The List of IChemModel objects inside.
[ "Get", "a", "list", "of", "all", "ChemModels", "inside", "an", "IChemFile", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java#L116-L125
114,686
cdk/cdk
base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java
ChemFileManipulator.getAllReactions
public static List<IReaction> getAllReactions(IChemFile file) { List<IReaction> reactonList = new ArrayList<IReaction>(); List<IChemModel> chemModel = getAllChemModels(file); for (int f = 0; f < chemModel.size(); f++) { for (IReaction reaction : chemModel.get(f).getReactionSet().reac...
java
public static List<IReaction> getAllReactions(IChemFile file) { List<IReaction> reactonList = new ArrayList<IReaction>(); List<IChemModel> chemModel = getAllChemModels(file); for (int f = 0; f < chemModel.size(); f++) { for (IReaction reaction : chemModel.get(f).getReactionSet().reac...
[ "public", "static", "List", "<", "IReaction", ">", "getAllReactions", "(", "IChemFile", "file", ")", "{", "List", "<", "IReaction", ">", "reactonList", "=", "new", "ArrayList", "<", "IReaction", ">", "(", ")", ";", "List", "<", "IChemModel", ">", "chemMode...
Get a list of all IReaction inside an IChemFile. @param file The IChemFile object. @return The List of IReaction objects inside.
[ "Get", "a", "list", "of", "all", "IReaction", "inside", "an", "IChemFile", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemFileManipulator.java#L133-L142
114,687
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getHybridisationState
private int getHybridisationState(IAtom atom1) { IBond.Order maxBondOrder = atom1.getMaxBondOrder(); // if (atom1.getFormalNeighbourCount() == 1 || maxBondOrder > 4) { if (atom1.getFormalNeighbourCount() == 1) { // WTF?? } else if (atom1.getFormalNeighbourCount() == ...
java
private int getHybridisationState(IAtom atom1) { IBond.Order maxBondOrder = atom1.getMaxBondOrder(); // if (atom1.getFormalNeighbourCount() == 1 || maxBondOrder > 4) { if (atom1.getFormalNeighbourCount() == 1) { // WTF?? } else if (atom1.getFormalNeighbourCount() == ...
[ "private", "int", "getHybridisationState", "(", "IAtom", "atom1", ")", "{", "IBond", ".", "Order", "maxBondOrder", "=", "atom1", ".", "getMaxBondOrder", "(", ")", ";", "// if (atom1.getFormalNeighbourCount() == 1 || maxBondOrder > 4) {", "if", "(", "atom1", ".", ...
Gets the hybridisation state of an atom. @param atom1 atom @return The hybridisationState value (sp=1;sp2=2;sp3=3)
[ "Gets", "the", "hybridisation", "state", "of", "an", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L274-L289
114,688
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getDoubleBondConfiguration2D
private int getDoubleBondConfiguration2D(IBond bond, Point2d a, Point2d b, Point2d c, Point2d d) throws CDKException { if (bond.getOrder() != IBond.Order.DOUBLE) { return 0; } // no 2D coordinates or existing configuration if (a == null || b == null || c == null |...
java
private int getDoubleBondConfiguration2D(IBond bond, Point2d a, Point2d b, Point2d c, Point2d d) throws CDKException { if (bond.getOrder() != IBond.Order.DOUBLE) { return 0; } // no 2D coordinates or existing configuration if (a == null || b == null || c == null |...
[ "private", "int", "getDoubleBondConfiguration2D", "(", "IBond", "bond", ",", "Point2d", "a", ",", "Point2d", "b", ",", "Point2d", "c", ",", "Point2d", "d", ")", "throws", "CDKException", "{", "if", "(", "bond", ".", "getOrder", "(", ")", "!=", "IBond", "...
Gets the doubleBondConfiguration2D attribute of the AtomPlacer3D object using existing 2D coordinates. @param bond the double bond @param a coordinates (Point2d) of atom1 connected to bond @param b coordinates (Point2d) of atom2 connected to bond @param c coordinate...
[ "Gets", "the", "doubleBondConfiguration2D", "attribute", "of", "the", "AtomPlacer3D", "object", "using", "existing", "2D", "coordinates", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L302-L318
114,689
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getBondLengthValue
public double getBondLengthValue(String id1, String id2) { String dkey = ""; if (pSet.containsKey(("bond" + id1 + ";" + id2))) { dkey = "bond" + id1 + ";" + id2; } else if (pSet.containsKey(("bond" + id2 + ";" + id1))) { dkey = "bond" + id2 + ";" + id1; } else { ...
java
public double getBondLengthValue(String id1, String id2) { String dkey = ""; if (pSet.containsKey(("bond" + id1 + ";" + id2))) { dkey = "bond" + id1 + ";" + id2; } else if (pSet.containsKey(("bond" + id2 + ";" + id1))) { dkey = "bond" + id2 + ";" + id1; } else { ...
[ "public", "double", "getBondLengthValue", "(", "String", "id1", ",", "String", "id2", ")", "{", "String", "dkey", "=", "\"\"", ";", "if", "(", "pSet", ".", "containsKey", "(", "(", "\"bond\"", "+", "id1", "+", "\";\"", "+", "id2", ")", ")", ")", "{",...
Gets the distanceValue attribute of the parameter set. @param id1 atom1 id @param id2 atom2 id @return The distanceValue value from the force field parameter set
[ "Gets", "the", "distanceValue", "attribute", "of", "the", "parameter", "set", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L327-L339
114,690
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour
public IAtom getNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour(IAtomContainer molecule) { Iterator<IBond> bonds = molecule.bonds().iterator(); while (bonds.hasNext()) { IBond bond = bonds.next(); if (bond.getBegin().getFlag(CDKConstants.ISPLACED) && !(bond.getEnd().getFlag(CDK...
java
public IAtom getNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour(IAtomContainer molecule) { Iterator<IBond> bonds = molecule.bonds().iterator(); while (bonds.hasNext()) { IBond bond = bonds.next(); if (bond.getBegin().getFlag(CDKConstants.ISPLACED) && !(bond.getEnd().getFlag(CDK...
[ "public", "IAtom", "getNextUnplacedHeavyAtomWithAliphaticPlacedNeighbour", "(", "IAtomContainer", "molecule", ")", "{", "Iterator", "<", "IBond", ">", "bonds", "=", "molecule", ".", "bonds", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "bonds", ".", ...
Gets the nextUnplacedHeavyAtomWithAliphaticPlacedNeighbour from an atom container or molecule. @param molecule @return The nextUnplacedHeavyAtomWithAliphaticPlacedNeighbour value author: steinbeck,cho
[ "Gets", "the", "nextUnplacedHeavyAtomWithAliphaticPlacedNeighbour", "from", "an", "atom", "container", "or", "molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L377-L393
114,691
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getUnplacedHeavyAtom
IAtom getUnplacedHeavyAtom(IAtomContainer molecule) { for (IAtom atom : molecule.atoms()) { if (isUnplacedHeavyAtom(atom)) return atom; } return null; }
java
IAtom getUnplacedHeavyAtom(IAtomContainer molecule) { for (IAtom atom : molecule.atoms()) { if (isUnplacedHeavyAtom(atom)) return atom; } return null; }
[ "IAtom", "getUnplacedHeavyAtom", "(", "IAtomContainer", "molecule", ")", "{", "for", "(", "IAtom", "atom", ":", "molecule", ".", "atoms", "(", ")", ")", "{", "if", "(", "isUnplacedHeavyAtom", "(", "atom", ")", ")", "return", "atom", ";", "}", "return", "...
Find the first unplaced atom. @param molecule molecule being built @return an unplaced heavy atom, null if none.
[ "Find", "the", "first", "unplaced", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L401-L407
114,692
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getNextPlacedHeavyAtomWithUnplacedAliphaticNeighbour
public IAtom getNextPlacedHeavyAtomWithUnplacedAliphaticNeighbour(IAtomContainer molecule) { Iterator<IBond> bonds = molecule.bonds().iterator(); while (bonds.hasNext()) { IBond bond = bonds.next(); IAtom atom0 = bond.getBegin(); IAtom atom1 = bond.getEnd(); ...
java
public IAtom getNextPlacedHeavyAtomWithUnplacedAliphaticNeighbour(IAtomContainer molecule) { Iterator<IBond> bonds = molecule.bonds().iterator(); while (bonds.hasNext()) { IBond bond = bonds.next(); IAtom atom0 = bond.getBegin(); IAtom atom1 = bond.getEnd(); ...
[ "public", "IAtom", "getNextPlacedHeavyAtomWithUnplacedAliphaticNeighbour", "(", "IAtomContainer", "molecule", ")", "{", "Iterator", "<", "IBond", ">", "bonds", "=", "molecule", ".", "bonds", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "bonds", ".", ...
Gets the nextPlacedHeavyAtomWithAliphaticPlacedNeigbor from an atom container or molecule. @param molecule @return The nextUnplacedHeavyAtomWithUnplacedAliphaticNeigbor author: steinbeck,cho
[ "Gets", "the", "nextPlacedHeavyAtomWithAliphaticPlacedNeigbor", "from", "an", "atom", "container", "or", "molecule", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L416-L434
114,693
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getFarthestAtom
public IAtom getFarthestAtom(Point3d refAtomPoint, IAtomContainer ac) { double distance = 0; IAtom atom = null; for (int i = 0; i < ac.getAtomCount(); i++) { if (ac.getAtom(i).getPoint3d() != null) { if (Math.abs(refAtomPoint.distance(ac.getAtom(i).getPoint3d())) > di...
java
public IAtom getFarthestAtom(Point3d refAtomPoint, IAtomContainer ac) { double distance = 0; IAtom atom = null; for (int i = 0; i < ac.getAtomCount(); i++) { if (ac.getAtom(i).getPoint3d() != null) { if (Math.abs(refAtomPoint.distance(ac.getAtom(i).getPoint3d())) > di...
[ "public", "IAtom", "getFarthestAtom", "(", "Point3d", "refAtomPoint", ",", "IAtomContainer", "ac", ")", "{", "double", "distance", "=", "0", ";", "IAtom", "atom", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ac", ".", "getAtomCou...
Gets the farthestAtom attribute of the AtomPlacer3D object. @param refAtomPoint Description of the Parameter @param ac Description of the Parameter @return The farthestAtom value
[ "Gets", "the", "farthestAtom", "attribute", "of", "the", "AtomPlacer3D", "object", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L469-L481
114,694
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getUnplacedRingHeavyAtom
public IAtom getUnplacedRingHeavyAtom(IAtomContainer molecule, IAtom atom) { List<IBond> bonds = molecule.getConnectedBondsList(atom); IAtom connectedAtom = null; for (IBond bond : bonds) { connectedAtom = bond.getOther(atom); if (isUnplacedHeavyAtom(connectedAtom) && con...
java
public IAtom getUnplacedRingHeavyAtom(IAtomContainer molecule, IAtom atom) { List<IBond> bonds = molecule.getConnectedBondsList(atom); IAtom connectedAtom = null; for (IBond bond : bonds) { connectedAtom = bond.getOther(atom); if (isUnplacedHeavyAtom(connectedAtom) && con...
[ "public", "IAtom", "getUnplacedRingHeavyAtom", "(", "IAtomContainer", "molecule", ",", "IAtom", "atom", ")", "{", "List", "<", "IBond", ">", "bonds", "=", "molecule", ".", "getConnectedBondsList", "(", "atom", ")", ";", "IAtom", "connectedAtom", "=", "null", "...
Gets the unplacedRingHeavyAtom attribute of the AtomPlacer3D object. @param molecule @param atom Description of the Parameter @return The unplacedRingHeavyAtom value
[ "Gets", "the", "unplacedRingHeavyAtom", "attribute", "of", "the", "AtomPlacer3D", "object", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L490-L500
114,695
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.geometricCenterAllPlacedAtoms
public Point3d geometricCenterAllPlacedAtoms(IAtomContainer molecule) { IAtomContainer allPlacedAtoms = getAllPlacedAtoms(molecule); return GeometryUtil.get3DCenter(allPlacedAtoms); }
java
public Point3d geometricCenterAllPlacedAtoms(IAtomContainer molecule) { IAtomContainer allPlacedAtoms = getAllPlacedAtoms(molecule); return GeometryUtil.get3DCenter(allPlacedAtoms); }
[ "public", "Point3d", "geometricCenterAllPlacedAtoms", "(", "IAtomContainer", "molecule", ")", "{", "IAtomContainer", "allPlacedAtoms", "=", "getAllPlacedAtoms", "(", "molecule", ")", ";", "return", "GeometryUtil", ".", "get3DCenter", "(", "allPlacedAtoms", ")", ";", "...
Calculates the geometric center of all placed atoms in the atomcontainer. @param molecule @return Point3d the geometric center
[ "Calculates", "the", "geometric", "center", "of", "all", "placed", "atoms", "in", "the", "atomcontainer", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L508-L511
114,696
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getPlacedHeavyAtom
public IAtom getPlacedHeavyAtom(IAtomContainer molecule, IAtom atom) { List<IBond> bonds = molecule.getConnectedBondsList(atom); for (IBond bond : bonds) { IAtom connectedAtom = bond.getOther(atom); if (isPlacedHeavyAtom(connectedAtom)) { return connectedAtom; ...
java
public IAtom getPlacedHeavyAtom(IAtomContainer molecule, IAtom atom) { List<IBond> bonds = molecule.getConnectedBondsList(atom); for (IBond bond : bonds) { IAtom connectedAtom = bond.getOther(atom); if (isPlacedHeavyAtom(connectedAtom)) { return connectedAtom; ...
[ "public", "IAtom", "getPlacedHeavyAtom", "(", "IAtomContainer", "molecule", ",", "IAtom", "atom", ")", "{", "List", "<", "IBond", ">", "bonds", "=", "molecule", ".", "getConnectedBondsList", "(", "atom", ")", ";", "for", "(", "IBond", "bond", ":", "bonds", ...
Returns a placed atom connected to a given atom. @param molecule @param atom The Atom whose placed bonding partners are to be returned @return a placed heavy atom connected to a given atom author: steinbeck
[ "Returns", "a", "placed", "atom", "connected", "to", "a", "given", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L521-L530
114,697
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getPlacedHeavyAtom
public IAtom getPlacedHeavyAtom(IAtomContainer molecule, IAtom atomA, IAtom atomB) { List<IBond> bonds = molecule.getConnectedBondsList(atomA); for (IBond bond : bonds) { IAtom connectedAtom = bond.getOther(atomA); if (isPlacedHeavyAtom(connectedAtom) && !connectedAtom.equals(ato...
java
public IAtom getPlacedHeavyAtom(IAtomContainer molecule, IAtom atomA, IAtom atomB) { List<IBond> bonds = molecule.getConnectedBondsList(atomA); for (IBond bond : bonds) { IAtom connectedAtom = bond.getOther(atomA); if (isPlacedHeavyAtom(connectedAtom) && !connectedAtom.equals(ato...
[ "public", "IAtom", "getPlacedHeavyAtom", "(", "IAtomContainer", "molecule", ",", "IAtom", "atomA", ",", "IAtom", "atomB", ")", "{", "List", "<", "IBond", ">", "bonds", "=", "molecule", ".", "getConnectedBondsList", "(", "atomA", ")", ";", "for", "(", "IBond"...
Gets the first placed Heavy Atom around atomA which is not atomB. @param molecule @param atomA Description of the Parameter @param atomB Description of the Parameter @return The placedHeavyAtom value
[ "Gets", "the", "first", "placed", "Heavy", "Atom", "around", "atomA", "which", "is", "not", "atomB", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L540-L549
114,698
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getPlacedHeavyAtoms
public IAtomContainer getPlacedHeavyAtoms(IAtomContainer molecule, IAtom atom) { List<IBond> bonds = molecule.getConnectedBondsList(atom); IAtomContainer connectedAtoms = molecule.getBuilder().newInstance(IAtomContainer.class); IAtom connectedAtom = null; for (IBond bond : bonds) { ...
java
public IAtomContainer getPlacedHeavyAtoms(IAtomContainer molecule, IAtom atom) { List<IBond> bonds = molecule.getConnectedBondsList(atom); IAtomContainer connectedAtoms = molecule.getBuilder().newInstance(IAtomContainer.class); IAtom connectedAtom = null; for (IBond bond : bonds) { ...
[ "public", "IAtomContainer", "getPlacedHeavyAtoms", "(", "IAtomContainer", "molecule", ",", "IAtom", "atom", ")", "{", "List", "<", "IBond", ">", "bonds", "=", "molecule", ".", "getConnectedBondsList", "(", "atom", ")", ";", "IAtomContainer", "connectedAtoms", "=",...
Gets the placed Heavy Atoms connected to an atom. @param molecule @param atom The atom the atoms must be connected to. @return The placed heavy atoms.
[ "Gets", "the", "placed", "Heavy", "Atoms", "connected", "to", "an", "atom", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L558-L570
114,699
cdk/cdk
tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java
AtomPlacer3D.getAllPlacedAtoms
private IAtomContainer getAllPlacedAtoms(IAtomContainer molecule) { IAtomContainer placedAtoms = new AtomContainer(); for (int i = 0; i < molecule.getAtomCount(); i++) { if (molecule.getAtom(i).getFlag(CDKConstants.ISPLACED)) { placedAtoms.addAtom(molecule.getAtom(i)); ...
java
private IAtomContainer getAllPlacedAtoms(IAtomContainer molecule) { IAtomContainer placedAtoms = new AtomContainer(); for (int i = 0; i < molecule.getAtomCount(); i++) { if (molecule.getAtom(i).getFlag(CDKConstants.ISPLACED)) { placedAtoms.addAtom(molecule.getAtom(i)); ...
[ "private", "IAtomContainer", "getAllPlacedAtoms", "(", "IAtomContainer", "molecule", ")", "{", "IAtomContainer", "placedAtoms", "=", "new", "AtomContainer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "molecule", ".", "getAtomCount", "(", ...
Gets the allPlacedAtoms attribute of the AtomPlacer3D object. @return The allPlacedAtoms value
[ "Gets", "the", "allPlacedAtoms", "attribute", "of", "the", "AtomPlacer3D", "object", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/AtomPlacer3D.java#L593-L601