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,300 | cdk/cdk | base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java | AtomTypeAwareSaturationChecker.bondOrderCanBeIncreased | public boolean bondOrderCanBeIncreased(IBond bond, IAtomContainer atomContainer) throws CDKException {
boolean atom0isUnsaturated = false, atom1isUnsaturated = false;
double sum;
if (bond.getBegin().getBondOrderSum() == null) {
sum = getAtomBondordersum(bond.getEnd(), atomContainer);... | java | public boolean bondOrderCanBeIncreased(IBond bond, IAtomContainer atomContainer) throws CDKException {
boolean atom0isUnsaturated = false, atom1isUnsaturated = false;
double sum;
if (bond.getBegin().getBondOrderSum() == null) {
sum = getAtomBondordersum(bond.getEnd(), atomContainer);... | [
"public",
"boolean",
"bondOrderCanBeIncreased",
"(",
"IBond",
"bond",
",",
"IAtomContainer",
"atomContainer",
")",
"throws",
"CDKException",
"{",
"boolean",
"atom0isUnsaturated",
"=",
"false",
",",
"atom1isUnsaturated",
"=",
"false",
";",
"double",
"sum",
";",
"if",... | Check if the bond order can be increased. This method assumes that the
bond is between only two atoms.
@param bond The bond to check
@param atomContainer The {@link IAtomContainer} that the bond belongs to
@return True if it is possibly to increase the bond order
@throws CDKException | [
"Check",
"if",
"the",
"bond",
"order",
"can",
"be",
"increased",
".",
"This",
"method",
"assumes",
"that",
"the",
"bond",
"is",
"between",
"only",
"two",
"atoms",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java#L205-L251 |
114,301 | cdk/cdk | base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java | AtomTypeAwareSaturationChecker.getAtomBondordersum | private double getAtomBondordersum(IAtom atom, IAtomContainer mol) throws CDKException {
double sum = 0;
for (IBond bond : mol.bonds())
if (bond.contains(atom)) sum += BondManipulator.destroyBondOrder(bond.getOrder());
return sum;
} | java | private double getAtomBondordersum(IAtom atom, IAtomContainer mol) throws CDKException {
double sum = 0;
for (IBond bond : mol.bonds())
if (bond.contains(atom)) sum += BondManipulator.destroyBondOrder(bond.getOrder());
return sum;
} | [
"private",
"double",
"getAtomBondordersum",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"mol",
")",
"throws",
"CDKException",
"{",
"double",
"sum",
"=",
"0",
";",
"for",
"(",
"IBond",
"bond",
":",
"mol",
".",
"bonds",
"(",
")",
")",
"if",
"(",
"bond",
... | This method is used if, by some reason, the bond order sum is not set
for an atom.
@param atom The atom in question
@param mol The molecule that the atom belongs to
@return The bond order sum
@throws CDKException | [
"This",
"method",
"is",
"used",
"if",
"by",
"some",
"reason",
"the",
"bond",
"order",
"sum",
"is",
"not",
"set",
"for",
"an",
"atom",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java#L262-L269 |
114,302 | cdk/cdk | base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java | AtomTypeAwareSaturationChecker.bondsUsed | private double bondsUsed(IAtom atom, IAtomContainer atomContainer) throws CDKException {
int bondsToAtom = 0;
for (IBond bond : atomContainer.bonds())
if (bond.contains(atom)) bondsToAtom += BondManipulator.destroyBondOrder(bond.getOrder());
int implicitHydrogens;
if (atom.ge... | java | private double bondsUsed(IAtom atom, IAtomContainer atomContainer) throws CDKException {
int bondsToAtom = 0;
for (IBond bond : atomContainer.bonds())
if (bond.contains(atom)) bondsToAtom += BondManipulator.destroyBondOrder(bond.getOrder());
int implicitHydrogens;
if (atom.ge... | [
"private",
"double",
"bondsUsed",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"atomContainer",
")",
"throws",
"CDKException",
"{",
"int",
"bondsToAtom",
"=",
"0",
";",
"for",
"(",
"IBond",
"bond",
":",
"atomContainer",
".",
"bonds",
"(",
")",
")",
"if",
"... | A small help method that count how many bonds an atom has, regarding
bonds due to its charge and to implicit hydrogens.
@param atom The atom to check
@param atomContainer The atomContainer containing the atom
@return The number of bonds that the atom has
@throws CDKException | [
"A",
"small",
"help",
"method",
"that",
"count",
"how",
"many",
"bonds",
"an",
"atom",
"has",
"regarding",
"bonds",
"due",
"to",
"its",
"charge",
"and",
"to",
"implicit",
"hydrogens",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java#L311-L342 |
114,303 | cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/SDFWriter.java | SDFWriter.ensureBuffered | private static BufferedWriter ensureBuffered(Writer wtr) {
if (wtr == null) throw new NullPointerException("Provided writer was null");
return wtr instanceof BufferedWriter ? (BufferedWriter) wtr
: new BufferedWriter(wtr);
} | java | private static BufferedWriter ensureBuffered(Writer wtr) {
if (wtr == null) throw new NullPointerException("Provided writer was null");
return wtr instanceof BufferedWriter ? (BufferedWriter) wtr
: new BufferedWriter(wtr);
} | [
"private",
"static",
"BufferedWriter",
"ensureBuffered",
"(",
"Writer",
"wtr",
")",
"{",
"if",
"(",
"wtr",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"Provided writer was null\"",
")",
";",
"return",
"wtr",
"instanceof",
"BufferedWriter",
"?... | Ensures a writer is buffered.
@param wtr writer, may be buffered
@return a BufferedWriter | [
"Ensures",
"a",
"writer",
"is",
"buffered",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/SDFWriter.java#L148-L152 |
114,304 | cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/WeightDescriptor.java | WeightDescriptor.setParameters | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length > 1) {
throw new CDKException("weight only expects one parameter");
}
if (!(params[0] instanceof String)) {
throw new CDKException("The parameter must be of type String");
... | java | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length > 1) {
throw new CDKException("weight only expects one parameter");
}
if (!(params[0] instanceof String)) {
throw new CDKException("The parameter must be of type String");
... | [
"@",
"Override",
"public",
"void",
"setParameters",
"(",
"Object",
"[",
"]",
"params",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"params",
".",
"length",
">",
"1",
")",
"{",
"throw",
"new",
"CDKException",
"(",
"\"weight only expects one parameter\"",
")"... | Sets the parameters attribute of the WeightDescriptor object.
@param params The new parameters value
@throws CDKException if more than 1 parameter is specified or if the parameter
is not of type String
@see #getParameters | [
"Sets",
"the",
"parameters",
"attribute",
"of",
"the",
"WeightDescriptor",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/WeightDescriptor.java#L104-L114 |
114,305 | cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/AtomTypeCharges.java | AtomTypeCharges.setInitialCharges | private IAtomContainer setInitialCharges(IAtomContainer ac) throws CDKException {
Matcher matOC = null;
Matcher matOP = null;
Matcher matOS = null;
Matcher mat_p = null;
Matcher mat_n = null;
String hoseCode = "";
for (int i = 0; i < ac.getAtomCount(); i++) {
... | java | private IAtomContainer setInitialCharges(IAtomContainer ac) throws CDKException {
Matcher matOC = null;
Matcher matOP = null;
Matcher matOS = null;
Matcher mat_p = null;
Matcher mat_n = null;
String hoseCode = "";
for (int i = 0; i < ac.getAtomCount(); i++) {
... | [
"private",
"IAtomContainer",
"setInitialCharges",
"(",
"IAtomContainer",
"ac",
")",
"throws",
"CDKException",
"{",
"Matcher",
"matOC",
"=",
"null",
";",
"Matcher",
"matOP",
"=",
"null",
";",
"Matcher",
"matOS",
"=",
"null",
";",
"Matcher",
"mat_p",
"=",
"null"... | Sets the initialCharges attribute of the AtomTypeCharges object.
@param ac AtomContainer
@return AtomContainer with (new) partial charges
@exception CDKException Description of the Exception | [
"Sets",
"the",
"initialCharges",
"attribute",
"of",
"the",
"AtomTypeCharges",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/AtomTypeCharges.java#L90-L127 |
114,306 | cdk/cdk | descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/AtomDegreeDescriptor.java | AtomDegreeDescriptor.calculate | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer container) {
int atomDegree = 0;
List<IAtom> neighboors = container.getConnectedAtomsList(atom);
for (IAtom neighboor : neighboors) {
if (!neighboor.getSymbol().equals("H")) atomDegree += 1;
}
r... | java | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer container) {
int atomDegree = 0;
List<IAtom> neighboors = container.getConnectedAtomsList(atom);
for (IAtom neighboor : neighboors) {
if (!neighboor.getSymbol().equals("H")) atomDegree += 1;
}
r... | [
"@",
"Override",
"public",
"DescriptorValue",
"calculate",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"container",
")",
"{",
"int",
"atomDegree",
"=",
"0",
";",
"List",
"<",
"IAtom",
">",
"neighboors",
"=",
"container",
".",
"getConnectedAtomsList",
"(",
"at... | This method calculates the number of not-H substituents of an atom.
@param atom The IAtom for which the DescriptorValue is requested
@param container The {@link IAtomContainer} for which this descriptor is to be calculated for
@return The number of bonds on the shortest path between two atoms | [
"This",
"method",
"calculates",
"the",
"number",
"of",
"not",
"-",
"H",
"substituents",
"of",
"an",
"atom",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/AtomDegreeDescriptor.java#L98-L107 |
114,307 | cdk/cdk | display/renderextra/src/main/java/org/openscience/cdk/renderer/MoleculeSetRenderer.java | MoleculeSetRenderer.paint | @Override
public void paint(IAtomContainerSet molecules, IDrawVisitor drawVisitor, Rectangle2D bounds, boolean resetCenter) {
// total up the bounding boxes
Rectangle2D totalBounds = BoundsCalculator.calculateBounds(molecules);
this.setupTransformToFit(bounds, totalBounds,
... | java | @Override
public void paint(IAtomContainerSet molecules, IDrawVisitor drawVisitor, Rectangle2D bounds, boolean resetCenter) {
// total up the bounding boxes
Rectangle2D totalBounds = BoundsCalculator.calculateBounds(molecules);
this.setupTransformToFit(bounds, totalBounds,
... | [
"@",
"Override",
"public",
"void",
"paint",
"(",
"IAtomContainerSet",
"molecules",
",",
"IDrawVisitor",
"drawVisitor",
",",
"Rectangle2D",
"bounds",
",",
"boolean",
"resetCenter",
")",
"{",
"// total up the bounding boxes",
"Rectangle2D",
"totalBounds",
"=",
"BoundsCalc... | Paint a set of molecules.
@param molecules the {@link IAtomContainerSet} to paint
@param drawVisitor the visitor that does the drawing
@param bounds the bounds on the screen
@param resetCenter
if true, set the draw center to be the center of bounds | [
"Paint",
"a",
"set",
"of",
"molecules",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderextra/src/main/java/org/openscience/cdk/renderer/MoleculeSetRenderer.java#L242-L253 |
114,308 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.augment | private boolean augment() {
// reset data structures
Arrays.fill(even, NIL);
Arrays.fill(odd, NIL);
dsf = new DisjointSetForest(graph.length);
bridges.clear();
queue.clear();
// enqueue every unmatched vertex and place in the
// even level (level = 0)
... | java | private boolean augment() {
// reset data structures
Arrays.fill(even, NIL);
Arrays.fill(odd, NIL);
dsf = new DisjointSetForest(graph.length);
bridges.clear();
queue.clear();
// enqueue every unmatched vertex and place in the
// even level (level = 0)
... | [
"private",
"boolean",
"augment",
"(",
")",
"{",
"// reset data structures",
"Arrays",
".",
"fill",
"(",
"even",
",",
"NIL",
")",
";",
"Arrays",
".",
"fill",
"(",
"odd",
",",
"NIL",
")",
";",
"dsf",
"=",
"new",
"DisjointSetForest",
"(",
"graph",
".",
"l... | Find an augmenting path an alternate it's matching. If an augmenting path
was found then the search must be restarted. If a blossom was detected
the blossom is contracted and the search continues.
@return an augmenting path was found | [
"Find",
"an",
"augmenting",
"path",
"an",
"alternate",
"it",
"s",
"matching",
".",
"If",
"an",
"augmenting",
"path",
"was",
"found",
"then",
"the",
"search",
"must",
"be",
"restarted",
".",
"If",
"a",
"blossom",
"was",
"detected",
"the",
"blossom",
"is",
... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L127-L177 |
114,309 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.check | private boolean check(int v, int w) {
// self-loop (within blossom) ignored
if (dsf.getRoot(v) == dsf.getRoot(w)) return false;
vAncestors.clear();
wAncestors.clear();
int vCurr = v;
int wCurr = w;
// walk back along the trees filling up 'vAncestors' and 'wAnce... | java | private boolean check(int v, int w) {
// self-loop (within blossom) ignored
if (dsf.getRoot(v) == dsf.getRoot(w)) return false;
vAncestors.clear();
wAncestors.clear();
int vCurr = v;
int wCurr = w;
// walk back along the trees filling up 'vAncestors' and 'wAnce... | [
"private",
"boolean",
"check",
"(",
"int",
"v",
",",
"int",
"w",
")",
"{",
"// self-loop (within blossom) ignored",
"if",
"(",
"dsf",
".",
"getRoot",
"(",
"v",
")",
"==",
"dsf",
".",
"getRoot",
"(",
"w",
")",
")",
"return",
"false",
";",
"vAncestors",
... | An edge was found which connects two 'even' vertices in the forest. If
the vertices have the same root we have a blossom otherwise we have
identified an augmenting path. This method checks for these cases and
responds accordingly.
If an augmenting path was found - then it's edges are alternated and the
method returns ... | [
"An",
"edge",
"was",
"found",
"which",
"connects",
"two",
"even",
"vertices",
"in",
"the",
"forest",
".",
"If",
"the",
"vertices",
"have",
"the",
"same",
"root",
"we",
"have",
"a",
"blossom",
"otherwise",
"we",
"have",
"identified",
"an",
"augmenting",
"pa... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L193-L242 |
114,310 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.parent | private int parent(BitSet ancestors, int curr) {
curr = dsf.getRoot(curr);
ancestors.set(curr);
int parent = dsf.getRoot(even[curr]);
if (parent == curr) return curr; // root of tree
ancestors.set(parent);
return dsf.getRoot(odd[parent]);
} | java | private int parent(BitSet ancestors, int curr) {
curr = dsf.getRoot(curr);
ancestors.set(curr);
int parent = dsf.getRoot(even[curr]);
if (parent == curr) return curr; // root of tree
ancestors.set(parent);
return dsf.getRoot(odd[parent]);
} | [
"private",
"int",
"parent",
"(",
"BitSet",
"ancestors",
",",
"int",
"curr",
")",
"{",
"curr",
"=",
"dsf",
".",
"getRoot",
"(",
"curr",
")",
";",
"ancestors",
".",
"set",
"(",
"curr",
")",
";",
"int",
"parent",
"=",
"dsf",
".",
"getRoot",
"(",
"even... | Access the next ancestor in a tree of the forest. Note we go back two
places at once as we only need check 'even' vertices.
@param ancestors temporary set which fills up the path we traversed
@param curr the current even vertex in the tree
@return the next 'even' vertex | [
"Access",
"the",
"next",
"ancestor",
"in",
"a",
"tree",
"of",
"the",
"forest",
".",
"Note",
"we",
"go",
"back",
"two",
"places",
"at",
"once",
"as",
"we",
"only",
"need",
"check",
"even",
"vertices",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L252-L259 |
114,311 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.blossom | private void blossom(int v, int w, int base) {
base = dsf.getRoot(base);
int[] supports1 = blossomSupports(v, w, base);
int[] supports2 = blossomSupports(w, v, base);
for (int i = 0; i < supports1.length; i++)
dsf.makeUnion(supports1[i], supports1[0]);
for (int i = 0... | java | private void blossom(int v, int w, int base) {
base = dsf.getRoot(base);
int[] supports1 = blossomSupports(v, w, base);
int[] supports2 = blossomSupports(w, v, base);
for (int i = 0; i < supports1.length; i++)
dsf.makeUnion(supports1[i], supports1[0]);
for (int i = 0... | [
"private",
"void",
"blossom",
"(",
"int",
"v",
",",
"int",
"w",
",",
"int",
"base",
")",
"{",
"base",
"=",
"dsf",
".",
"getRoot",
"(",
"base",
")",
";",
"int",
"[",
"]",
"supports1",
"=",
"blossomSupports",
"(",
"v",
",",
"w",
",",
"base",
")",
... | Create a new blossom for the specified 'bridge' edge.
@param v adjacent to w
@param w adjacent to v
@param base connected to the stem (common ancestor of v and w) | [
"Create",
"a",
"new",
"blossom",
"for",
"the",
"specified",
"bridge",
"edge",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L268-L279 |
114,312 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.augment | private void augment(int v) {
int n = buildPath(path, 0, v, NIL);
for (int i = 2; i < n; i += 2) {
matching.match(path[i], path[i - 1]);
}
} | java | private void augment(int v) {
int n = buildPath(path, 0, v, NIL);
for (int i = 2; i < n; i += 2) {
matching.match(path[i], path[i - 1]);
}
} | [
"private",
"void",
"augment",
"(",
"int",
"v",
")",
"{",
"int",
"n",
"=",
"buildPath",
"(",
"path",
",",
"0",
",",
"v",
",",
"NIL",
")",
";",
"for",
"(",
"int",
"i",
"=",
"2",
";",
"i",
"<",
"n",
";",
"i",
"+=",
"2",
")",
"{",
"matching",
... | Augment all ancestors in the tree of vertex 'v'.
@param v the leaf to augment from | [
"Augment",
"all",
"ancestors",
"in",
"the",
"tree",
"of",
"vertex",
"v",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L315-L320 |
114,313 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.buildPath | private int buildPath(int[] path, int i, int start, int goal) {
while (true) {
// lift the path through the contracted blossom
while (odd[start] != NIL) {
Tuple bridge = bridges.get(start);
// add to the path from the bridge down to where 'start'
... | java | private int buildPath(int[] path, int i, int start, int goal) {
while (true) {
// lift the path through the contracted blossom
while (odd[start] != NIL) {
Tuple bridge = bridges.get(start);
// add to the path from the bridge down to where 'start'
... | [
"private",
"int",
"buildPath",
"(",
"int",
"[",
"]",
"path",
",",
"int",
"i",
",",
"int",
"start",
",",
"int",
"goal",
")",
"{",
"while",
"(",
"true",
")",
"{",
"// lift the path through the contracted blossom",
"while",
"(",
"odd",
"[",
"start",
"]",
"!... | Builds the path backwards from the specified 'start' vertex until the
'goal'. If the path reaches a blossom then the path through the blossom
is lifted to the original graph.
@param path path storage
@param i offset (in path)
@param start start vertex
@param goal end vertex
@return the number of items set to the... | [
"Builds",
"the",
"path",
"backwards",
"from",
"the",
"specified",
"start",
"vertex",
"until",
"the",
"goal",
".",
"If",
"the",
"path",
"reaches",
"a",
"blossom",
"then",
"the",
"path",
"through",
"the",
"blossom",
"is",
"lifted",
"to",
"the",
"original",
"... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L333-L363 |
114,314 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.reverse | private static void reverse(int[] path, int i, int j) {
while (i < j) {
int tmp = path[i];
path[i] = path[j];
path[j] = tmp;
i++;
j--;
}
} | java | private static void reverse(int[] path, int i, int j) {
while (i < j) {
int tmp = path[i];
path[i] = path[j];
path[j] = tmp;
i++;
j--;
}
} | [
"private",
"static",
"void",
"reverse",
"(",
"int",
"[",
"]",
"path",
",",
"int",
"i",
",",
"int",
"j",
")",
"{",
"while",
"(",
"i",
"<",
"j",
")",
"{",
"int",
"tmp",
"=",
"path",
"[",
"i",
"]",
";",
"path",
"[",
"i",
"]",
"=",
"path",
"[",... | Reverse a section of a fixed size array.
@param path a path
@param i start index
@param j end index | [
"Reverse",
"a",
"section",
"of",
"a",
"fixed",
"size",
"array",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L372-L380 |
114,315 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java | EdmondsMaximumMatching.maxamise | static Matching maxamise(Matching matching, int[][] graph, BitSet subset) {
new EdmondsMaximumMatching(graph, matching, subset);
return matching;
} | java | static Matching maxamise(Matching matching, int[][] graph, BitSet subset) {
new EdmondsMaximumMatching(graph, matching, subset);
return matching;
} | [
"static",
"Matching",
"maxamise",
"(",
"Matching",
"matching",
",",
"int",
"[",
"]",
"[",
"]",
"graph",
",",
"BitSet",
"subset",
")",
"{",
"new",
"EdmondsMaximumMatching",
"(",
"graph",
",",
"matching",
",",
"subset",
")",
";",
"return",
"matching",
";",
... | Attempt to maximise the provided matching over a subset of vertices in a
graph.
@param matching the independent edge set to maximise
@param graph adjacency list graph representation
@param subset subset of vertices
@return the matching | [
"Attempt",
"to",
"maximise",
"the",
"provided",
"matching",
"over",
"a",
"subset",
"of",
"vertices",
"in",
"a",
"graph",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/EdmondsMaximumMatching.java#L391-L394 |
114,316 | cdk/cdk | storage/io/src/main/java/org/openscience/cdk/io/HINWriter.java | HINWriter.writeAtomContainer | private void writeAtomContainer(IAtomContainerSet som) throws IOException {
//int na = 0;
//String info = "";
String sym;
double chrg;
//boolean writecharge = true;
for (int molnum = 0; molnum < som.getAtomContainerCount(); molnum++) {
IAtomContainer mol = ... | java | private void writeAtomContainer(IAtomContainerSet som) throws IOException {
//int na = 0;
//String info = "";
String sym;
double chrg;
//boolean writecharge = true;
for (int molnum = 0; molnum < som.getAtomContainerCount(); molnum++) {
IAtomContainer mol = ... | [
"private",
"void",
"writeAtomContainer",
"(",
"IAtomContainerSet",
"som",
")",
"throws",
"IOException",
"{",
"//int na = 0;",
"//String info = \"\";",
"String",
"sym",
";",
"double",
"chrg",
";",
"//boolean writecharge = true;",
"for",
"(",
"int",
"molnum",
"=",
"0",
... | writes all the molecules supplied in a MoleculeSet class to
a single HIN file. You can also supply a single Molecule object
as well
@param som the set of molecules to write
@throws java.io.IOException if there is a problem writing the molecule | [
"writes",
"all",
"the",
"molecules",
"supplied",
"in",
"a",
"MoleculeSet",
"class",
"to",
"a",
"single",
"HIN",
"file",
".",
"You",
"can",
"also",
"supply",
"a",
"single",
"Molecule",
"object",
"as",
"well"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/io/src/main/java/org/openscience/cdk/io/HINWriter.java#L145-L217 |
114,317 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/templates/MoleculeFactory.java | MoleculeFactory.makePyrroleAnion | public static IAtomContainer makePyrroleAnion() {
IAtomContainer mol = new AtomContainer();
IAtom nitrogenAnion = new Atom("N");
nitrogenAnion.setFormalCharge(-1);
mol.addAtom(new Atom("C")); // 0
mol.addAtom(nitrogenAnion); // 1
mol.addAtom(new Atom("C")); // 2
m... | java | public static IAtomContainer makePyrroleAnion() {
IAtomContainer mol = new AtomContainer();
IAtom nitrogenAnion = new Atom("N");
nitrogenAnion.setFormalCharge(-1);
mol.addAtom(new Atom("C")); // 0
mol.addAtom(nitrogenAnion); // 1
mol.addAtom(new Atom("C")); // 2
m... | [
"public",
"static",
"IAtomContainer",
"makePyrroleAnion",
"(",
")",
"{",
"IAtomContainer",
"mol",
"=",
"new",
"AtomContainer",
"(",
")",
";",
"IAtom",
"nitrogenAnion",
"=",
"new",
"Atom",
"(",
"\"N\"",
")",
";",
"nitrogenAnion",
".",
"setFormalCharge",
"(",
"-... | Returns pyrrole anion without explicit hydrogens.
@cdk.inchi InChI=1/C4H4N/c1-2-4-5-3-1/h1-4H/q-1 | [
"Returns",
"pyrrole",
"anion",
"without",
"explicit",
"hydrogens",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/templates/MoleculeFactory.java#L659-L676 |
114,318 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/templates/MoleculeFactory.java | MoleculeFactory.makePyridineOxide | public static IAtomContainer makePyridineOxide() {
IAtomContainer mol = new AtomContainer();
mol.addAtom(new Atom("C")); // 0
mol.addAtom(new Atom("N")); // 1
mol.getAtom(1).setFormalCharge(1);
mol.addAtom(new Atom("C")); // 2
mol.addAtom(new Atom("C")); // 3
mol.... | java | public static IAtomContainer makePyridineOxide() {
IAtomContainer mol = new AtomContainer();
mol.addAtom(new Atom("C")); // 0
mol.addAtom(new Atom("N")); // 1
mol.getAtom(1).setFormalCharge(1);
mol.addAtom(new Atom("C")); // 2
mol.addAtom(new Atom("C")); // 3
mol.... | [
"public",
"static",
"IAtomContainer",
"makePyridineOxide",
"(",
")",
"{",
"IAtomContainer",
"mol",
"=",
"new",
"AtomContainer",
"(",
")",
";",
"mol",
".",
"addAtom",
"(",
"new",
"Atom",
"(",
"\"C\"",
")",
")",
";",
"// 0",
"mol",
".",
"addAtom",
"(",
"ne... | Returns pyridine oxide without explicit hydrogens.
@cdk.inchi InChI=1/C5H5NO/c7-6-4-2-1-3-5-6/h1-5H | [
"Returns",
"pyridine",
"oxide",
"without",
"explicit",
"hydrogens",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/templates/MoleculeFactory.java#L927-L948 |
114,319 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/ring/HanserRingFinder.java | HanserRingFinder.findRings | @Override
public Collection<List<IAtom>> findRings(IAtomContainer molecule) {
if (molecule == null) return null;
rings.clear();
PathGraph graph = new PathGraph(molecule);
for (int i = 0; i < molecule.getAtomCount(); i++) {
List<PathEdge> edges = graph.remove(molecule.get... | java | @Override
public Collection<List<IAtom>> findRings(IAtomContainer molecule) {
if (molecule == null) return null;
rings.clear();
PathGraph graph = new PathGraph(molecule);
for (int i = 0; i < molecule.getAtomCount(); i++) {
List<PathEdge> edges = graph.remove(molecule.get... | [
"@",
"Override",
"public",
"Collection",
"<",
"List",
"<",
"IAtom",
">",
">",
"findRings",
"(",
"IAtomContainer",
"molecule",
")",
"{",
"if",
"(",
"molecule",
"==",
"null",
")",
"return",
"null",
";",
"rings",
".",
"clear",
"(",
")",
";",
"PathGraph",
... | Returns a collection of rings.
@param molecule
@return a {@link Collection} of {@link List}s containing one ring each
@see org.openscience.cdk.smsd.ring.RingFinder#findRings(org.openscience.cdk.interfaces.IAtomContainer) | [
"Returns",
"a",
"collection",
"of",
"rings",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/ring/HanserRingFinder.java#L98-L114 |
114,320 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/ring/HanserRingFinder.java | HanserRingFinder.getRingSet | @Override
public IRingSet getRingSet(IAtomContainer molecule) throws CDKException {
Collection<List<IAtom>> cycles = findRings(molecule);
IRingSet ringSet = molecule.getBuilder().newInstance(IRingSet.class);
for (List<IAtom> ringAtoms : cycles) {
IRing ring = molecule.getBuild... | java | @Override
public IRingSet getRingSet(IAtomContainer molecule) throws CDKException {
Collection<List<IAtom>> cycles = findRings(molecule);
IRingSet ringSet = molecule.getBuilder().newInstance(IRingSet.class);
for (List<IAtom> ringAtoms : cycles) {
IRing ring = molecule.getBuild... | [
"@",
"Override",
"public",
"IRingSet",
"getRingSet",
"(",
"IAtomContainer",
"molecule",
")",
"throws",
"CDKException",
"{",
"Collection",
"<",
"List",
"<",
"IAtom",
">>",
"cycles",
"=",
"findRings",
"(",
"molecule",
")",
";",
"IRingSet",
"ringSet",
"=",
"molec... | Returns Ring set based on Hanser Ring Finding method
@param molecule
@return report collected the rings
@see org.openscience.cdk.smsd.ring.RingFinder#getRingSet(org.openscience.cdk.interfaces.IAtomContainer) | [
"Returns",
"Ring",
"set",
"based",
"on",
"Hanser",
"Ring",
"Finding",
"method"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/ring/HanserRingFinder.java#L122-L147 |
114,321 | cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/ALOGPDescriptor.java | ALOGPDescriptor.calculate | @Override
public DescriptorValue calculate(IAtomContainer container) {
IRingSet rs;
try {
AllRingsFinder arf = new AllRingsFinder();
rs = arf.findAllRings(container);
} catch (Exception e) {
return getDummyDescriptorValue(new CDKException("Could not find a... | java | @Override
public DescriptorValue calculate(IAtomContainer container) {
IRingSet rs;
try {
AllRingsFinder arf = new AllRingsFinder();
rs = arf.findAllRings(container);
} catch (Exception e) {
return getDummyDescriptorValue(new CDKException("Could not find a... | [
"@",
"Override",
"public",
"DescriptorValue",
"calculate",
"(",
"IAtomContainer",
"container",
")",
"{",
"IRingSet",
"rs",
";",
"try",
"{",
"AllRingsFinder",
"arf",
"=",
"new",
"AllRingsFinder",
"(",
")",
";",
"rs",
"=",
"arf",
".",
"findAllRings",
"(",
"con... | The AlogP descriptor.
TODO Ideally we should explicit H addition should be cached
@param atomContainer the molecule to calculate on
@return the result of the calculation | [
"The",
"AlogP",
"descriptor",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/ALOGPDescriptor.java#L2069-L2118 |
114,322 | cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java | CxSmilesParser.processAtomLabels | private static boolean processAtomLabels(final CharIter iter, final Map<Integer, String> dest) {
int atomIdx = 0;
while (iter.hasNext()) {
// fast forward through empty labels
while (iter.nextIf(';'))
atomIdx++;
char c = iter.next();
if (... | java | private static boolean processAtomLabels(final CharIter iter, final Map<Integer, String> dest) {
int atomIdx = 0;
while (iter.hasNext()) {
// fast forward through empty labels
while (iter.nextIf(';'))
atomIdx++;
char c = iter.next();
if (... | [
"private",
"static",
"boolean",
"processAtomLabels",
"(",
"final",
"CharIter",
"iter",
",",
"final",
"Map",
"<",
"Integer",
",",
"String",
">",
"dest",
")",
"{",
"int",
"atomIdx",
"=",
"0",
";",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",... | Process atom labels from extended SMILES in a char iter.
@param iter char iteration
@param dest destination of labels (atomidx->label)
@return parse success/failure | [
"Process",
"atom",
"labels",
"from",
"extended",
"SMILES",
"in",
"a",
"char",
"iter",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java#L66-L121 |
114,323 | cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java | CxSmilesParser.processPolymerSgroups | private static boolean processPolymerSgroups(CharIter iter, CxSmilesState state) {
if (state.sgroups == null)
state.sgroups = new ArrayList<>();
int beg = iter.pos;
while (iter.hasNext() && !isSgroupDelim(iter.curr()))
iter.next();
final String keyword = iter.subs... | java | private static boolean processPolymerSgroups(CharIter iter, CxSmilesState state) {
if (state.sgroups == null)
state.sgroups = new ArrayList<>();
int beg = iter.pos;
while (iter.hasNext() && !isSgroupDelim(iter.curr()))
iter.next();
final String keyword = iter.subs... | [
"private",
"static",
"boolean",
"processPolymerSgroups",
"(",
"CharIter",
"iter",
",",
"CxSmilesState",
"state",
")",
"{",
"if",
"(",
"state",
".",
"sgroups",
"==",
"null",
")",
"state",
".",
"sgroups",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"int",
... | Polymer Sgroups describe variations of repeating units. Only the atoms and not crossing bonds are written.
@param iter input characters, iterator is progressed by this method
@param state output CXSMILES state
@return parse was a success (or not) | [
"Polymer",
"Sgroups",
"describe",
"variations",
"of",
"repeating",
"units",
".",
"Only",
"the",
"atoms",
"and",
"not",
"crossing",
"bonds",
"are",
"written",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java#L281-L328 |
114,324 | cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java | CxSmilesParser.processRadicals | private static boolean processRadicals(CharIter iter, CxSmilesState state) {
if (state.atomRads == null)
state.atomRads = new TreeMap<>();
CxSmilesState.Radical rad;
switch (iter.next()) {
case '1':
rad = CxSmilesState.Radical.Monovalent;
b... | java | private static boolean processRadicals(CharIter iter, CxSmilesState state) {
if (state.atomRads == null)
state.atomRads = new TreeMap<>();
CxSmilesState.Radical rad;
switch (iter.next()) {
case '1':
rad = CxSmilesState.Radical.Monovalent;
b... | [
"private",
"static",
"boolean",
"processRadicals",
"(",
"CharIter",
"iter",
",",
"CxSmilesState",
"state",
")",
"{",
"if",
"(",
"state",
".",
"atomRads",
"==",
"null",
")",
"state",
".",
"atomRads",
"=",
"new",
"TreeMap",
"<>",
"(",
")",
";",
"CxSmilesStat... | CXSMILES radicals.
@param iter input characters, iterator is progressed by this method
@param state output CXSMILES state
@return parse was a success (or not) | [
"CXSMILES",
"radicals",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java#L364-L401 |
114,325 | cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java | CxSmilesParser.processIntList | private static boolean processIntList(CharIter iter, char sep, List<Integer> dest) {
while (iter.hasNext()) {
char c = iter.curr();
if (isDigit(c)) {
int r = processUnsignedInt(iter);
if (r < 0) return false;
iter.nextIf(sep);
... | java | private static boolean processIntList(CharIter iter, char sep, List<Integer> dest) {
while (iter.hasNext()) {
char c = iter.curr();
if (isDigit(c)) {
int r = processUnsignedInt(iter);
if (r < 0) return false;
iter.nextIf(sep);
... | [
"private",
"static",
"boolean",
"processIntList",
"(",
"CharIter",
"iter",
",",
"char",
"sep",
",",
"List",
"<",
"Integer",
">",
"dest",
")",
"{",
"while",
"(",
"iter",
".",
"hasNext",
"(",
")",
")",
"{",
"char",
"c",
"=",
"iter",
".",
"curr",
"(",
... | Process a list of unsigned integers.
@param iter char iter
@param sep the separator
@param dest output
@return int-list was successfully processed | [
"Process",
"a",
"list",
"of",
"unsigned",
"integers",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/CxSmilesParser.java#L567-L581 |
114,326 | cdk/cdk | descriptor/qsar/src/main/java/org/openscience/cdk/qsar/AbstractBondDescriptor.java | AbstractBondDescriptor.getCachedDescriptorValue | public IDescriptorResult getCachedDescriptorValue(IBond bond) {
if (cachedDescriptorValues == null) return null;
return (IDescriptorResult) cachedDescriptorValues.get(bond);
} | java | public IDescriptorResult getCachedDescriptorValue(IBond bond) {
if (cachedDescriptorValues == null) return null;
return (IDescriptorResult) cachedDescriptorValues.get(bond);
} | [
"public",
"IDescriptorResult",
"getCachedDescriptorValue",
"(",
"IBond",
"bond",
")",
"{",
"if",
"(",
"cachedDescriptorValues",
"==",
"null",
")",
"return",
"null",
";",
"return",
"(",
"IDescriptorResult",
")",
"cachedDescriptorValues",
".",
"get",
"(",
"bond",
")... | Returns the cached DescriptorValue for the given IBond.
@param bond the IAtom for which the DescriptorValue is requested
@return null, if no DescriptorValue was cached for the given IBond | [
"Returns",
"the",
"cached",
"DescriptorValue",
"for",
"the",
"given",
"IBond",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsar/src/main/java/org/openscience/cdk/qsar/AbstractBondDescriptor.java#L60-L63 |
114,327 | cdk/cdk | display/renderextra/src/main/java/org/openscience/cdk/renderer/ReactionSetRenderer.java | ReactionSetRenderer.setup | @Override
public void setup(IReactionSet reactionSet, Rectangle screen) {
this.setScale(reactionSet);
Rectangle2D bounds = BoundsCalculator.calculateBounds(reactionSet);
this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY());
this.drawCenter = new Point2d(screen.get... | java | @Override
public void setup(IReactionSet reactionSet, Rectangle screen) {
this.setScale(reactionSet);
Rectangle2D bounds = BoundsCalculator.calculateBounds(reactionSet);
this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY());
this.drawCenter = new Point2d(screen.get... | [
"@",
"Override",
"public",
"void",
"setup",
"(",
"IReactionSet",
"reactionSet",
",",
"Rectangle",
"screen",
")",
"{",
"this",
".",
"setScale",
"(",
"reactionSet",
")",
";",
"Rectangle2D",
"bounds",
"=",
"BoundsCalculator",
".",
"calculateBounds",
"(",
"reactionS... | Setup the transformations necessary to draw this Reaction Set.
@param reactionSet
@param screen | [
"Setup",
"the",
"transformations",
"necessary",
"to",
"draw",
"this",
"Reaction",
"Set",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderextra/src/main/java/org/openscience/cdk/renderer/ReactionSetRenderer.java#L163-L170 |
114,328 | cdk/cdk | display/renderextra/src/main/java/org/openscience/cdk/renderer/ReactionSetRenderer.java | ReactionSetRenderer.setScale | @Override
public void setScale(IReactionSet reactionSet) {
double bondLength = AverageBondLengthCalculator.calculateAverageBondLength(reactionSet);
double scale = this.calculateScaleForBondLength(bondLength);
// store the scale so that other components can access it
this.rendererMod... | java | @Override
public void setScale(IReactionSet reactionSet) {
double bondLength = AverageBondLengthCalculator.calculateAverageBondLength(reactionSet);
double scale = this.calculateScaleForBondLength(bondLength);
// store the scale so that other components can access it
this.rendererMod... | [
"@",
"Override",
"public",
"void",
"setScale",
"(",
"IReactionSet",
"reactionSet",
")",
"{",
"double",
"bondLength",
"=",
"AverageBondLengthCalculator",
".",
"calculateAverageBondLength",
"(",
"reactionSet",
")",
";",
"double",
"scale",
"=",
"this",
".",
"calculateS... | Set the scale for an IReactionSet. It calculates the average bond length
of the model and calculates the multiplication factor to transform this
to the bond length that is set in the RendererModel.
@param reactionSet | [
"Set",
"the",
"scale",
"for",
"an",
"IReactionSet",
".",
"It",
"calculates",
"the",
"average",
"bond",
"length",
"of",
"the",
"model",
"and",
"calculates",
"the",
"multiplication",
"factor",
"to",
"transform",
"this",
"to",
"the",
"bond",
"length",
"that",
"... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderextra/src/main/java/org/openscience/cdk/renderer/ReactionSetRenderer.java#L179-L186 |
114,329 | cdk/cdk | display/renderextra/src/main/java/org/openscience/cdk/renderer/ReactionSetRenderer.java | ReactionSetRenderer.paint | @Override
public void paint(IReactionSet reactionSet, IDrawVisitor drawVisitor, Rectangle2D bounds, boolean resetCenter) {
// total up the bounding boxes
Rectangle2D totalBounds = BoundsCalculator.calculateBounds(reactionSet);
this.setupTransformToFit(bounds, totalBounds,
A... | java | @Override
public void paint(IReactionSet reactionSet, IDrawVisitor drawVisitor, Rectangle2D bounds, boolean resetCenter) {
// total up the bounding boxes
Rectangle2D totalBounds = BoundsCalculator.calculateBounds(reactionSet);
this.setupTransformToFit(bounds, totalBounds,
A... | [
"@",
"Override",
"public",
"void",
"paint",
"(",
"IReactionSet",
"reactionSet",
",",
"IDrawVisitor",
"drawVisitor",
",",
"Rectangle2D",
"bounds",
",",
"boolean",
"resetCenter",
")",
"{",
"// total up the bounding boxes",
"Rectangle2D",
"totalBounds",
"=",
"BoundsCalcula... | Paint a set of reactions.
@param reactionSet the reaction to paint
@param drawVisitor the visitor that does the drawing
@param bounds the bounds on the screen
@param resetCenter
if true, set the draw center to be the center of bounds | [
"Paint",
"a",
"set",
"of",
"reactions",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderextra/src/main/java/org/openscience/cdk/renderer/ReactionSetRenderer.java#L216-L232 |
114,330 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.translate2DCenterTo | public static void translate2DCenterTo(IAtomContainer container, Point2d p) {
Point2d com = get2DCenter(container);
Vector2d translation = new Vector2d(p.x - com.x, p.y - com.y);
for (IAtom atom : container.atoms()) {
if (atom.getPoint2d() != null) {
atom.getPoint2d()... | java | public static void translate2DCenterTo(IAtomContainer container, Point2d p) {
Point2d com = get2DCenter(container);
Vector2d translation = new Vector2d(p.x - com.x, p.y - com.y);
for (IAtom atom : container.atoms()) {
if (atom.getPoint2d() != null) {
atom.getPoint2d()... | [
"public",
"static",
"void",
"translate2DCenterTo",
"(",
"IAtomContainer",
"container",
",",
"Point2d",
"p",
")",
"{",
"Point2d",
"com",
"=",
"get2DCenter",
"(",
"container",
")",
";",
"Vector2d",
"translation",
"=",
"new",
"Vector2d",
"(",
"p",
".",
"x",
"-"... | Translates the geometric 2DCenter of the given AtomContainer container to the specified
Point2d p.
@param container AtomContainer which should be translated.
@param p New Location of the geometric 2D Center.
@see #get2DCenter
@see #translate2DCentreOfMassTo | [
"Translates",
"the",
"geometric",
"2DCenter",
"of",
"the",
"given",
"AtomContainer",
"container",
"to",
"the",
"specified",
"Point2d",
"p",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L521-L529 |
114,331 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.has2DCoordinates | public static boolean has2DCoordinates(IReaction reaction) {
for (IAtomContainer mol : reaction.getReactants().atomContainers())
if (!has2DCoordinates(mol))
return false;
for (IAtomContainer mol : reaction.getProducts().atomContainers())
if (!has2DCoordinates(mol)... | java | public static boolean has2DCoordinates(IReaction reaction) {
for (IAtomContainer mol : reaction.getReactants().atomContainers())
if (!has2DCoordinates(mol))
return false;
for (IAtomContainer mol : reaction.getProducts().atomContainers())
if (!has2DCoordinates(mol)... | [
"public",
"static",
"boolean",
"has2DCoordinates",
"(",
"IReaction",
"reaction",
")",
"{",
"for",
"(",
"IAtomContainer",
"mol",
":",
"reaction",
".",
"getReactants",
"(",
")",
".",
"atomContainers",
"(",
")",
")",
"if",
"(",
"!",
"has2DCoordinates",
"(",
"mo... | Determine if all parts of a reaction have coodinates
@param reaction a reaction
@return the reaction has coordinates | [
"Determine",
"if",
"all",
"parts",
"of",
"a",
"reaction",
"have",
"coodinates"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L976-L987 |
114,332 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.getBondLengthRMSD | public static double getBondLengthRMSD(IAtomContainer firstAtomContainer, IAtomContainer secondAtomContainer,
Map<Integer, Integer> mappedAtoms, boolean Coords3d) {
//logger.debug("**** GT getBondLengthRMSD ****");
Iterator<Integer> firstAtoms = mappedAtoms.keySet().iterator();
IAtom... | java | public static double getBondLengthRMSD(IAtomContainer firstAtomContainer, IAtomContainer secondAtomContainer,
Map<Integer, Integer> mappedAtoms, boolean Coords3d) {
//logger.debug("**** GT getBondLengthRMSD ****");
Iterator<Integer> firstAtoms = mappedAtoms.keySet().iterator();
IAtom... | [
"public",
"static",
"double",
"getBondLengthRMSD",
"(",
"IAtomContainer",
"firstAtomContainer",
",",
"IAtomContainer",
"secondAtomContainer",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"mappedAtoms",
",",
"boolean",
"Coords3d",
")",
"{",
"//logger.debug(\"**** GT ... | Return the RMSD of bonds length between the 2 aligned molecules.
@param firstAtomContainer the (largest) first aligned AtomContainer which is the reference
@param secondAtomContainer the second aligned AtomContainer
@param mappedAtoms Map: a Map of the mapped atoms
@param Coords3d boolean: true if ... | [
"Return",
"the",
"RMSD",
"of",
"bonds",
"length",
"between",
"the",
"2",
"aligned",
"molecules",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L1358-L1402 |
114,333 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.getAngleRMSD | public static double getAngleRMSD(IAtomContainer firstAtomContainer, IAtomContainer secondAtomContainer,
Map<Integer, Integer> mappedAtoms) {
//logger.debug("**** GT getAngleRMSD ****");
Iterator<Integer> firstAtoms = mappedAtoms.keySet().iterator();
//logger.debug("mappedAtoms:"+map... | java | public static double getAngleRMSD(IAtomContainer firstAtomContainer, IAtomContainer secondAtomContainer,
Map<Integer, Integer> mappedAtoms) {
//logger.debug("**** GT getAngleRMSD ****");
Iterator<Integer> firstAtoms = mappedAtoms.keySet().iterator();
//logger.debug("mappedAtoms:"+map... | [
"public",
"static",
"double",
"getAngleRMSD",
"(",
"IAtomContainer",
"firstAtomContainer",
",",
"IAtomContainer",
"secondAtomContainer",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"mappedAtoms",
")",
"{",
"//logger.debug(\"**** GT getAngleRMSD ****\");",
"Iterator",
... | Return the variation of each angle value between the 2 aligned molecules.
@param firstAtomContainer the (largest) first aligned AtomContainer which is the reference
@param secondAtomContainer the second aligned AtomContainer
@param mappedAtoms Map: a Map of the mapped atoms
@return double: the value of the RM... | [
"Return",
"the",
"variation",
"of",
"each",
"angle",
"value",
"between",
"the",
"2",
"aligned",
"molecules",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L1412-L1451 |
114,334 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKRMapHandler.java | CDKRMapHandler.calculateOverlapsAndReduce | public void calculateOverlapsAndReduce(IAtomContainer molecule1, IAtomContainer molecule2, boolean shouldMatchBonds)
throws CDKException {
setSource(molecule1);
setTarget(molecule2);
setMappings(new ArrayList<Map<Integer, Integer>>());
if ((getSource().getAtomCount() == 1)... | java | public void calculateOverlapsAndReduce(IAtomContainer molecule1, IAtomContainer molecule2, boolean shouldMatchBonds)
throws CDKException {
setSource(molecule1);
setTarget(molecule2);
setMappings(new ArrayList<Map<Integer, Integer>>());
if ((getSource().getAtomCount() == 1)... | [
"public",
"void",
"calculateOverlapsAndReduce",
"(",
"IAtomContainer",
"molecule1",
",",
"IAtomContainer",
"molecule2",
",",
"boolean",
"shouldMatchBonds",
")",
"throws",
"CDKException",
"{",
"setSource",
"(",
"molecule1",
")",
";",
"setTarget",
"(",
"molecule2",
")",... | This function calculates all the possible combinations of MCS
@param molecule1
@param molecule2
@param shouldMatchBonds
@throws CDKException | [
"This",
"function",
"calculates",
"all",
"the",
"possible",
"combinations",
"of",
"MCS"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/rgraph/CDKRMapHandler.java#L105-L144 |
114,335 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/io/setting/SettingManager.java | SettingManager.get | public <S extends T> S get(String name, Class<S> c) {
return (S) get(name);
} | java | public <S extends T> S get(String name, Class<S> c) {
return (S) get(name);
} | [
"public",
"<",
"S",
"extends",
"T",
">",
"S",
"get",
"(",
"String",
"name",
",",
"Class",
"<",
"S",
">",
"c",
")",
"{",
"return",
"(",
"S",
")",
"get",
"(",
"name",
")",
";",
"}"
] | Convenience method that allows specification of return ISetting type so that you can nest the call to
access the setting value.
<pre>{@code
SettingManager manager = ...;
manger.add(new BooleanIOSetting("Setting", ...));
if(manager.get("Setting", BooleanIOSetting.class).isSet()){
// do something
}
}</pre>
@param nam... | [
"Convenience",
"method",
"that",
"allows",
"specification",
"of",
"return",
"ISetting",
"type",
"so",
"that",
"you",
"can",
"nest",
"the",
"call",
"to",
"access",
"the",
"setting",
"value",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/io/setting/SettingManager.java#L208-L210 |
114,336 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java | AngularMomentum.getIy | public IMatrix getIy() {
return (new IMatrix(getIplus().sub(getIminus()))).mul(new Complex(0d, 1d)).mul(new Complex(0.5, 0d));
} | java | public IMatrix getIy() {
return (new IMatrix(getIplus().sub(getIminus()))).mul(new Complex(0d, 1d)).mul(new Complex(0.5, 0d));
} | [
"public",
"IMatrix",
"getIy",
"(",
")",
"{",
"return",
"(",
"new",
"IMatrix",
"(",
"getIplus",
"(",
")",
".",
"sub",
"(",
"getIminus",
"(",
")",
")",
")",
")",
".",
"mul",
"(",
"new",
"Complex",
"(",
"0d",
",",
"1d",
")",
")",
".",
"mul",
"(",
... | Calculates the Iy operator | [
"Calculates",
"the",
"Iy",
"operator"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java#L67-L69 |
114,337 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java | AngularMomentum.getIz | public IMatrix getIz() {
IMatrix Iz = new IMatrix(size, size);
int i, j;
for (i = 0; i < size; i++)
for (j = 0; j < size; j++) {
Iz.realmatrix[i][j] = 0d;
Iz.imagmatrix[i][j] = 0d;
}
for (i = 0; i < size; i++) {
Iz.realm... | java | public IMatrix getIz() {
IMatrix Iz = new IMatrix(size, size);
int i, j;
for (i = 0; i < size; i++)
for (j = 0; j < size; j++) {
Iz.realmatrix[i][j] = 0d;
Iz.imagmatrix[i][j] = 0d;
}
for (i = 0; i < size; i++) {
Iz.realm... | [
"public",
"IMatrix",
"getIz",
"(",
")",
"{",
"IMatrix",
"Iz",
"=",
"new",
"IMatrix",
"(",
"size",
",",
"size",
")",
";",
"int",
"i",
",",
"j",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"for",
"(",
"j",
"=",... | Calculates the Iz operator | [
"Calculates",
"the",
"Iz",
"operator"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java#L74-L87 |
114,338 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java | AngularMomentum.getIplus | public Matrix getIplus() {
Matrix Iplus = new Matrix(size, size);
int i, j;
for (i = 0; i < size; i++)
for (j = 0; j < size; j++)
Iplus.matrix[i][j] = 0d;
for (i = 1; i < size; i++)
Iplus.matrix[i - 1][i] = Math.sqrt(J * J + J - (J - i + 1) * (J - ... | java | public Matrix getIplus() {
Matrix Iplus = new Matrix(size, size);
int i, j;
for (i = 0; i < size; i++)
for (j = 0; j < size; j++)
Iplus.matrix[i][j] = 0d;
for (i = 1; i < size; i++)
Iplus.matrix[i - 1][i] = Math.sqrt(J * J + J - (J - i + 1) * (J - ... | [
"public",
"Matrix",
"getIplus",
"(",
")",
"{",
"Matrix",
"Iplus",
"=",
"new",
"Matrix",
"(",
"size",
",",
"size",
")",
";",
"int",
"i",
",",
"j",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"for",
"(",
"j",
"... | Calculates the I+ operator | [
"Calculates",
"the",
"I",
"+",
"operator"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java#L92-L101 |
114,339 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java | AngularMomentum.getIminus | public Matrix getIminus() {
Matrix Iminus = new Matrix(size, size);
int i, j;
for (i = 0; i < size; i++)
for (j = 0; j < size; j++)
Iminus.matrix[i][j] = 0d;
for (i = 1; i < size; i++)
Iminus.matrix[i][i - 1] = Math.sqrt(J * J + J - (J - i) * (J - ... | java | public Matrix getIminus() {
Matrix Iminus = new Matrix(size, size);
int i, j;
for (i = 0; i < size; i++)
for (j = 0; j < size; j++)
Iminus.matrix[i][j] = 0d;
for (i = 1; i < size; i++)
Iminus.matrix[i][i - 1] = Math.sqrt(J * J + J - (J - i) * (J - ... | [
"public",
"Matrix",
"getIminus",
"(",
")",
"{",
"Matrix",
"Iminus",
"=",
"new",
"Matrix",
"(",
"size",
",",
"size",
")",
";",
"int",
"i",
",",
"j",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"size",
";",
"i",
"++",
")",
"for",
"(",
"j",
... | Calculates the I- operator | [
"Calculates",
"the",
"I",
"-",
"operator"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java#L106-L115 |
114,340 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java | AngularMomentum.getSpinVector | public Vector getSpinVector(double theta, double phi) {
Vector spinvector = new Vector(3);
spinvector.vector[0] = Math.sin(theta) * Math.cos(phi);
spinvector.vector[1] = Math.sin(theta) * Math.sin(phi);
spinvector.vector[2] = Math.cos(phi);
return spinvector;
} | java | public Vector getSpinVector(double theta, double phi) {
Vector spinvector = new Vector(3);
spinvector.vector[0] = Math.sin(theta) * Math.cos(phi);
spinvector.vector[1] = Math.sin(theta) * Math.sin(phi);
spinvector.vector[2] = Math.cos(phi);
return spinvector;
} | [
"public",
"Vector",
"getSpinVector",
"(",
"double",
"theta",
",",
"double",
"phi",
")",
"{",
"Vector",
"spinvector",
"=",
"new",
"Vector",
"(",
"3",
")",
";",
"spinvector",
".",
"vector",
"[",
"0",
"]",
"=",
"Math",
".",
"sin",
"(",
"theta",
")",
"*"... | Calculates a spin vector by a direction specified by theta and phi | [
"Calculates",
"a",
"spin",
"vector",
"by",
"a",
"direction",
"specified",
"by",
"theta",
"and",
"phi"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/math/qm/AngularMomentum.java#L120-L126 |
114,341 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/RingManipulator.java | RingManipulator.markAromaticRings | public static void markAromaticRings(IRing ring) {
// return as soon as the conditions are not met:
// 1. all atoms are labeled aromatic
for (IAtom atom : ring.atoms())
if (!atom.getFlag(CDKConstants.ISAROMATIC)) return;
// 2. all bonds are labeled aromatic
for (IBon... | java | public static void markAromaticRings(IRing ring) {
// return as soon as the conditions are not met:
// 1. all atoms are labeled aromatic
for (IAtom atom : ring.atoms())
if (!atom.getFlag(CDKConstants.ISAROMATIC)) return;
// 2. all bonds are labeled aromatic
for (IBon... | [
"public",
"static",
"void",
"markAromaticRings",
"(",
"IRing",
"ring",
")",
"{",
"// return as soon as the conditions are not met:",
"// 1. all atoms are labeled aromatic",
"for",
"(",
"IAtom",
"atom",
":",
"ring",
".",
"atoms",
"(",
")",
")",
"if",
"(",
"!",
"atom"... | Marks the ring aromatic if all atoms and all bonds are aromatic.
The method assumes that aromaticity of atoms and bonds have been
detected beforehand
@param ring The ring to examine | [
"Marks",
"the",
"ring",
"aromatic",
"if",
"all",
"atoms",
"and",
"all",
"bonds",
"are",
"aromatic",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/RingManipulator.java#L44-L56 |
114,342 | cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/VAdjMaDescriptor.java | VAdjMaDescriptor.calculate | @Override
public DescriptorValue calculate(IAtomContainer atomContainer) {
int n = 0; // count all heavy atom - heavy atom bonds
for (IBond bond : atomContainer.bonds()) {
if (bond.getBegin().getAtomicNumber() != 1 && bond.getEnd().getAtomicNumber() != 1) {
n++;
... | java | @Override
public DescriptorValue calculate(IAtomContainer atomContainer) {
int n = 0; // count all heavy atom - heavy atom bonds
for (IBond bond : atomContainer.bonds()) {
if (bond.getBegin().getAtomicNumber() != 1 && bond.getEnd().getAtomicNumber() != 1) {
n++;
... | [
"@",
"Override",
"public",
"DescriptorValue",
"calculate",
"(",
"IAtomContainer",
"atomContainer",
")",
"{",
"int",
"n",
"=",
"0",
";",
"// count all heavy atom - heavy atom bonds",
"for",
"(",
"IBond",
"bond",
":",
"atomContainer",
".",
"bonds",
"(",
")",
")",
... | calculates the VAdjMa descriptor for an atom container
@param atomContainer AtomContainer
@return VAdjMa | [
"calculates",
"the",
"VAdjMa",
"descriptor",
"for",
"an",
"atom",
"container"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/VAdjMaDescriptor.java#L111-L127 |
114,343 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/atomtypes/AtomTypeReader.java | AtomTypeReader.readAtomTypes | public List<IAtomType> readAtomTypes(IChemObjectBuilder builder) {
List<IAtomType> isotopes = new ArrayList<IAtomType>();
try {
parser.setFeature("http://xml.org/sax/features/validation", false);
logger.info("Deactivated validation");
} catch (SAXException exception) {
... | java | public List<IAtomType> readAtomTypes(IChemObjectBuilder builder) {
List<IAtomType> isotopes = new ArrayList<IAtomType>();
try {
parser.setFeature("http://xml.org/sax/features/validation", false);
logger.info("Deactivated validation");
} catch (SAXException exception) {
... | [
"public",
"List",
"<",
"IAtomType",
">",
"readAtomTypes",
"(",
"IChemObjectBuilder",
"builder",
")",
"{",
"List",
"<",
"IAtomType",
">",
"isotopes",
"=",
"new",
"ArrayList",
"<",
"IAtomType",
">",
"(",
")",
";",
"try",
"{",
"parser",
".",
"setFeature",
"("... | Reads the atom types from the data file.
@param builder The IChemObjectBuilder used to create new IAtomType's.
@return a List with atom types. Is empty if some reading error occurred. | [
"Reads",
"the",
"atom",
"types",
"from",
"the",
"data",
"file",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/atomtypes/AtomTypeReader.java#L117-L139 |
114,344 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java | MolecularFormula.addIsotope | @Override
public IMolecularFormula addIsotope(IIsotope isotope, int count) {
if (count == 0)
return this;
boolean flag = false;
for (IIsotope thisIsotope : isotopes()) {
if (isTheSame(thisIsotope, isotope)) {
isotopes.put(thisIsotope, isotopes.get(this... | java | @Override
public IMolecularFormula addIsotope(IIsotope isotope, int count) {
if (count == 0)
return this;
boolean flag = false;
for (IIsotope thisIsotope : isotopes()) {
if (isTheSame(thisIsotope, isotope)) {
isotopes.put(thisIsotope, isotopes.get(this... | [
"@",
"Override",
"public",
"IMolecularFormula",
"addIsotope",
"(",
"IIsotope",
"isotope",
",",
"int",
"count",
")",
"{",
"if",
"(",
"count",
"==",
"0",
")",
"return",
"this",
";",
"boolean",
"flag",
"=",
"false",
";",
"for",
"(",
"IIsotope",
"thisIsotope",... | Adds an Isotope to this MolecularFormula in a number of occurrences.
@param isotope The isotope to be added to this MolecularFormula
@param count The number of occurrences to add
@see #addIsotope(IIsotope) | [
"Adds",
"an",
"Isotope",
"to",
"this",
"MolecularFormula",
"in",
"a",
"number",
"of",
"occurrences",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java#L111-L128 |
114,345 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java | MolecularFormula.contains | @Override
public boolean contains(IIsotope isotope) {
for (IIsotope thisIsotope : isotopes()) {
if (isTheSame(thisIsotope, isotope)) {
return true;
}
}
return false;
} | java | @Override
public boolean contains(IIsotope isotope) {
for (IIsotope thisIsotope : isotopes()) {
if (isTheSame(thisIsotope, isotope)) {
return true;
}
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"contains",
"(",
"IIsotope",
"isotope",
")",
"{",
"for",
"(",
"IIsotope",
"thisIsotope",
":",
"isotopes",
"(",
")",
")",
"{",
"if",
"(",
"isTheSame",
"(",
"thisIsotope",
",",
"isotope",
")",
")",
"{",
"return",
"true... | True, if the MolecularFormula contains the given IIsotope object and not
the instance. The method looks for other isotopes which has the same
symbol, natural abundance and exact mass.
@param isotope The IIsotope this MolecularFormula is searched for
@return True, if the MolecularFormula contains the given i... | [
"True",
"if",
"the",
"MolecularFormula",
"contains",
"the",
"given",
"IIsotope",
"object",
"and",
"not",
"the",
"instance",
".",
"The",
"method",
"looks",
"for",
"other",
"isotopes",
"which",
"has",
"the",
"same",
"symbol",
"natural",
"abundance",
"and",
"exac... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java#L138-L146 |
114,346 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java | MolecularFormula.getIsotopeCount | @Override
public int getIsotopeCount(IIsotope isotope) {
return !contains(isotope) ? 0 : isotopes.get(getIsotope(isotope));
} | java | @Override
public int getIsotopeCount(IIsotope isotope) {
return !contains(isotope) ? 0 : isotopes.get(getIsotope(isotope));
} | [
"@",
"Override",
"public",
"int",
"getIsotopeCount",
"(",
"IIsotope",
"isotope",
")",
"{",
"return",
"!",
"contains",
"(",
"isotope",
")",
"?",
"0",
":",
"isotopes",
".",
"get",
"(",
"getIsotope",
"(",
"isotope",
")",
")",
";",
"}"
] | Checks a set of Nodes for the occurrence of the isotope in the
IMolecularFormula from a particular isotope. It returns 0 if the does not exist.
@param isotope The IIsotope to look for
@return The occurrence of this isotope in this IMolecularFormula
@see #getIsotopeCoun... | [
"Checks",
"a",
"set",
"of",
"Nodes",
"for",
"the",
"occurrence",
"of",
"the",
"isotope",
"in",
"the",
"IMolecularFormula",
"from",
"a",
"particular",
"isotope",
".",
"It",
"returns",
"0",
"if",
"the",
"does",
"not",
"exist",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java#L164-L167 |
114,347 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java | MolecularFormula.lazyProperties | private Map<Object, Object> lazyProperties() {
if (properties == null) {
properties = new Hashtable<Object, Object>();
}
return properties;
} | java | private Map<Object, Object> lazyProperties() {
if (properties == null) {
properties = new Hashtable<Object, Object>();
}
return properties;
} | [
"private",
"Map",
"<",
"Object",
",",
"Object",
">",
"lazyProperties",
"(",
")",
"{",
"if",
"(",
"properties",
"==",
"null",
")",
"{",
"properties",
"=",
"new",
"Hashtable",
"<",
"Object",
",",
"Object",
">",
"(",
")",
";",
"}",
"return",
"properties",... | Lazy creation of properties hash. I should
integrate into ChemObject.
@return Returns in instance of the properties | [
"Lazy",
"creation",
"of",
"properties",
"hash",
".",
"I",
"should",
"integrate",
"into",
"ChemObject",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/MolecularFormula.java#L267-L272 |
114,348 | cdk/cdk | storage/io/src/main/java/org/openscience/cdk/io/program/GaussianInputWriter.java | GaussianInputWriter.writeMolecule | public void writeMolecule(IAtomContainer mol) throws IOException {
customizeJob();
// write extra statements
if (proccount.getSettingValue() > 1) {
writer.write("%nprocl=" + proccount.getSettingValue());
writer.write('\n');
}
if (!memory.getSetting().equ... | java | public void writeMolecule(IAtomContainer mol) throws IOException {
customizeJob();
// write extra statements
if (proccount.getSettingValue() > 1) {
writer.write("%nprocl=" + proccount.getSettingValue());
writer.write('\n');
}
if (!memory.getSetting().equ... | [
"public",
"void",
"writeMolecule",
"(",
"IAtomContainer",
"mol",
")",
"throws",
"IOException",
"{",
"customizeJob",
"(",
")",
";",
"// write extra statements",
"if",
"(",
"proccount",
".",
"getSettingValue",
"(",
")",
">",
"1",
")",
"{",
"writer",
".",
"write"... | Writes a molecule for input for Gaussian. | [
"Writes",
"a",
"molecule",
"for",
"input",
"for",
"Gaussian",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/io/src/main/java/org/openscience/cdk/io/program/GaussianInputWriter.java#L139-L224 |
114,349 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.extractSubstructure | public static IAtomContainer extractSubstructure(IAtomContainer atomContainer, int... atomIndices)
throws CloneNotSupportedException {
IAtomContainer substructure = (IAtomContainer) atomContainer.clone();
int numberOfAtoms = substructure.getAtomCount();
IAtom[] atoms = new IAtom[numb... | java | public static IAtomContainer extractSubstructure(IAtomContainer atomContainer, int... atomIndices)
throws CloneNotSupportedException {
IAtomContainer substructure = (IAtomContainer) atomContainer.clone();
int numberOfAtoms = substructure.getAtomCount();
IAtom[] atoms = new IAtom[numb... | [
"public",
"static",
"IAtomContainer",
"extractSubstructure",
"(",
"IAtomContainer",
"atomContainer",
",",
"int",
"...",
"atomIndices",
")",
"throws",
"CloneNotSupportedException",
"{",
"IAtomContainer",
"substructure",
"=",
"(",
"IAtomContainer",
")",
"atomContainer",
"."... | Extract a substructure from an atom container, in the form of a new
cloned atom container with only the atoms with indices in atomIndices and
bonds that connect these atoms.
Note that this may result in a disconnected atom container.
@param atomContainer the source container to extract from
@param atomIndices the ind... | [
"Extract",
"a",
"substructure",
"from",
"an",
"atom",
"container",
"in",
"the",
"form",
"of",
"a",
"new",
"cloned",
"atom",
"container",
"with",
"only",
"the",
"atoms",
"with",
"indices",
"in",
"atomIndices",
"and",
"bonds",
"that",
"connect",
"these",
"atom... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L138-L156 |
114,350 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getAtomById | public static IAtom getAtomById(IAtomContainer ac, String id) throws CDKException {
for (int i = 0; i < ac.getAtomCount(); i++) {
if (ac.getAtom(i).getID() != null && ac.getAtom(i).getID().equals(id)) return ac.getAtom(i);
}
throw new CDKException("no suc atom");
} | java | public static IAtom getAtomById(IAtomContainer ac, String id) throws CDKException {
for (int i = 0; i < ac.getAtomCount(); i++) {
if (ac.getAtom(i).getID() != null && ac.getAtom(i).getID().equals(id)) return ac.getAtom(i);
}
throw new CDKException("no suc atom");
} | [
"public",
"static",
"IAtom",
"getAtomById",
"(",
"IAtomContainer",
"ac",
",",
"String",
"id",
")",
"throws",
"CDKException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ac",
".",
"getAtomCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
... | Returns an atom in an atomcontainer identified by id
@param ac The AtomContainer to search in
@param id The id to search for
@return An atom having id id
@throws CDKException There is no such atom | [
"Returns",
"an",
"atom",
"in",
"an",
"atomcontainer",
"identified",
"by",
"id"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L166-L171 |
114,351 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.replaceAtomByAtom | public static boolean replaceAtomByAtom(final IAtomContainer container, final IAtom oldAtom, final IAtom newAtom) {
if (oldAtom == null)
throw new NullPointerException("Atom to be replaced was null!");
if (newAtom == null)
throw new NullPointerException("Replacement atom was null... | java | public static boolean replaceAtomByAtom(final IAtomContainer container, final IAtom oldAtom, final IAtom newAtom) {
if (oldAtom == null)
throw new NullPointerException("Atom to be replaced was null!");
if (newAtom == null)
throw new NullPointerException("Replacement atom was null... | [
"public",
"static",
"boolean",
"replaceAtomByAtom",
"(",
"final",
"IAtomContainer",
"container",
",",
"final",
"IAtom",
"oldAtom",
",",
"final",
"IAtom",
"newAtom",
")",
"{",
"if",
"(",
"oldAtom",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
... | Substitute one atom in a container for another adjusting bonds, single electrons, lone pairs, and stereochemistry
as required.
@param container the container to replace the atom of
@param oldAtom the atom to replace
@param newAtom the atom to insert
@return whether replacement was made | [
"Substitute",
"one",
"atom",
"in",
"a",
"container",
"for",
"another",
"adjusting",
"bonds",
"single",
"electrons",
"lone",
"pairs",
"and",
"stereochemistry",
"as",
"required",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L182-L223 |
114,352 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getTotalCharge | public static double getTotalCharge(IAtomContainer atomContainer) {
double charge = 0.0;
for (IAtom atom : atomContainer.atoms()) {
// we assume CDKConstant.UNSET is equal to 0
Double thisCharge = atom.getCharge();
if (thisCharge != CDKConstants.UNSET) charge += thisC... | java | public static double getTotalCharge(IAtomContainer atomContainer) {
double charge = 0.0;
for (IAtom atom : atomContainer.atoms()) {
// we assume CDKConstant.UNSET is equal to 0
Double thisCharge = atom.getCharge();
if (thisCharge != CDKConstants.UNSET) charge += thisC... | [
"public",
"static",
"double",
"getTotalCharge",
"(",
"IAtomContainer",
"atomContainer",
")",
"{",
"double",
"charge",
"=",
"0.0",
";",
"for",
"(",
"IAtom",
"atom",
":",
"atomContainer",
".",
"atoms",
"(",
")",
")",
"{",
"// we assume CDKConstant.UNSET is equal to ... | Get the summed charge of all atoms in an AtomContainer
@param atomContainer The IAtomContainer to manipulate
@return The summed charges of all atoms in this AtomContainer. | [
"Get",
"the",
"summed",
"charge",
"of",
"all",
"atoms",
"in",
"an",
"AtomContainer"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L231-L239 |
114,353 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getTotalNaturalAbundance | public static double getTotalNaturalAbundance(IAtomContainer atomContainer) {
try {
Isotopes isotopes = Isotopes.getInstance();
double abundance = 1.0;
double hAbundance = isotopes.getMajorIsotope(1).getNaturalAbundance();
int nImplH = 0;
for (IAtom ... | java | public static double getTotalNaturalAbundance(IAtomContainer atomContainer) {
try {
Isotopes isotopes = Isotopes.getInstance();
double abundance = 1.0;
double hAbundance = isotopes.getMajorIsotope(1).getNaturalAbundance();
int nImplH = 0;
for (IAtom ... | [
"public",
"static",
"double",
"getTotalNaturalAbundance",
"(",
"IAtomContainer",
"atomContainer",
")",
"{",
"try",
"{",
"Isotopes",
"isotopes",
"=",
"Isotopes",
".",
"getInstance",
"(",
")",
";",
"double",
"abundance",
"=",
"1.0",
";",
"double",
"hAbundance",
"=... | Get the summed natural abundance of all atoms in an AtomContainer
@param atomContainer The IAtomContainer to manipulate
@return The summed natural abundance of all atoms in this AtomContainer. | [
"Get",
"the",
"summed",
"natural",
"abundance",
"of",
"all",
"atoms",
"in",
"an",
"AtomContainer"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L459-L479 |
114,354 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getTotalFormalCharge | public static int getTotalFormalCharge(IAtomContainer atomContainer) {
int chargeP = getTotalNegativeFormalCharge(atomContainer);
int chargeN = getTotalPositiveFormalCharge(atomContainer);
return chargeP + chargeN;
} | java | public static int getTotalFormalCharge(IAtomContainer atomContainer) {
int chargeP = getTotalNegativeFormalCharge(atomContainer);
int chargeN = getTotalPositiveFormalCharge(atomContainer);
return chargeP + chargeN;
} | [
"public",
"static",
"int",
"getTotalFormalCharge",
"(",
"IAtomContainer",
"atomContainer",
")",
"{",
"int",
"chargeP",
"=",
"getTotalNegativeFormalCharge",
"(",
"atomContainer",
")",
";",
"int",
"chargeN",
"=",
"getTotalPositiveFormalCharge",
"(",
"atomContainer",
")",
... | Get the total formal charge on a molecule.
@param atomContainer the atom container to consider
@return The summed formal charges of all atoms in this AtomContainer. | [
"Get",
"the",
"total",
"formal",
"charge",
"on",
"a",
"molecule",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L487-L492 |
114,355 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getTotalNegativeFormalCharge | public static int getTotalNegativeFormalCharge(IAtomContainer atomContainer) {
int charge = 0;
for (int i = 0; i < atomContainer.getAtomCount(); i++) {
int chargeI = atomContainer.getAtom(i).getFormalCharge();
if (chargeI < 0) charge += chargeI;
}
return charge;
... | java | public static int getTotalNegativeFormalCharge(IAtomContainer atomContainer) {
int charge = 0;
for (int i = 0; i < atomContainer.getAtomCount(); i++) {
int chargeI = atomContainer.getAtom(i).getFormalCharge();
if (chargeI < 0) charge += chargeI;
}
return charge;
... | [
"public",
"static",
"int",
"getTotalNegativeFormalCharge",
"(",
"IAtomContainer",
"atomContainer",
")",
"{",
"int",
"charge",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"atomContainer",
".",
"getAtomCount",
"(",
")",
";",
"i",
"++",
... | Get the total formal negative charge on a molecule.
@param atomContainer the atom container to consider
@return The summed negative formal charges of all atoms in this AtomContainer. | [
"Get",
"the",
"total",
"formal",
"negative",
"charge",
"on",
"a",
"molecule",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L500-L507 |
114,356 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.countExplicitHydrogens | public static int countExplicitHydrogens(IAtomContainer atomContainer, IAtom atom) {
if (atomContainer == null || atom == null)
throw new IllegalArgumentException("null container or atom provided");
int hCount = 0;
for (IAtom connected : atomContainer.getConnectedAtomsList(atom)) {
... | java | public static int countExplicitHydrogens(IAtomContainer atomContainer, IAtom atom) {
if (atomContainer == null || atom == null)
throw new IllegalArgumentException("null container or atom provided");
int hCount = 0;
for (IAtom connected : atomContainer.getConnectedAtomsList(atom)) {
... | [
"public",
"static",
"int",
"countExplicitHydrogens",
"(",
"IAtomContainer",
"atomContainer",
",",
"IAtom",
"atom",
")",
"{",
"if",
"(",
"atomContainer",
"==",
"null",
"||",
"atom",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"null contain... | Count explicit hydrogens.
@param atomContainer the atom container to consider
@return The number of explicit hydrogens on the given IAtom.
@throws IllegalArgumentException if either the container or atom were null | [
"Count",
"explicit",
"hydrogens",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L587-L597 |
114,357 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.incrementImplHydrogenCount | private static void incrementImplHydrogenCount(final IAtom atom) {
Integer hCount = atom.getImplicitHydrogenCount();
if (hCount == null) {
if (!(atom instanceof IPseudoAtom))
throw new IllegalArgumentException("a non-pseudo atom had an unset hydrogen count");
hCo... | java | private static void incrementImplHydrogenCount(final IAtom atom) {
Integer hCount = atom.getImplicitHydrogenCount();
if (hCount == null) {
if (!(atom instanceof IPseudoAtom))
throw new IllegalArgumentException("a non-pseudo atom had an unset hydrogen count");
hCo... | [
"private",
"static",
"void",
"incrementImplHydrogenCount",
"(",
"final",
"IAtom",
"atom",
")",
"{",
"Integer",
"hCount",
"=",
"atom",
".",
"getImplicitHydrogenCount",
"(",
")",
";",
"if",
"(",
"hCount",
"==",
"null",
")",
"{",
"if",
"(",
"!",
"(",
"atom",
... | Increment the implicit hydrogen count of the provided atom. If the atom
was a non-pseudo atom and had an unset hydrogen count an exception is
thrown.
@param atom an atom to increment the hydrogen count of | [
"Increment",
"the",
"implicit",
"hydrogen",
"count",
"of",
"the",
"provided",
"atom",
".",
"If",
"the",
"atom",
"was",
"a",
"non",
"-",
"pseudo",
"atom",
"and",
"had",
"an",
"unset",
"hydrogen",
"count",
"an",
"exception",
"is",
"thrown",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1196-L1206 |
114,358 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.findSingleBond | private static IAtom findSingleBond(IAtomContainer container, IAtom atom, IAtom exclude) {
for (IBond bond : container.getConnectedBondsList(atom)) {
if (bond.getOrder() != Order.SINGLE)
continue;
IAtom neighbor = bond.getOther(atom);
if (!neighbor.equals(excl... | java | private static IAtom findSingleBond(IAtomContainer container, IAtom atom, IAtom exclude) {
for (IBond bond : container.getConnectedBondsList(atom)) {
if (bond.getOrder() != Order.SINGLE)
continue;
IAtom neighbor = bond.getOther(atom);
if (!neighbor.equals(excl... | [
"private",
"static",
"IAtom",
"findSingleBond",
"(",
"IAtomContainer",
"container",
",",
"IAtom",
"atom",
",",
"IAtom",
"exclude",
")",
"{",
"for",
"(",
"IBond",
"bond",
":",
"container",
".",
"getConnectedBondsList",
"(",
"atom",
")",
")",
"{",
"if",
"(",
... | Finds an neighbor connected to 'atom' which is connected by a
single bond and is not 'exclude'.
@param container structure
@param atom atom to find a neighbor of
@param exclude the neighbor should not be this atom
@return a neighbor of 'atom', null if not found | [
"Finds",
"an",
"neighbor",
"connected",
"to",
"atom",
"which",
"is",
"connected",
"by",
"a",
"single",
"bond",
"and",
"is",
"not",
"exclude",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1253-L1262 |
114,359 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.unregisterAtomListeners | public static void unregisterAtomListeners(IAtomContainer container) {
for (IAtom atom : container.atoms())
atom.removeListener(container);
} | java | public static void unregisterAtomListeners(IAtomContainer container) {
for (IAtom atom : container.atoms())
atom.removeListener(container);
} | [
"public",
"static",
"void",
"unregisterAtomListeners",
"(",
"IAtomContainer",
"container",
")",
"{",
"for",
"(",
"IAtom",
"atom",
":",
"container",
".",
"atoms",
"(",
")",
")",
"atom",
".",
"removeListener",
"(",
"container",
")",
";",
"}"
] | A method to remove AtomListeners.
AtomListeners are used to detect changes
in Atom objects within this AtomContainer and to notifiy
registered Listeners in the event of a change.
If an object looses interest in such changes, it should
unregister with this AtomContainer in order to improve
performance of this class. | [
"A",
"method",
"to",
"remove",
"AtomListeners",
".",
"AtomListeners",
"are",
"used",
"to",
"detect",
"changes",
"in",
"Atom",
"objects",
"within",
"this",
"AtomContainer",
"and",
"to",
"notifiy",
"registered",
"Listeners",
"in",
"the",
"event",
"of",
"a",
"cha... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1392-L1395 |
114,360 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getAtomArray | public static IAtom[] getAtomArray(IAtomContainer container) {
IAtom[] ret = new IAtom[container.getAtomCount()];
for (int i = 0; i < ret.length; ++i)
ret[i] = container.getAtom(i);
return ret;
} | java | public static IAtom[] getAtomArray(IAtomContainer container) {
IAtom[] ret = new IAtom[container.getAtomCount()];
for (int i = 0; i < ret.length; ++i)
ret[i] = container.getAtom(i);
return ret;
} | [
"public",
"static",
"IAtom",
"[",
"]",
"getAtomArray",
"(",
"IAtomContainer",
"container",
")",
"{",
"IAtom",
"[",
"]",
"ret",
"=",
"new",
"IAtom",
"[",
"container",
".",
"getAtomCount",
"(",
")",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",... | Constructs an array of Atom objects from an AtomContainer.
@param container The original AtomContainer.
@return The array of Atom objects. | [
"Constructs",
"an",
"array",
"of",
"Atom",
"objects",
"from",
"an",
"AtomContainer",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1429-L1434 |
114,361 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.clearAtomConfigurations | public static void clearAtomConfigurations(IAtomContainer container) {
for (IAtom atom : container.atoms()) {
atom.setAtomTypeName((String) CDKConstants.UNSET);
atom.setMaxBondOrder((IBond.Order) CDKConstants.UNSET);
atom.setBondOrderSum((Double) CDKConstants.UNSET);
... | java | public static void clearAtomConfigurations(IAtomContainer container) {
for (IAtom atom : container.atoms()) {
atom.setAtomTypeName((String) CDKConstants.UNSET);
atom.setMaxBondOrder((IBond.Order) CDKConstants.UNSET);
atom.setBondOrderSum((Double) CDKConstants.UNSET);
... | [
"public",
"static",
"void",
"clearAtomConfigurations",
"(",
"IAtomContainer",
"container",
")",
"{",
"for",
"(",
"IAtom",
"atom",
":",
"container",
".",
"atoms",
"(",
")",
")",
"{",
"atom",
".",
"setAtomTypeName",
"(",
"(",
"String",
")",
"CDKConstants",
"."... | This method will reset all atom configuration to UNSET.
This method is the reverse of {@link #percieveAtomTypesAndConfigureAtoms(org.openscience.cdk.interfaces.IAtomContainer)}
and after a call to this method all atoms will be "unconfigured".
Note that it is not a complete reversal of {@link #percieveAtomTypesAndConf... | [
"This",
"method",
"will",
"reset",
"all",
"atom",
"configuration",
"to",
"UNSET",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1547-L1564 |
114,362 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.createAllCarbonAllSingleNonAromaticBondAtomContainer | public static IAtomContainer createAllCarbonAllSingleNonAromaticBondAtomContainer(IAtomContainer atomContainer)
throws CloneNotSupportedException {
IAtomContainer query = (IAtomContainer) atomContainer.clone();
for (int i = 0; i < query.getBondCount(); i++) {
query.getBond(i).set... | java | public static IAtomContainer createAllCarbonAllSingleNonAromaticBondAtomContainer(IAtomContainer atomContainer)
throws CloneNotSupportedException {
IAtomContainer query = (IAtomContainer) atomContainer.clone();
for (int i = 0; i < query.getBondCount(); i++) {
query.getBond(i).set... | [
"public",
"static",
"IAtomContainer",
"createAllCarbonAllSingleNonAromaticBondAtomContainer",
"(",
"IAtomContainer",
"atomContainer",
")",
"throws",
"CloneNotSupportedException",
"{",
"IAtomContainer",
"query",
"=",
"(",
"IAtomContainer",
")",
"atomContainer",
".",
"clone",
"... | Generates a cloned atomcontainer with all atoms being carbon, all bonds
being single non-aromatic
@param atomContainer The input atomcontainer
@return The new atomcontainer
@throws CloneNotSupportedException The atomcontainer cannot be cloned
@deprecated not all attributes are removed producing unexpected results, use... | [
"Generates",
"a",
"cloned",
"atomcontainer",
"with",
"all",
"atoms",
"being",
"carbon",
"all",
"bonds",
"being",
"single",
"non",
"-",
"aromatic"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1611-L1626 |
114,363 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.anonymise | public static IAtomContainer anonymise(IAtomContainer src) {
IChemObjectBuilder builder = src.getBuilder();
IAtom[] atoms = new IAtom[src.getAtomCount()];
IBond[] bonds = new IBond[src.getBondCount()];
for (int i = 0; i < atoms.length; i++) {
atoms[i] = builder.newAtom();
... | java | public static IAtomContainer anonymise(IAtomContainer src) {
IChemObjectBuilder builder = src.getBuilder();
IAtom[] atoms = new IAtom[src.getAtomCount()];
IBond[] bonds = new IBond[src.getBondCount()];
for (int i = 0; i < atoms.length; i++) {
atoms[i] = builder.newAtom();
... | [
"public",
"static",
"IAtomContainer",
"anonymise",
"(",
"IAtomContainer",
"src",
")",
"{",
"IChemObjectBuilder",
"builder",
"=",
"src",
".",
"getBuilder",
"(",
")",
";",
"IAtom",
"[",
"]",
"atoms",
"=",
"new",
"IAtom",
"[",
"src",
".",
"getAtomCount",
"(",
... | Anonymise the provided container to single-bonded carbon atoms. No
information other then the connectivity from the original container is
retrained.
@param src an atom container
@return anonymised container | [
"Anonymise",
"the",
"provided",
"container",
"to",
"single",
"-",
"bonded",
"carbon",
"atoms",
".",
"No",
"information",
"other",
"then",
"the",
"connectivity",
"from",
"the",
"original",
"container",
"is",
"retrained",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1636-L1665 |
114,364 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java | AtomContainerManipulator.getBondOrderSum | public static double getBondOrderSum(IAtomContainer container, IAtom atom) {
double count = 0;
for (IBond bond : container.getConnectedBondsList(atom)) {
IBond.Order order = bond.getOrder();
if (order != null) {
count += order.numeric();
}
}
... | java | public static double getBondOrderSum(IAtomContainer container, IAtom atom) {
double count = 0;
for (IBond bond : container.getConnectedBondsList(atom)) {
IBond.Order order = bond.getOrder();
if (order != null) {
count += order.numeric();
}
}
... | [
"public",
"static",
"double",
"getBondOrderSum",
"(",
"IAtomContainer",
"container",
",",
"IAtom",
"atom",
")",
"{",
"double",
"count",
"=",
"0",
";",
"for",
"(",
"IBond",
"bond",
":",
"container",
".",
"getConnectedBondsList",
"(",
"atom",
")",
")",
"{",
... | Returns the sum of the bond order equivalents for a given IAtom. It
considers single bonds as 1.0, double bonds as 2.0, triple bonds as 3.0,
and quadruple bonds as 4.0.
@param atom The atom for which to calculate the bond order sum
@return The number of bond order equivalents for this atom | [
"Returns",
"the",
"sum",
"of",
"the",
"bond",
"order",
"equivalents",
"for",
"a",
"given",
"IAtom",
".",
"It",
"considers",
"single",
"bonds",
"as",
"1",
".",
"0",
"double",
"bonds",
"as",
"2",
".",
"0",
"triple",
"bonds",
"as",
"3",
".",
"0",
"and",... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/AtomContainerManipulator.java#L1708-L1717 |
114,365 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java | EssentialCycles.paths | public int[][] paths() {
final int[][] paths = new int[size()][];
for (int i = 0; i < paths.length; i++)
paths[i] = essential.get(i).path();
return paths;
} | java | public int[][] paths() {
final int[][] paths = new int[size()][];
for (int i = 0; i < paths.length; i++)
paths[i] = essential.get(i).path();
return paths;
} | [
"public",
"int",
"[",
"]",
"[",
"]",
"paths",
"(",
")",
"{",
"final",
"int",
"[",
"]",
"[",
"]",
"paths",
"=",
"new",
"int",
"[",
"size",
"(",
")",
"]",
"[",
"",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"paths",
".",
"... | The paths for each essential cycle.
@return array of vertex paths | [
"The",
"paths",
"for",
"each",
"essential",
"cycle",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java#L116-L121 |
114,366 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java | EssentialCycles.groupByLength | private List<List<Cycle>> groupByLength(final RelevantCycles relevant) {
LinkedList<List<Cycle>> cyclesByLength = new LinkedList<List<Cycle>>();
for (int[] path : relevant.paths()) {
if (cyclesByLength.isEmpty() || path.length > cyclesByLength.getLast().get(0).path().length) {
... | java | private List<List<Cycle>> groupByLength(final RelevantCycles relevant) {
LinkedList<List<Cycle>> cyclesByLength = new LinkedList<List<Cycle>>();
for (int[] path : relevant.paths()) {
if (cyclesByLength.isEmpty() || path.length > cyclesByLength.getLast().get(0).path().length) {
... | [
"private",
"List",
"<",
"List",
"<",
"Cycle",
">",
">",
"groupByLength",
"(",
"final",
"RelevantCycles",
"relevant",
")",
"{",
"LinkedList",
"<",
"List",
"<",
"Cycle",
">>",
"cyclesByLength",
"=",
"new",
"LinkedList",
"<",
"List",
"<",
"Cycle",
">",
">",
... | Reconstruct all relevant cycles and group then by length.
@param relevant precomputed relevant cycles
@return all relevant cycles groped by weight | [
"Reconstruct",
"all",
"relevant",
"cycles",
"and",
"group",
"then",
"by",
"length",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java#L138-L147 |
114,367 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java | EssentialCycles.membersOfBasis | private List<Cycle> membersOfBasis(final List<Cycle> cycles) {
int start = basis.size();
for (final Cycle c : cycles) {
if (basis.isIndependent(c)) basis.add(c);
}
return basis.members().subList(start, basis.size());
} | java | private List<Cycle> membersOfBasis(final List<Cycle> cycles) {
int start = basis.size();
for (final Cycle c : cycles) {
if (basis.isIndependent(c)) basis.add(c);
}
return basis.members().subList(start, basis.size());
} | [
"private",
"List",
"<",
"Cycle",
">",
"membersOfBasis",
"(",
"final",
"List",
"<",
"Cycle",
">",
"cycles",
")",
"{",
"int",
"start",
"=",
"basis",
".",
"size",
"(",
")",
";",
"for",
"(",
"final",
"Cycle",
"c",
":",
"cycles",
")",
"{",
"if",
"(",
... | For a list of equal length cycles return those which are members of the
minimum cycle basis.
@param cycles cycles to add to the basis
@return cycles which were added to the basis | [
"For",
"a",
"list",
"of",
"equal",
"length",
"cycles",
"return",
"those",
"which",
"are",
"members",
"of",
"the",
"minimum",
"cycle",
"basis",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/EssentialCycles.java#L156-L162 |
114,368 | cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/QueryBond.java | QueryBond.compare | @Override
public boolean compare(Object object) {
if (object instanceof IQueryBond) {
QueryBond queryBond = (QueryBond) object;
for (IAtom atom : atoms) {
if (!queryBond.contains(atom)) {
return false;
}
}
re... | java | @Override
public boolean compare(Object object) {
if (object instanceof IQueryBond) {
QueryBond queryBond = (QueryBond) object;
for (IAtom atom : atoms) {
if (!queryBond.contains(atom)) {
return false;
}
}
re... | [
"@",
"Override",
"public",
"boolean",
"compare",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"object",
"instanceof",
"IQueryBond",
")",
"{",
"QueryBond",
"queryBond",
"=",
"(",
"QueryBond",
")",
"object",
";",
"for",
"(",
"IAtom",
"atom",
":",
"atoms",
... | Compares a query bond with this query bond.
@param object Object of type Bond
@return true if the query bond is equal to this query bond | [
"Compares",
"a",
"query",
"bond",
"with",
"this",
"query",
"bond",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/QueryBond.java#L462-L474 |
114,369 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/group/DisjointSetForest.java | DisjointSetForest.makeUnion | public void makeUnion(int elementX, int elementY) {
int xRoot = getRoot(elementX);
int yRoot = getRoot(elementY);
if (xRoot == yRoot) {
return;
}
if (forest[xRoot] < forest[yRoot]) {
forest[yRoot] = forest[yRoot] + forest[xRoot];
forest[xRoot... | java | public void makeUnion(int elementX, int elementY) {
int xRoot = getRoot(elementX);
int yRoot = getRoot(elementY);
if (xRoot == yRoot) {
return;
}
if (forest[xRoot] < forest[yRoot]) {
forest[yRoot] = forest[yRoot] + forest[xRoot];
forest[xRoot... | [
"public",
"void",
"makeUnion",
"(",
"int",
"elementX",
",",
"int",
"elementY",
")",
"{",
"int",
"xRoot",
"=",
"getRoot",
"(",
"elementX",
")",
";",
"int",
"yRoot",
"=",
"getRoot",
"(",
"elementY",
")",
";",
"if",
"(",
"xRoot",
"==",
"yRoot",
")",
"{"... | Union these two elements - in other words, put them in the same set.
@param elementX an element
@param elementY an element | [
"Union",
"these",
"two",
"elements",
"-",
"in",
"other",
"words",
"put",
"them",
"in",
"the",
"same",
"set",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/group/DisjointSetForest.java#L90-L105 |
114,370 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/group/DisjointSetForest.java | DisjointSetForest.getSets | public int[][] getSets() {
int n = 0;
for (int i = 0; i < forest.length; i++) {
if (forest[i] < 0) {
n++;
}
}
int[][] sets = new int[n][];
int currentSet = 0;
for (int i = 0; i < forest.length; i++) {
if (forest[i] < 0) ... | java | public int[][] getSets() {
int n = 0;
for (int i = 0; i < forest.length; i++) {
if (forest[i] < 0) {
n++;
}
}
int[][] sets = new int[n][];
int currentSet = 0;
for (int i = 0; i < forest.length; i++) {
if (forest[i] < 0) ... | [
"public",
"int",
"[",
"]",
"[",
"]",
"getSets",
"(",
")",
"{",
"int",
"n",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"forest",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"forest",
"[",
"i",
"]",
"<",
"0",
... | Retrieve the sets as 2D-array of ints.
@return the sets | [
"Retrieve",
"the",
"sets",
"as",
"2D",
"-",
"array",
"of",
"ints",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/group/DisjointSetForest.java#L112-L136 |
114,371 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java | BioPolymer.addAtom | @Override
public void addAtom(IAtom oAtom, IStrand oStrand) {
int atomCount = super.getAtomCount();
// Add atom to AtomContainer
super.addAtom(oAtom);
if (atomCount != super.getAtomCount() && oStrand != null) { // Maybe better to throw null pointer exception here, so user realises... | java | @Override
public void addAtom(IAtom oAtom, IStrand oStrand) {
int atomCount = super.getAtomCount();
// Add atom to AtomContainer
super.addAtom(oAtom);
if (atomCount != super.getAtomCount() && oStrand != null) { // Maybe better to throw null pointer exception here, so user realises... | [
"@",
"Override",
"public",
"void",
"addAtom",
"(",
"IAtom",
"oAtom",
",",
"IStrand",
"oStrand",
")",
"{",
"int",
"atomCount",
"=",
"super",
".",
"getAtomCount",
"(",
")",
";",
"// Add atom to AtomContainer",
"super",
".",
"addAtom",
"(",
"oAtom",
")",
";",
... | Adds the atom oAtom to a specified Strand, whereas the Monomer is unspecified. Hence
the atom will be added to a Monomer of type UNKNOWN in the specified Strand.
@param oAtom The atom to add
@param oStrand The strand the atom belongs to | [
"Adds",
"the",
"atom",
"oAtom",
"to",
"a",
"specified",
"Strand",
"whereas",
"the",
"Monomer",
"is",
"unspecified",
".",
"Hence",
"the",
"atom",
"will",
"be",
"added",
"to",
"a",
"Monomer",
"of",
"type",
"UNKNOWN",
"in",
"the",
"specified",
"Strand",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java#L78-L96 |
114,372 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java | BioPolymer.getMonomerCount | @Override
public int getMonomerCount() {
Iterator<String> keys = strands.keySet().iterator();
int number = 0;
if (!keys.hasNext()) // no strands
return super.getMonomerCount();
while (keys.hasNext()) {
Strand tmp = (Strand) strands.get(keys.next()); // Cast ... | java | @Override
public int getMonomerCount() {
Iterator<String> keys = strands.keySet().iterator();
int number = 0;
if (!keys.hasNext()) // no strands
return super.getMonomerCount();
while (keys.hasNext()) {
Strand tmp = (Strand) strands.get(keys.next()); // Cast ... | [
"@",
"Override",
"public",
"int",
"getMonomerCount",
"(",
")",
"{",
"Iterator",
"<",
"String",
">",
"keys",
"=",
"strands",
".",
"keySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"int",
"number",
"=",
"0",
";",
"if",
"(",
"!",
"keys",
".",
"hasNe... | Returns the number of monomers present in BioPolymer.
@return number of monomers | [
"Returns",
"the",
"number",
"of",
"monomers",
"present",
"in",
"BioPolymer",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java#L139-L152 |
114,373 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java | BioPolymer.removeStrand | @Override
public void removeStrand(String name) {
if (strands.containsKey(name)) {
Strand strand = (Strand) strands.get(name);
this.remove(strand);
strands.remove(name);
}
} | java | @Override
public void removeStrand(String name) {
if (strands.containsKey(name)) {
Strand strand = (Strand) strands.get(name);
this.remove(strand);
strands.remove(name);
}
} | [
"@",
"Override",
"public",
"void",
"removeStrand",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"strands",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"Strand",
"strand",
"=",
"(",
"Strand",
")",
"strands",
".",
"get",
"(",
"name",
")",
";",
"this... | Removes a particular strand, specified by its name.
@param name name of the strand to remove | [
"Removes",
"a",
"particular",
"strand",
"specified",
"by",
"its",
"name",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java#L246-L253 |
114,374 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.embedText | public static IRenderingElement embedText(Font font, String text, Color color, double scale) {
final String[] lines = text.split("\n");
ElementGroup group = new ElementGroup();
double yOffset = 0;
double lineHeight = 1.4d;
for (String line : lines) {
TextOutline o... | java | public static IRenderingElement embedText(Font font, String text, Color color, double scale) {
final String[] lines = text.split("\n");
ElementGroup group = new ElementGroup();
double yOffset = 0;
double lineHeight = 1.4d;
for (String line : lines) {
TextOutline o... | [
"public",
"static",
"IRenderingElement",
"embedText",
"(",
"Font",
"font",
",",
"String",
"text",
",",
"Color",
"color",
",",
"double",
"scale",
")",
"{",
"final",
"String",
"[",
"]",
"lines",
"=",
"text",
".",
"split",
"(",
"\"\\n\"",
")",
";",
"Element... | Make an embedded text label for display in a CDK renderer. If a piece of text contains newlines
they are centred aligned below each other with a line height of 1.4.
@param font the font to embedded
@param text the text label
@param color the color
@param scale the resize, should include the model scale
@return pre-r... | [
"Make",
"an",
"embedded",
"text",
"label",
"for",
"display",
"in",
"a",
"CDK",
"renderer",
".",
"If",
"a",
"piece",
"of",
"text",
"contains",
"newlines",
"they",
"are",
"centred",
"aligned",
"below",
"each",
"other",
"with",
"a",
"line",
"height",
"of",
... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L573-L596 |
114,375 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.getColorProperty | static Color getColorProperty(IChemObject object, String key) {
Object value = object.getProperty(key);
if (value instanceof Color) return (Color) value;
if (value != null) throw new IllegalArgumentException(key + " property should be a java.awt.Color");
return null;
} | java | static Color getColorProperty(IChemObject object, String key) {
Object value = object.getProperty(key);
if (value instanceof Color) return (Color) value;
if (value != null) throw new IllegalArgumentException(key + " property should be a java.awt.Color");
return null;
} | [
"static",
"Color",
"getColorProperty",
"(",
"IChemObject",
"object",
",",
"String",
"key",
")",
"{",
"Object",
"value",
"=",
"object",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"value",
"instanceof",
"Color",
")",
"return",
"(",
"Color",
")",
... | Safely access a chem object color property for a chem object.
@param object chem object
@return the highlight color
@throws java.lang.IllegalArgumentException the highlight property was set but was not a
{@link Color} instance | [
"Safely",
"access",
"a",
"chem",
"object",
"color",
"property",
"for",
"a",
"chem",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L635-L640 |
114,376 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.recolor | private static IRenderingElement recolor(IRenderingElement element, Color color) {
if (element instanceof ElementGroup) {
ElementGroup orgGroup = (ElementGroup) element;
ElementGroup newGroup = new ElementGroup();
for (IRenderingElement child : orgGroup) {
new... | java | private static IRenderingElement recolor(IRenderingElement element, Color color) {
if (element instanceof ElementGroup) {
ElementGroup orgGroup = (ElementGroup) element;
ElementGroup newGroup = new ElementGroup();
for (IRenderingElement child : orgGroup) {
new... | [
"private",
"static",
"IRenderingElement",
"recolor",
"(",
"IRenderingElement",
"element",
",",
"Color",
"color",
")",
"{",
"if",
"(",
"element",
"instanceof",
"ElementGroup",
")",
"{",
"ElementGroup",
"orgGroup",
"=",
"(",
"ElementGroup",
")",
"element",
";",
"E... | Recolor a rendering element after it has been generated. Since rendering elements are
immutable, the input element remains unmodified.
@param element the rendering element
@param color the new color
@return recolored rendering element | [
"Recolor",
"a",
"rendering",
"element",
"after",
"it",
"has",
"been",
"generated",
".",
"Since",
"rendering",
"elements",
"are",
"immutable",
"the",
"input",
"element",
"remains",
"unmodified",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L650-L666 |
114,377 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.outerGlow | static IRenderingElement outerGlow(IRenderingElement element, Color color, double glowWidth, double stroke) {
if (element instanceof ElementGroup) {
ElementGroup orgGroup = (ElementGroup) element;
ElementGroup newGroup = new ElementGroup();
for (IRenderingElement child : orgG... | java | static IRenderingElement outerGlow(IRenderingElement element, Color color, double glowWidth, double stroke) {
if (element instanceof ElementGroup) {
ElementGroup orgGroup = (ElementGroup) element;
ElementGroup newGroup = new ElementGroup();
for (IRenderingElement child : orgG... | [
"static",
"IRenderingElement",
"outerGlow",
"(",
"IRenderingElement",
"element",
",",
"Color",
"color",
",",
"double",
"glowWidth",
",",
"double",
"stroke",
")",
"{",
"if",
"(",
"element",
"instanceof",
"ElementGroup",
")",
"{",
"ElementGroup",
"orgGroup",
"=",
... | Generate an outer glow for the provided rendering element. The glow is defined by the glow
width and the stroke size.
@param element rendering element
@param color color of the glow
@param glowWidth the width of the glow
@param stroke the stroke width
@return generated outer glow | [
"Generate",
"an",
"outer",
"glow",
"for",
"the",
"provided",
"rendering",
"element",
".",
"The",
"glow",
"is",
"defined",
"by",
"the",
"glow",
"width",
"and",
"the",
"stroke",
"size",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L678-L699 |
114,378 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.isPlainBond | static boolean isPlainBond(IBond bond) {
return bond.getOrder() == IBond.Order.SINGLE
&& (bond.getStereo() == IBond.Stereo.NONE || bond.getStereo() == null);
} | java | static boolean isPlainBond(IBond bond) {
return bond.getOrder() == IBond.Order.SINGLE
&& (bond.getStereo() == IBond.Stereo.NONE || bond.getStereo() == null);
} | [
"static",
"boolean",
"isPlainBond",
"(",
"IBond",
"bond",
")",
"{",
"return",
"bond",
".",
"getOrder",
"(",
")",
"==",
"IBond",
".",
"Order",
".",
"SINGLE",
"&&",
"(",
"bond",
".",
"getStereo",
"(",
")",
"==",
"IBond",
".",
"Stereo",
".",
"NONE",
"||... | A plain bond is a non-stereo sigma bond that is displayed simply as a line.
@param bond a non-null bond
@return the bond is plain | [
"A",
"plain",
"bond",
"is",
"a",
"non",
"-",
"stereo",
"sigma",
"bond",
"that",
"is",
"displayed",
"simply",
"as",
"a",
"line",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L813-L816 |
114,379 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.isWedged | static boolean isWedged(IBond bond) {
return (bond.getStereo() == IBond.Stereo.UP || bond.getStereo() == IBond.Stereo.DOWN
|| bond.getStereo() == IBond.Stereo.UP_INVERTED || bond.getStereo() == IBond.Stereo.DOWN_INVERTED);
} | java | static boolean isWedged(IBond bond) {
return (bond.getStereo() == IBond.Stereo.UP || bond.getStereo() == IBond.Stereo.DOWN
|| bond.getStereo() == IBond.Stereo.UP_INVERTED || bond.getStereo() == IBond.Stereo.DOWN_INVERTED);
} | [
"static",
"boolean",
"isWedged",
"(",
"IBond",
"bond",
")",
"{",
"return",
"(",
"bond",
".",
"getStereo",
"(",
")",
"==",
"IBond",
".",
"Stereo",
".",
"UP",
"||",
"bond",
".",
"getStereo",
"(",
")",
"==",
"IBond",
".",
"Stereo",
".",
"DOWN",
"||",
... | A bond is wedge if it points up or down.
@param bond a non-null bond
@return the bond is wedge (bold or hashed) | [
"A",
"bond",
"is",
"wedge",
"if",
"it",
"points",
"up",
"or",
"down",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L824-L827 |
114,380 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java | StandardGenerator.unhide | static void unhide(IChemObject chemobj) {
chemobj.setProperty(HIDDEN, false);
chemobj.setProperty(HIDDEN_FULLY, false);
} | java | static void unhide(IChemObject chemobj) {
chemobj.setProperty(HIDDEN, false);
chemobj.setProperty(HIDDEN_FULLY, false);
} | [
"static",
"void",
"unhide",
"(",
"IChemObject",
"chemobj",
")",
"{",
"chemobj",
".",
"setProperty",
"(",
"HIDDEN",
",",
"false",
")",
";",
"chemobj",
".",
"setProperty",
"(",
"HIDDEN_FULLY",
",",
"false",
")",
";",
"}"
] | Unhide the specified chemobj.
@param chemobj a chem obj (atom or bond) to unhide | [
"Unhide",
"the",
"specified",
"chemobj",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/StandardGenerator.java#L869-L872 |
114,381 | cdk/cdk | descriptor/fingerprint/src/main/java/org/openscience/cdk/similarity/Tanimoto.java | Tanimoto.method1 | public static double method1(ICountFingerprint fp1, ICountFingerprint fp2) {
long xy = 0, x = 0, y = 0;
for (int i = 0; i < fp1.numOfPopulatedbins(); i++) {
int hash = fp1.getHash(i);
for (int j = 0; j < fp2.numOfPopulatedbins(); j++) {
if (hash == fp2.getHash(j))... | java | public static double method1(ICountFingerprint fp1, ICountFingerprint fp2) {
long xy = 0, x = 0, y = 0;
for (int i = 0; i < fp1.numOfPopulatedbins(); i++) {
int hash = fp1.getHash(i);
for (int j = 0; j < fp2.numOfPopulatedbins(); j++) {
if (hash == fp2.getHash(j))... | [
"public",
"static",
"double",
"method1",
"(",
"ICountFingerprint",
"fp1",
",",
"ICountFingerprint",
"fp2",
")",
"{",
"long",
"xy",
"=",
"0",
",",
"x",
"=",
"0",
",",
"y",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fp1",
".",... | Calculates Tanimoto distance for two count fingerprints using method 1.
The feature/count type fingerprints may be of different length.
Uses Tanimoto method from {@cdk.cite Steffen09}.
@param fp1 count fingerprint 1
@param fp2 count fingerprint 2
@return a Tanimoto distance | [
"Calculates",
"Tanimoto",
"distance",
"for",
"two",
"count",
"fingerprints",
"using",
"method",
"1",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/fingerprint/src/main/java/org/openscience/cdk/similarity/Tanimoto.java#L195-L210 |
114,382 | cdk/cdk | descriptor/fingerprint/src/main/java/org/openscience/cdk/similarity/LingoSimilarity.java | LingoSimilarity.calculate | public static float calculate(Map<String, Integer> features1, Map<String, Integer> features2) {
TreeSet<String> keys = new TreeSet<String>(features1.keySet());
keys.addAll(features2.keySet());
float sum = 0.0f;
for (String key : keys) {
Integer c1 = features1.get(key);
... | java | public static float calculate(Map<String, Integer> features1, Map<String, Integer> features2) {
TreeSet<String> keys = new TreeSet<String>(features1.keySet());
keys.addAll(features2.keySet());
float sum = 0.0f;
for (String key : keys) {
Integer c1 = features1.get(key);
... | [
"public",
"static",
"float",
"calculate",
"(",
"Map",
"<",
"String",
",",
"Integer",
">",
"features1",
",",
"Map",
"<",
"String",
",",
"Integer",
">",
"features2",
")",
"{",
"TreeSet",
"<",
"String",
">",
"keys",
"=",
"new",
"TreeSet",
"<",
"String",
"... | Evaluate the LINGO similarity between two key,value sty;e fingerprints.
The value will range from 0.0 to 1.0.
@param features1
@param features2
@return similarity | [
"Evaluate",
"the",
"LINGO",
"similarity",
"between",
"two",
"key",
"value",
"sty",
";",
"e",
"fingerprints",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/fingerprint/src/main/java/org/openscience/cdk/similarity/LingoSimilarity.java#L54-L69 |
114,383 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/rules/ToleranceRangeRule.java | ToleranceRangeRule.setParameters | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length > 2) throw new CDKException("ToleranceRangeRule expects only two parameter");
if (!(params[0] instanceof Double)) throw new CDKException("The parameter 0 must be of type Double");
if (!(params[1] i... | java | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length > 2) throw new CDKException("ToleranceRangeRule expects only two parameter");
if (!(params[0] instanceof Double)) throw new CDKException("The parameter 0 must be of type Double");
if (!(params[1] i... | [
"@",
"Override",
"public",
"void",
"setParameters",
"(",
"Object",
"[",
"]",
"params",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"params",
".",
"length",
">",
"2",
")",
"throw",
"new",
"CDKException",
"(",
"\"ToleranceRangeRule expects only two parameter\"",
... | Sets the parameters attribute of the ToleranceRangeRule object.
@param params The new parameters value
@throws CDKException Description of the Exception
@see #getParameters | [
"Sets",
"the",
"parameters",
"attribute",
"of",
"the",
"ToleranceRangeRule",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/rules/ToleranceRangeRule.java#L77-L87 |
114,384 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/rules/ToleranceRangeRule.java | ToleranceRangeRule.getParameters | @Override
public Object[] getParameters() {
// return the parameters as used for the rule validation
Object[] params = new Object[2];
params[0] = mass;
params[1] = tolerance;
return params;
} | java | @Override
public Object[] getParameters() {
// return the parameters as used for the rule validation
Object[] params = new Object[2];
params[0] = mass;
params[1] = tolerance;
return params;
} | [
"@",
"Override",
"public",
"Object",
"[",
"]",
"getParameters",
"(",
")",
"{",
"// return the parameters as used for the rule validation",
"Object",
"[",
"]",
"params",
"=",
"new",
"Object",
"[",
"2",
"]",
";",
"params",
"[",
"0",
"]",
"=",
"mass",
";",
"par... | Gets the parameters attribute of the ToleranceRangeRule object.
@return The parameters value
@see #setParameters | [
"Gets",
"the",
"parameters",
"attribute",
"of",
"the",
"ToleranceRangeRule",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/rules/ToleranceRangeRule.java#L95-L102 |
114,385 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/rules/ToleranceRangeRule.java | ToleranceRangeRule.validate | @Override
public double validate(IMolecularFormula formula) throws CDKException {
logger.info("Start validation of ", formula);
double totalExactMass = MolecularFormulaManipulator.getTotalExactMass(formula);
if (Math.abs(totalExactMass - mass) > tolerance)
return 0.0;
e... | java | @Override
public double validate(IMolecularFormula formula) throws CDKException {
logger.info("Start validation of ", formula);
double totalExactMass = MolecularFormulaManipulator.getTotalExactMass(formula);
if (Math.abs(totalExactMass - mass) > tolerance)
return 0.0;
e... | [
"@",
"Override",
"public",
"double",
"validate",
"(",
"IMolecularFormula",
"formula",
")",
"throws",
"CDKException",
"{",
"logger",
".",
"info",
"(",
"\"Start validation of \"",
",",
"formula",
")",
";",
"double",
"totalExactMass",
"=",
"MolecularFormulaManipulator",
... | Validate the Tolerance Range of this IMolecularFormula.
@param formula Parameter is the IMolecularFormula
@return A double value meaning 1.0 True, 0.0 False | [
"Validate",
"the",
"Tolerance",
"Range",
"of",
"this",
"IMolecularFormula",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/rules/ToleranceRangeRule.java#L111-L121 |
114,386 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java | RGraph.addNode | public void addNode(RNode newNode) {
graph.add(newNode);
graphBitSet.set(graph.size() - 1);
} | java | public void addNode(RNode newNode) {
graph.add(newNode);
graphBitSet.set(graph.size() - 1);
} | [
"public",
"void",
"addNode",
"(",
"RNode",
"newNode",
")",
"{",
"graph",
".",
"add",
"(",
"newNode",
")",
";",
"graphBitSet",
".",
"set",
"(",
"graph",
".",
"size",
"(",
")",
"-",
"1",
")",
";",
"}"
] | Adds a new node to the RGraph.
@param newNode The node to add to the graph | [
"Adds",
"a",
"new",
"node",
"to",
"the",
"RGraph",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java#L196-L199 |
114,387 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java | RGraph.parseRec | private void parseRec(BitSet traversed, BitSet extension, BitSet forbidden) {
BitSet newTraversed = null;
BitSet newExtension = null;
BitSet newForbidden = null;
BitSet potentialNode = null;
// Test whether the timeout is reached. Stop searching.
if (this.timeout > -1 &&... | java | private void parseRec(BitSet traversed, BitSet extension, BitSet forbidden) {
BitSet newTraversed = null;
BitSet newExtension = null;
BitSet newForbidden = null;
BitSet potentialNode = null;
// Test whether the timeout is reached. Stop searching.
if (this.timeout > -1 &&... | [
"private",
"void",
"parseRec",
"(",
"BitSet",
"traversed",
",",
"BitSet",
"extension",
",",
"BitSet",
"forbidden",
")",
"{",
"BitSet",
"newTraversed",
"=",
"null",
";",
"BitSet",
"newExtension",
"=",
"null",
";",
"BitSet",
"newForbidden",
"=",
"null",
";",
"... | Parsing of the RGraph. This is the recursive method
to perform a query. The method will recursively
parse the RGraph thru connected nodes and visiting the
RGraph using allowed adjacency relationship.
@param traversed node already parsed
@param extension possible extension node (allowed neighbors)
@param forbiden ... | [
"Parsing",
"of",
"the",
"RGraph",
".",
"This",
"is",
"the",
"recursive",
"method",
"to",
"perform",
"a",
"query",
".",
"The",
"method",
"will",
"recursively",
"parse",
"the",
"RGraph",
"thru",
"connected",
"nodes",
"and",
"visiting",
"the",
"RGraph",
"using"... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java#L241-L311 |
114,388 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java | RGraph.buildB | private BitSet buildB(BitSet c1, BitSet c2) {
this.c1 = c1;
this.c2 = c2;
BitSet bs = new BitSet();
// only nodes that fulfill the initial constrains
// are allowed in the initial extension set : B
for (Iterator<RNode> i = graph.iterator(); i.hasNext();) {
R... | java | private BitSet buildB(BitSet c1, BitSet c2) {
this.c1 = c1;
this.c2 = c2;
BitSet bs = new BitSet();
// only nodes that fulfill the initial constrains
// are allowed in the initial extension set : B
for (Iterator<RNode> i = graph.iterator(); i.hasNext();) {
R... | [
"private",
"BitSet",
"buildB",
"(",
"BitSet",
"c1",
",",
"BitSet",
"c2",
")",
"{",
"this",
".",
"c1",
"=",
"c1",
";",
"this",
".",
"c2",
"=",
"c2",
";",
"BitSet",
"bs",
"=",
"new",
"BitSet",
"(",
")",
";",
"// only nodes that fulfill the initial constrai... | Builds the initial extension set. This is the
set of node that may be used as seed for the
RGraph parsing. This set depends on the constrains
defined by the user.
@param c1 constraint in the graph G1
@param c2 constraint in the graph G2
@return the new extension set | [
"Builds",
"the",
"initial",
"extension",
"set",
".",
"This",
"is",
"the",
"set",
"of",
"node",
"that",
"may",
"be",
"used",
"as",
"seed",
"for",
"the",
"RGraph",
"parsing",
".",
"This",
"set",
"depends",
"on",
"the",
"constrains",
"defined",
"by",
"the",... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java#L420-L436 |
114,389 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java | RGraph.projectG1 | public BitSet projectG1(BitSet set) {
BitSet projection = new BitSet(firstGraphSize);
RNode xNode = null;
for (int x = set.nextSetBit(0); x >= 0; x = set.nextSetBit(x + 1)) {
xNode = (RNode) graph.get(x);
projection.set(xNode.rMap.id1);
}
return projectio... | java | public BitSet projectG1(BitSet set) {
BitSet projection = new BitSet(firstGraphSize);
RNode xNode = null;
for (int x = set.nextSetBit(0); x >= 0; x = set.nextSetBit(x + 1)) {
xNode = (RNode) graph.get(x);
projection.set(xNode.rMap.id1);
}
return projectio... | [
"public",
"BitSet",
"projectG1",
"(",
"BitSet",
"set",
")",
"{",
"BitSet",
"projection",
"=",
"new",
"BitSet",
"(",
"firstGraphSize",
")",
";",
"RNode",
"xNode",
"=",
"null",
";",
"for",
"(",
"int",
"x",
"=",
"set",
".",
"nextSetBit",
"(",
"0",
")",
... | Projects a RGraph bitset on the source graph G1.
@param set RGraph BitSet to project
@return The associate BitSet in G1 | [
"Projects",
"a",
"RGraph",
"bitset",
"on",
"the",
"source",
"graph",
"G1",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java#L526-L535 |
114,390 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java | RGraph.projectG2 | public BitSet projectG2(BitSet set) {
BitSet projection = new BitSet(secondGraphSize);
RNode xNode = null;
for (int x = set.nextSetBit(0); x >= 0; x = set.nextSetBit(x + 1)) {
xNode = (RNode) graph.get(x);
projection.set(xNode.rMap.id2);
}
return projecti... | java | public BitSet projectG2(BitSet set) {
BitSet projection = new BitSet(secondGraphSize);
RNode xNode = null;
for (int x = set.nextSetBit(0); x >= 0; x = set.nextSetBit(x + 1)) {
xNode = (RNode) graph.get(x);
projection.set(xNode.rMap.id2);
}
return projecti... | [
"public",
"BitSet",
"projectG2",
"(",
"BitSet",
"set",
")",
"{",
"BitSet",
"projection",
"=",
"new",
"BitSet",
"(",
"secondGraphSize",
")",
";",
"RNode",
"xNode",
"=",
"null",
";",
"for",
"(",
"int",
"x",
"=",
"set",
".",
"nextSetBit",
"(",
"0",
")",
... | Projects a RGraph bitset on the source graph G2.
@param set RGraph BitSet to project
@return The associate BitSet in G2 | [
"Projects",
"a",
"RGraph",
"bitset",
"on",
"the",
"source",
"graph",
"G2",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java#L542-L551 |
114,391 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java | RGraph.isContainedIn | private boolean isContainedIn(BitSet A, BitSet B) {
boolean result = false;
if (A.isEmpty()) {
return true;
}
BitSet setA = (BitSet) A.clone();
setA.and(B);
if (setA.equals(A)) {
result = true;
}
return result;
} | java | private boolean isContainedIn(BitSet A, BitSet B) {
boolean result = false;
if (A.isEmpty()) {
return true;
}
BitSet setA = (BitSet) A.clone();
setA.and(B);
if (setA.equals(A)) {
result = true;
}
return result;
} | [
"private",
"boolean",
"isContainedIn",
"(",
"BitSet",
"A",
",",
"BitSet",
"B",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"A",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"true",
";",
"}",
"BitSet",
"setA",
"=",
"(",
"BitSet",
"... | Test if set A is contained in set B.
@param A a bitSet
@param B a bitSet
@return true if A is contained in B | [
"Test",
"if",
"set",
"A",
"is",
"contained",
"in",
"set",
"B",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/isomorphism/mcss/RGraph.java#L559-L574 |
114,392 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/aromaticity/AtomTypeModel.java | AtomTypeModel.electronsForAtomType | private static int electronsForAtomType(IAtom atom) {
Integer electrons = TYPES.get(atom.getAtomTypeName());
if (electrons != null) return electrons;
try {
IAtomType atomType = AtomTypeFactory.getInstance("org/openscience/cdk/dict/data/cdk-atom-types.owl",
atom.... | java | private static int electronsForAtomType(IAtom atom) {
Integer electrons = TYPES.get(atom.getAtomTypeName());
if (electrons != null) return electrons;
try {
IAtomType atomType = AtomTypeFactory.getInstance("org/openscience/cdk/dict/data/cdk-atom-types.owl",
atom.... | [
"private",
"static",
"int",
"electronsForAtomType",
"(",
"IAtom",
"atom",
")",
"{",
"Integer",
"electrons",
"=",
"TYPES",
".",
"get",
"(",
"atom",
".",
"getAtomTypeName",
"(",
")",
")",
";",
"if",
"(",
"electrons",
"!=",
"null",
")",
"return",
"electrons",... | The number of contributed electrons for the atom type of the specified
atom type.
@param atom an atom to get the contribution of
@return the number of electrons | [
"The",
"number",
"of",
"contributed",
"electrons",
"for",
"the",
"atom",
"type",
"of",
"the",
"specified",
"atom",
"type",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/aromaticity/AtomTypeModel.java#L156-L169 |
114,393 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/fingerprint/FingerprinterTool.java | FingerprinterTool.makeBitFingerprint | public static IBitFingerprint makeBitFingerprint(final Map<String,Integer> features, int len) {
return makeBitFingerprint(features, len, 1);
} | java | public static IBitFingerprint makeBitFingerprint(final Map<String,Integer> features, int len) {
return makeBitFingerprint(features, len, 1);
} | [
"public",
"static",
"IBitFingerprint",
"makeBitFingerprint",
"(",
"final",
"Map",
"<",
"String",
",",
"Integer",
">",
"features",
",",
"int",
"len",
")",
"{",
"return",
"makeBitFingerprint",
"(",
"features",
",",
"len",
",",
"1",
")",
";",
"}"
] | Convert a mapping of features and their counts to a binary fingerprint. A single bit is
set for each pattern.
@param features features to include
@param len fingerprint length
@return the continuous fingerprint
@see #makeBitFingerprint(java.util.Map, int, int) | [
"Convert",
"a",
"mapping",
"of",
"features",
"and",
"their",
"counts",
"to",
"a",
"binary",
"fingerprint",
".",
"A",
"single",
"bit",
"is",
"set",
"for",
"each",
"pattern",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/fingerprint/FingerprinterTool.java#L144-L146 |
114,394 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/algorithm/vflib/map/VFState.java | VFState.matchAtoms | private boolean matchAtoms(Match match) {
IAtom atom = match.getTargetAtom();
if (match.getQueryNode().countNeighbors() > target.countNeighbors(atom)) {
return false;
}
return match.getQueryNode().getAtomMatcher().matches(target, atom);
} | java | private boolean matchAtoms(Match match) {
IAtom atom = match.getTargetAtom();
if (match.getQueryNode().countNeighbors() > target.countNeighbors(atom)) {
return false;
}
return match.getQueryNode().getAtomMatcher().matches(target, atom);
} | [
"private",
"boolean",
"matchAtoms",
"(",
"Match",
"match",
")",
"{",
"IAtom",
"atom",
"=",
"match",
".",
"getTargetAtom",
"(",
")",
";",
"if",
"(",
"match",
".",
"getQueryNode",
"(",
")",
".",
"countNeighbors",
"(",
")",
">",
"target",
".",
"countNeighbo... | This function is updated by Asad to include more matches | [
"This",
"function",
"is",
"updated",
"by",
"Asad",
"to",
"include",
"more",
"matches"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/algorithm/vflib/map/VFState.java#L219-L225 |
114,395 | cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/graph/matrix/TopologicalMatrix.java | TopologicalMatrix.getMatrix | public static int[][] getMatrix(IAtomContainer container) {
int[][] conMat = AdjacencyMatrix.getMatrix(container);
int[][] topolDistance = PathTools.computeFloydAPSP(conMat);
return topolDistance;
} | java | public static int[][] getMatrix(IAtomContainer container) {
int[][] conMat = AdjacencyMatrix.getMatrix(container);
int[][] topolDistance = PathTools.computeFloydAPSP(conMat);
return topolDistance;
} | [
"public",
"static",
"int",
"[",
"]",
"[",
"]",
"getMatrix",
"(",
"IAtomContainer",
"container",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"conMat",
"=",
"AdjacencyMatrix",
".",
"getMatrix",
"(",
"container",
")",
";",
"int",
"[",
"]",
"[",
"]",
"topolDistan... | Returns the topological matrix for the given AtomContainer.
@param container The AtomContainer for which the matrix is calculated
@return A topological matrix representating this AtomContainer | [
"Returns",
"the",
"topological",
"matrix",
"for",
"the",
"given",
"AtomContainer",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/graph/matrix/TopologicalMatrix.java#L24-L29 |
114,396 | cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/HydrogenPlacer.java | HydrogenPlacer.placeHydrogens2D | public void placeHydrogens2D(final IAtomContainer container, final double bondLength) {
logger.debug("placing hydrogens on all atoms");
for (IAtom atom : container.atoms()) {
// only place hydrogens for atoms which have coordinates
if (atom.getPoint2d() != null) {
... | java | public void placeHydrogens2D(final IAtomContainer container, final double bondLength) {
logger.debug("placing hydrogens on all atoms");
for (IAtom atom : container.atoms()) {
// only place hydrogens for atoms which have coordinates
if (atom.getPoint2d() != null) {
... | [
"public",
"void",
"placeHydrogens2D",
"(",
"final",
"IAtomContainer",
"container",
",",
"final",
"double",
"bondLength",
")",
"{",
"logger",
".",
"debug",
"(",
"\"placing hydrogens on all atoms\"",
")",
";",
"for",
"(",
"IAtom",
"atom",
":",
"container",
".",
"a... | Place all hydrogens connected to atoms which have already been laid out.
@param container atom container
@param bondLength bond length to user | [
"Place",
"all",
"hydrogens",
"connected",
"to",
"atoms",
"which",
"have",
"already",
"been",
"laid",
"out",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/HydrogenPlacer.java#L62-L71 |
114,397 | cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/HydrogenPlacer.java | HydrogenPlacer.placeHydrogens2D | public void placeHydrogens2D(IAtomContainer container, IAtom atom) {
double bondLength = GeometryUtil.getBondLengthAverage(container);
placeHydrogens2D(container, atom, bondLength);
} | java | public void placeHydrogens2D(IAtomContainer container, IAtom atom) {
double bondLength = GeometryUtil.getBondLengthAverage(container);
placeHydrogens2D(container, atom, bondLength);
} | [
"public",
"void",
"placeHydrogens2D",
"(",
"IAtomContainer",
"container",
",",
"IAtom",
"atom",
")",
"{",
"double",
"bondLength",
"=",
"GeometryUtil",
".",
"getBondLengthAverage",
"(",
"container",
")",
";",
"placeHydrogens2D",
"(",
"container",
",",
"atom",
",",
... | Place hydrogens connected to the given atom using the average bond length
in the container.
@param container atom container of which <i>atom</i> is a member
@param atom the atom of which to place connected hydrogens
@throws IllegalArgumentException if the <i>atom</i> does not have 2d
coordinates
@see #placeHydrog... | [
"Place",
"hydrogens",
"connected",
"to",
"the",
"given",
"atom",
"using",
"the",
"average",
"bond",
"length",
"in",
"the",
"container",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/HydrogenPlacer.java#L84-L87 |
114,398 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/SilentChemObjectBuilder.java | SilentChemObjectBuilder.getSystemProp | private static boolean getSystemProp(final String key, final boolean defaultValue) {
String val = System.getProperty(key);
if (val == null)
val = System.getenv(key);
if (val == null) {
return defaultValue;
} else if (val.isEmpty()) {
return true;
... | java | private static boolean getSystemProp(final String key, final boolean defaultValue) {
String val = System.getProperty(key);
if (val == null)
val = System.getenv(key);
if (val == null) {
return defaultValue;
} else if (val.isEmpty()) {
return true;
... | [
"private",
"static",
"boolean",
"getSystemProp",
"(",
"final",
"String",
"key",
",",
"final",
"boolean",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"System",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"val",
"==",
"null",
")",
"val",
"=",
... | an error rather than return false. The default can also be specified. | [
"an",
"error",
"rather",
"than",
"return",
"false",
".",
"The",
"default",
"can",
"also",
"be",
"specified",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/SilentChemObjectBuilder.java#L91-L113 |
114,399 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/tools/SwissArmyKnife.java | SwissArmyKnife.getDuration | public static String getDuration(long diff) {
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(new Date(diff));
StringBuffer s = new StringBuffer();
if (calendar.get(Calendar.HOUR) > 1) {
s.append("hours: " + (calendar.get(Calendar.HOUR) - 1) + ", ");
... | java | public static String getDuration(long diff) {
GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(new Date(diff));
StringBuffer s = new StringBuffer();
if (calendar.get(Calendar.HOUR) > 1) {
s.append("hours: " + (calendar.get(Calendar.HOUR) - 1) + ", ");
... | [
"public",
"static",
"String",
"getDuration",
"(",
"long",
"diff",
")",
"{",
"GregorianCalendar",
"calendar",
"=",
"new",
"GregorianCalendar",
"(",
")",
";",
"calendar",
".",
"setTime",
"(",
"new",
"Date",
"(",
"diff",
")",
")",
";",
"StringBuffer",
"s",
"=... | Returns a String reporting the time passed during a given number of milliseconds.
@param diff A time span in milliseconds
@return A human readable representation of a timespan given in milliseconds | [
"Returns",
"a",
"String",
"reporting",
"the",
"time",
"passed",
"during",
"a",
"given",
"number",
"of",
"milliseconds",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/tools/SwissArmyKnife.java#L58-L76 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.