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,200 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java | CDKAtomTypeMatcher.countAttachedBonds | private int countAttachedBonds(List<IBond> connectedBonds, IAtom atom, IBond.Order order, String symbol) {
// count the number of double bonded oxygens
int neighborcount = connectedBonds.size();
int doubleBondedAtoms = 0;
for (int i = neighborcount - 1; i >= 0; i--) {
IBond b... | java | private int countAttachedBonds(List<IBond> connectedBonds, IAtom atom, IBond.Order order, String symbol) {
// count the number of double bonded oxygens
int neighborcount = connectedBonds.size();
int doubleBondedAtoms = 0;
for (int i = neighborcount - 1; i >= 0; i--) {
IBond b... | [
"private",
"int",
"countAttachedBonds",
"(",
"List",
"<",
"IBond",
">",
"connectedBonds",
",",
"IAtom",
"atom",
",",
"IBond",
".",
"Order",
"order",
",",
"String",
"symbol",
")",
"{",
"// count the number of double bonded oxygens",
"int",
"neighborcount",
"=",
"co... | Count the number of doubly bonded atoms.
@param connectedBonds bonds connected to the atom
@param atom the atom being looked at
@param order the desired bond order of the attached bonds
@param symbol If not null, then it only counts the double bonded atoms which
match the given symbol.
@return the number of doubly bon... | [
"Count",
"the",
"number",
"of",
"doubly",
"bonded",
"atoms",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/atomtype/CDKAtomTypeMatcher.java#L2451-L2471 |
114,201 | cdk/cdk | storage/io/src/main/java/org/openscience/cdk/io/cml/CMLResolver.java | CMLResolver.resolveEntity | @Override
public InputSource resolveEntity(String publicId, String systemId) {
logger.debug("CMLResolver: resolving ", publicId, ", ", systemId);
systemId = systemId.toLowerCase();
if ((systemId.indexOf("cml-1999-05-15.dtd") != -1) || (systemId.indexOf("cml.dtd") != -1)
|| (s... | java | @Override
public InputSource resolveEntity(String publicId, String systemId) {
logger.debug("CMLResolver: resolving ", publicId, ", ", systemId);
systemId = systemId.toLowerCase();
if ((systemId.indexOf("cml-1999-05-15.dtd") != -1) || (systemId.indexOf("cml.dtd") != -1)
|| (s... | [
"@",
"Override",
"public",
"InputSource",
"resolveEntity",
"(",
"String",
"publicId",
",",
"String",
"systemId",
")",
"{",
"logger",
".",
"debug",
"(",
"\"CMLResolver: resolving \"",
",",
"publicId",
",",
"\", \"",
",",
"systemId",
")",
";",
"systemId",
"=",
"... | Resolves SYSTEM and PUBLIC identifiers for CML DTDs.
@param publicId the PUBLIC identifier of the DTD (unused)
@param systemId the SYSTEM identifier of the DTD
@return the CML DTD as an InputSource or null if id's unresolvable | [
"Resolves",
"SYSTEM",
"and",
"PUBLIC",
"identifiers",
"for",
"CML",
"DTDs",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/io/src/main/java/org/openscience/cdk/io/cml/CMLResolver.java#L69-L85 |
114,202 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaGenerator.java | MolecularFormulaGenerator.checkInputParameters | protected void checkInputParameters(final IChemObjectBuilder builder,
final double minMass, final double maxMass,
final MolecularFormulaRange mfRange) {
if ((minMass < 0.0) || (maxMass < 0.0)) {
throw (new IllegalArgumen... | java | protected void checkInputParameters(final IChemObjectBuilder builder,
final double minMass, final double maxMass,
final MolecularFormulaRange mfRange) {
if ((minMass < 0.0) || (maxMass < 0.0)) {
throw (new IllegalArgumen... | [
"protected",
"void",
"checkInputParameters",
"(",
"final",
"IChemObjectBuilder",
"builder",
",",
"final",
"double",
"minMass",
",",
"final",
"double",
"maxMass",
",",
"final",
"MolecularFormulaRange",
"mfRange",
")",
"{",
"if",
"(",
"(",
"minMass",
"<",
"0.0",
"... | Checks if input parameters are valid and throws an IllegalArgumentException otherwise. | [
"Checks",
"if",
"input",
"parameters",
"are",
"valid",
"and",
"throws",
"an",
"IllegalArgumentException",
"otherwise",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaGenerator.java#L174-L201 |
114,203 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/MinimumCycleBasis.java | MinimumCycleBasis.paths | public int[][] paths() {
final int[][] paths = new int[size()][0];
int i = 0;
for (final Cycle c : basis.members())
paths[i++] = c.path();
return paths;
} | java | public int[][] paths() {
final int[][] paths = new int[size()][0];
int i = 0;
for (final Cycle c : basis.members())
paths[i++] = c.path();
return paths;
} | [
"public",
"int",
"[",
"]",
"[",
"]",
"paths",
"(",
")",
"{",
"final",
"int",
"[",
"]",
"[",
"]",
"paths",
"=",
"new",
"int",
"[",
"size",
"(",
")",
"]",
"[",
"0",
"]",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"final",
"Cycle",
"c",
":"... | The paths of all cycles in the minimum cycle basis.
@return array of vertex paths | [
"The",
"paths",
"of",
"all",
"cycles",
"in",
"the",
"minimum",
"cycle",
"basis",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/MinimumCycleBasis.java#L134-L140 |
114,204 | cdk/cdk | base/data/src/main/java/org/openscience/cdk/Atom.java | Atom.compare | @Override
public boolean compare(Object object) {
if (!(object instanceof IAtom)) {
return false;
}
if (!super.compare(object)) {
return false;
}
Atom atom = (Atom) object;
// XXX: floating point comparision!
if (((point2d == atom.point... | java | @Override
public boolean compare(Object object) {
if (!(object instanceof IAtom)) {
return false;
}
if (!super.compare(object)) {
return false;
}
Atom atom = (Atom) object;
// XXX: floating point comparision!
if (((point2d == atom.point... | [
"@",
"Override",
"public",
"boolean",
"compare",
"(",
"Object",
"object",
")",
"{",
"if",
"(",
"!",
"(",
"object",
"instanceof",
"IAtom",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"!",
"super",
".",
"compare",
"(",
"object",
")",
")",
... | Compares a atom with this atom.
@param object of type Atom
@return true, if the atoms are equal | [
"Compares",
"a",
"atom",
"with",
"this",
"atom",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/data/src/main/java/org/openscience/cdk/Atom.java#L450-L467 |
114,205 | cdk/cdk | storage/io/src/main/java/org/openscience/cdk/io/ReaderFactory.java | ReaderFactory.createReader | public ISimpleChemObjectReader createReader(InputStream input) throws IOException {
IChemFormat format = null;
ISimpleChemObjectReader reader = null;
if (input instanceof GZIPInputStream) {
format = formatFactory.guessFormat(input);
reader = createReader(format);
... | java | public ISimpleChemObjectReader createReader(InputStream input) throws IOException {
IChemFormat format = null;
ISimpleChemObjectReader reader = null;
if (input instanceof GZIPInputStream) {
format = formatFactory.guessFormat(input);
reader = createReader(format);
... | [
"public",
"ISimpleChemObjectReader",
"createReader",
"(",
"InputStream",
"input",
")",
"throws",
"IOException",
"{",
"IChemFormat",
"format",
"=",
"null",
";",
"ISimpleChemObjectReader",
"reader",
"=",
"null",
";",
"if",
"(",
"input",
"instanceof",
"GZIPInputStream",
... | Detects the format of the Reader input, and if known, it will return
a CDK Reader to read the format, or null when the reader is not
implemented.
@return null if CDK does not contain a reader for the detected format.
@see #createReader(Reader) | [
"Detects",
"the",
"format",
"of",
"the",
"Reader",
"input",
"and",
"if",
"known",
"it",
"will",
"return",
"a",
"CDK",
"Reader",
"to",
"read",
"the",
"format",
"or",
"null",
"when",
"the",
"reader",
"is",
"not",
"implemented",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/io/src/main/java/org/openscience/cdk/io/ReaderFactory.java#L97-L138 |
114,206 | cdk/cdk | storage/io/src/main/java/org/openscience/cdk/io/ReaderFactory.java | ReaderFactory.createReader | public ISimpleChemObjectReader createReader(IChemFormat format) {
if (format != null) {
String readerClassName = format.getReaderClassName();
if (readerClassName != null) {
try {
// make a new instance of this class
return (ISimpleC... | java | public ISimpleChemObjectReader createReader(IChemFormat format) {
if (format != null) {
String readerClassName = format.getReaderClassName();
if (readerClassName != null) {
try {
// make a new instance of this class
return (ISimpleC... | [
"public",
"ISimpleChemObjectReader",
"createReader",
"(",
"IChemFormat",
"format",
")",
"{",
"if",
"(",
"format",
"!=",
"null",
")",
"{",
"String",
"readerClassName",
"=",
"format",
".",
"getReaderClassName",
"(",
")",
";",
"if",
"(",
"readerClassName",
"!=",
... | Creates a new IChemObjectReader based on the given IChemFormat.
@see #createReader(InputStream) | [
"Creates",
"a",
"new",
"IChemObjectReader",
"based",
"on",
"the",
"given",
"IChemFormat",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/io/src/main/java/org/openscience/cdk/io/ReaderFactory.java#L145-L167 |
114,207 | cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.getTautomers | public List<IAtomContainer> getTautomers(IAtomContainer mol) throws CDKException, CloneNotSupportedException {
String opt = "";
if ((flags & KETO_ENOL) != 0)
opt += " -KET";
if ((flags & ONE_FIVE_SHIFT) != 0)
opt += " -15T";
InChIGenerator gen = InChIGenerator... | java | public List<IAtomContainer> getTautomers(IAtomContainer mol) throws CDKException, CloneNotSupportedException {
String opt = "";
if ((flags & KETO_ENOL) != 0)
opt += " -KET";
if ((flags & ONE_FIVE_SHIFT) != 0)
opt += " -15T";
InChIGenerator gen = InChIGenerator... | [
"public",
"List",
"<",
"IAtomContainer",
">",
"getTautomers",
"(",
"IAtomContainer",
"mol",
")",
"throws",
"CDKException",
",",
"CloneNotSupportedException",
"{",
"String",
"opt",
"=",
"\"\"",
";",
"if",
"(",
"(",
"flags",
"&",
"KETO_ENOL",
")",
"!=",
"0",
"... | Public method to get tautomers for an input molecule, based on the InChI which will be calculated by JNI-InChI.
@param mol molecule for which to generate tautomers
@return a list of tautomers, if any
@throws CDKException
@throws CloneNotSupportedException | [
"Public",
"method",
"to",
"get",
"tautomers",
"for",
"an",
"input",
"molecule",
"based",
"on",
"the",
"InChI",
"which",
"will",
"be",
"calculated",
"by",
"JNI",
"-",
"InChI",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L102-L121 |
114,208 | cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.connectAtoms | private IAtomContainer connectAtoms(String inputInchi, IAtomContainer inputMolecule,
Map<Integer, IAtom> inchiAtomsByPosition) throws CDKException {
String inchi = inputInchi;
inchi = inchi.substring(inchi.indexOf('/') + 1);
inchi = inchi.substring(inchi.indexOf('/') + 1);
St... | java | private IAtomContainer connectAtoms(String inputInchi, IAtomContainer inputMolecule,
Map<Integer, IAtom> inchiAtomsByPosition) throws CDKException {
String inchi = inputInchi;
inchi = inchi.substring(inchi.indexOf('/') + 1);
inchi = inchi.substring(inchi.indexOf('/') + 1);
St... | [
"private",
"IAtomContainer",
"connectAtoms",
"(",
"String",
"inputInchi",
",",
"IAtomContainer",
"inputMolecule",
",",
"Map",
"<",
"Integer",
",",
"IAtom",
">",
"inchiAtomsByPosition",
")",
"throws",
"CDKException",
"{",
"String",
"inchi",
"=",
"inputInchi",
";",
... | Pops and pushes its ways through the InChI connection table to build up a simple molecule.
@param inputInchi user input InChI
@param inputMolecule user input molecule
@param inchiAtomsByPosition
@return molecule with single bonds and no hydrogens. | [
"Pops",
"and",
"pushes",
"its",
"ways",
"through",
"the",
"InChI",
"connection",
"table",
"to",
"build",
"up",
"a",
"simple",
"molecule",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L256-L313 |
114,209 | cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.mapInputMoleculeToInchiMolgraph | private void mapInputMoleculeToInchiMolgraph(IAtomContainer inchiMolGraph, IAtomContainer mol) throws CDKException {
Iterator<Map<IAtom, IAtom>> iter = org.openscience.cdk.isomorphism.VentoFoggia.findIdentical(inchiMolGraph,
... | java | private void mapInputMoleculeToInchiMolgraph(IAtomContainer inchiMolGraph, IAtomContainer mol) throws CDKException {
Iterator<Map<IAtom, IAtom>> iter = org.openscience.cdk.isomorphism.VentoFoggia.findIdentical(inchiMolGraph,
... | [
"private",
"void",
"mapInputMoleculeToInchiMolgraph",
"(",
"IAtomContainer",
"inchiMolGraph",
",",
"IAtomContainer",
"mol",
")",
"throws",
"CDKException",
"{",
"Iterator",
"<",
"Map",
"<",
"IAtom",
",",
"IAtom",
">",
">",
"iter",
"=",
"org",
".",
"openscience",
... | Atom-atom mapping of the input molecule to the bare container constructed from the InChI connection table.
This makes it possible to map the positions of the mobile hydrogens in the InChI back to the input molecule.
@param inchiMolGraph molecule (bare) as defined in InChI
@param mol user input molecule
@throws CDKExcep... | [
"Atom",
"-",
"atom",
"mapping",
"of",
"the",
"input",
"molecule",
"to",
"the",
"bare",
"container",
"constructed",
"from",
"the",
"InChI",
"connection",
"table",
".",
"This",
"makes",
"it",
"possible",
"to",
"map",
"the",
"positions",
"of",
"the",
"mobile",
... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L322-L342 |
114,210 | cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.combineHydrogenPositions | private void combineHydrogenPositions(List<Integer> taken, List<List<Integer>> combinations,
IAtomContainer skeleton, int totalMobHydrCount, List<Integer> mobHydrAttachPositions) {
if (taken.size() != totalMobHydrCount) {
for (int i = 0; i < mobHydrAttachPositions.size(); i++) {
... | java | private void combineHydrogenPositions(List<Integer> taken, List<List<Integer>> combinations,
IAtomContainer skeleton, int totalMobHydrCount, List<Integer> mobHydrAttachPositions) {
if (taken.size() != totalMobHydrCount) {
for (int i = 0; i < mobHydrAttachPositions.size(); i++) {
... | [
"private",
"void",
"combineHydrogenPositions",
"(",
"List",
"<",
"Integer",
">",
"taken",
",",
"List",
"<",
"List",
"<",
"Integer",
">",
">",
"combinations",
",",
"IAtomContainer",
"skeleton",
",",
"int",
"totalMobHydrCount",
",",
"List",
"<",
"Integer",
">",
... | Makes combinations recursively of all possible mobile Hydrogen positions.
@param taken positions taken by hydrogen
@param combinations combinations made so far
@param skeleton container to work on
@param totalMobHydrCount
@param mobHydrAttachPositions | [
"Makes",
"combinations",
"recursively",
"of",
"all",
"possible",
"mobile",
"Hydrogen",
"positions",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L598-L622 |
114,211 | cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.findAtomByPosition | private IAtom findAtomByPosition(IAtomContainer container, int position) {
String pos = String.valueOf(position);
for (IAtom atom : container.atoms()) {
if (atom.getID().equals(pos)) return atom;
}
return null;
} | java | private IAtom findAtomByPosition(IAtomContainer container, int position) {
String pos = String.valueOf(position);
for (IAtom atom : container.atoms()) {
if (atom.getID().equals(pos)) return atom;
}
return null;
} | [
"private",
"IAtom",
"findAtomByPosition",
"(",
"IAtomContainer",
"container",
",",
"int",
"position",
")",
"{",
"String",
"pos",
"=",
"String",
".",
"valueOf",
"(",
"position",
")",
";",
"for",
"(",
"IAtom",
"atom",
":",
"container",
".",
"atoms",
"(",
")"... | Helper method that locates an atom based on its InChI atom table
position, which has been set as ID.
@param container input container
@param position InChI atom table position
@return atom on the position | [
"Helper",
"method",
"that",
"locates",
"an",
"atom",
"based",
"on",
"its",
"InChI",
"atom",
"table",
"position",
"which",
"has",
"been",
"set",
"as",
"ID",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L631-L637 |
114,212 | cdk/cdk | tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java | InChITautomerGenerator.tryDoubleBondCombinations | private List<Integer> tryDoubleBondCombinations(IAtomContainer container, int dblBondsAdded, int bondOffSet,
int doubleBondMax, List<IAtom> atomsInNeedOfFix) {
int offSet = bondOffSet;
List<Integer> dblBondPositions = null;
while (offSet < container.getBondCount() && dblBondPositio... | java | private List<Integer> tryDoubleBondCombinations(IAtomContainer container, int dblBondsAdded, int bondOffSet,
int doubleBondMax, List<IAtom> atomsInNeedOfFix) {
int offSet = bondOffSet;
List<Integer> dblBondPositions = null;
while (offSet < container.getBondCount() && dblBondPositio... | [
"private",
"List",
"<",
"Integer",
">",
"tryDoubleBondCombinations",
"(",
"IAtomContainer",
"container",
",",
"int",
"dblBondsAdded",
",",
"int",
"bondOffSet",
",",
"int",
"doubleBondMax",
",",
"List",
"<",
"IAtom",
">",
"atomsInNeedOfFix",
")",
"{",
"int",
"off... | Tries double bond combinations for a certain input container of which the double bonds have been stripped
around the mobile hydrogen positions. Recursively.
@param container
@param dblBondsAdded counts double bonds added so far
@param bondOffSet offset for next double bond position to consider
@param doubleBondMax max... | [
"Tries",
"double",
"bond",
"combinations",
"for",
"a",
"certain",
"input",
"container",
"of",
"which",
"the",
"double",
"bonds",
"have",
"been",
"stripped",
"around",
"the",
"mobile",
"hydrogen",
"positions",
".",
"Recursively",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/tautomer/src/main/java/org/openscience/cdk/tautomers/InChITautomerGenerator.java#L650-L688 |
114,213 | cdk/cdk | tool/structgen/src/main/java/org/openscience/cdk/structgen/MathTools.java | MathTools.max | static double max(double[] values) {
double max = values[0];
for (double value : values)
if (value > max) max = value;
return max;
} | java | static double max(double[] values) {
double max = values[0];
for (double value : values)
if (value > max) max = value;
return max;
} | [
"static",
"double",
"max",
"(",
"double",
"[",
"]",
"values",
")",
"{",
"double",
"max",
"=",
"values",
"[",
"0",
"]",
";",
"for",
"(",
"double",
"value",
":",
"values",
")",
"if",
"(",
"value",
">",
"max",
")",
"max",
"=",
"value",
";",
"return"... | Analog of Math.max that returns the largest double value in an array of doubles.
@param values the values to be searched for the largest value among them
@return the largest value among a set of given values | [
"Analog",
"of",
"Math",
".",
"max",
"that",
"returns",
"the",
"largest",
"double",
"value",
"in",
"an",
"array",
"of",
"doubles",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/structgen/src/main/java/org/openscience/cdk/structgen/MathTools.java#L36-L41 |
114,214 | cdk/cdk | tool/structgen/src/main/java/org/openscience/cdk/structgen/MathTools.java | MathTools.min | static double min(double[] values) {
double min = values[0];
for (double value : values)
if (value < min) min = value;
return min;
} | java | static double min(double[] values) {
double min = values[0];
for (double value : values)
if (value < min) min = value;
return min;
} | [
"static",
"double",
"min",
"(",
"double",
"[",
"]",
"values",
")",
"{",
"double",
"min",
"=",
"values",
"[",
"0",
"]",
";",
"for",
"(",
"double",
"value",
":",
"values",
")",
"if",
"(",
"value",
"<",
"min",
")",
"min",
"=",
"value",
";",
"return"... | Analog of Math.min that returns the largest double value in an array of double.
@param values the values to be searched for the smallest value among them
@return the smallest value among a set of given values | [
"Analog",
"of",
"Math",
".",
"min",
"that",
"returns",
"the",
"largest",
"double",
"value",
"in",
"an",
"array",
"of",
"double",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/structgen/src/main/java/org/openscience/cdk/structgen/MathTools.java#L49-L54 |
114,215 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/ChemSequence.java | ChemSequence.addChemModel | @Override
public void addChemModel(IChemModel chemModel) {
if (chemModelCount + 1 >= chemModels.length) {
growChemModelArray();
}
chemModels[chemModelCount] = chemModel;
chemModelCount++;
} | java | @Override
public void addChemModel(IChemModel chemModel) {
if (chemModelCount + 1 >= chemModels.length) {
growChemModelArray();
}
chemModels[chemModelCount] = chemModel;
chemModelCount++;
} | [
"@",
"Override",
"public",
"void",
"addChemModel",
"(",
"IChemModel",
"chemModel",
")",
"{",
"if",
"(",
"chemModelCount",
"+",
"1",
">=",
"chemModels",
".",
"length",
")",
"{",
"growChemModelArray",
"(",
")",
";",
"}",
"chemModels",
"[",
"chemModelCount",
"]... | Adds an chemModel to this container.
@param chemModel The chemModel to be added to this container
@see #getChemModel | [
"Adds",
"an",
"chemModel",
"to",
"this",
"container",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/ChemSequence.java#L84-L91 |
114,216 | cdk/cdk | tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactory.java | GeometricDoubleBondEncoderFactory.create | @Override
public StereoEncoder create(IAtomContainer container, int[][] graph) {
List<StereoEncoder> encoders = new ArrayList<StereoEncoder>(5);
for (IBond bond : container.bonds()) {
// if double bond and not E or Z query bond
if (DOUBLE.equals(bond.getOrder()) && !E_OR_Z... | java | @Override
public StereoEncoder create(IAtomContainer container, int[][] graph) {
List<StereoEncoder> encoders = new ArrayList<StereoEncoder>(5);
for (IBond bond : container.bonds()) {
// if double bond and not E or Z query bond
if (DOUBLE.equals(bond.getOrder()) && !E_OR_Z... | [
"@",
"Override",
"public",
"StereoEncoder",
"create",
"(",
"IAtomContainer",
"container",
",",
"int",
"[",
"]",
"[",
"]",
"graph",
")",
"{",
"List",
"<",
"StereoEncoder",
">",
"encoders",
"=",
"new",
"ArrayList",
"<",
"StereoEncoder",
">",
"(",
"5",
")",
... | Create a stereo encoder for all potential 2D and 3D double bond stereo
configurations.
@param container an atom container
@param graph adjacency list representation of the container
@return a new encoder for tetrahedral elements | [
"Create",
"a",
"stereo",
"encoder",
"for",
"all",
"potential",
"2D",
"and",
"3D",
"double",
"bond",
"stereo",
"configurations",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactory.java#L66-L92 |
114,217 | cdk/cdk | tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactory.java | GeometricDoubleBondEncoderFactory.newEncoder | static StereoEncoder newEncoder(IAtomContainer container, IAtom left, IAtom leftParent, IAtom right,
IAtom rightParent, int[][] graph) {
List<IBond> leftBonds = container.getConnectedBondsList(left);
List<IBond> rightBonds = container.getConnectedBondsList(right);
// check the left... | java | static StereoEncoder newEncoder(IAtomContainer container, IAtom left, IAtom leftParent, IAtom right,
IAtom rightParent, int[][] graph) {
List<IBond> leftBonds = container.getConnectedBondsList(left);
List<IBond> rightBonds = container.getConnectedBondsList(right);
// check the left... | [
"static",
"StereoEncoder",
"newEncoder",
"(",
"IAtomContainer",
"container",
",",
"IAtom",
"left",
",",
"IAtom",
"leftParent",
",",
"IAtom",
"right",
",",
"IAtom",
"rightParent",
",",
"int",
"[",
"]",
"[",
"]",
"graph",
")",
"{",
"List",
"<",
"IBond",
">",... | Create a new encoder for the specified left and right atoms. The parent
is the atom which is connected by a double bond to the left and right
atom. For simple double bonds the parent of each is the other atom, in
cumulenes the parents are not the same.
@param container the molecule
@param left the left atom
@... | [
"Create",
"a",
"new",
"encoder",
"for",
"the",
"specified",
"left",
"and",
"right",
"atoms",
".",
"The",
"parent",
"is",
"the",
"atom",
"which",
"is",
"connected",
"by",
"a",
"double",
"bond",
"to",
"the",
"left",
"and",
"right",
"atom",
".",
"For",
"s... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactory.java#L108-L146 |
114,218 | cdk/cdk | tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactory.java | GeometricDoubleBondEncoderFactory.permutation | static PermutationParity permutation(int[] neighbors) {
return neighbors.length == 2 ? PermutationParity.IDENTITY : new BasicPermutationParity(Arrays.copyOf(neighbors,
neighbors.length - 1));
} | java | static PermutationParity permutation(int[] neighbors) {
return neighbors.length == 2 ? PermutationParity.IDENTITY : new BasicPermutationParity(Arrays.copyOf(neighbors,
neighbors.length - 1));
} | [
"static",
"PermutationParity",
"permutation",
"(",
"int",
"[",
"]",
"neighbors",
")",
"{",
"return",
"neighbors",
".",
"length",
"==",
"2",
"?",
"PermutationParity",
".",
"IDENTITY",
":",
"new",
"BasicPermutationParity",
"(",
"Arrays",
".",
"copyOf",
"(",
"nei... | Create a permutation parity for the given neighbors. The neighbor list
should include the other double bonded atom but in the last index.
<pre>
c3
\
c2 = c1 = [c3,c4,c1]
/
c4
</pre>
@param neighbors neighbors of a double bonded atom specified by index
@return a new permutation parity | [
"Create",
"a",
"permutation",
"parity",
"for",
"the",
"given",
"neighbors",
".",
"The",
"neighbor",
"list",
"should",
"include",
"the",
"other",
"double",
"bonded",
"atom",
"but",
"in",
"the",
"last",
"index",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/hash/src/main/java/org/openscience/cdk/hash/stereo/GeometricDoubleBondEncoderFactory.java#L211-L214 |
114,219 | cdk/cdk | descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/PartialTChargeMMFF94Descriptor.java | PartialTChargeMMFF94Descriptor.calculate | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer org) {
if (atom.getProperty(CHARGE_CACHE) == null) {
IAtomContainer copy;
try {
copy = org.clone();
} catch (CloneNotSupportedException e) {
return new DescriptorValue(... | java | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer org) {
if (atom.getProperty(CHARGE_CACHE) == null) {
IAtomContainer copy;
try {
copy = org.clone();
} catch (CloneNotSupportedException e) {
return new DescriptorValue(... | [
"@",
"Override",
"public",
"DescriptorValue",
"calculate",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"org",
")",
"{",
"if",
"(",
"atom",
".",
"getProperty",
"(",
"CHARGE_CACHE",
")",
"==",
"null",
")",
"{",
"IAtomContainer",
"copy",
";",
"try",
"{",
"co... | The method returns partial charges assigned to an heavy atom through
MMFF94 method. It is needed to call the addExplicitHydrogensToSatisfyValency
method from the class tools.HydrogenAdder.
@param atom The IAtom for which the DescriptorValue is requested
@param org AtomContainer
@return partial charge of parameter ato... | [
"The",
"method",
"returns",
"partial",
"charges",
"assigned",
"to",
"an",
"heavy",
"atom",
"through",
"MMFF94",
"method",
".",
"It",
"is",
"needed",
"to",
"call",
"the",
"addExplicitHydrogensToSatisfyValency",
"method",
"from",
"the",
"class",
"tools",
".",
"Hyd... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/PartialTChargeMMFF94Descriptor.java#L113-L151 |
114,220 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java | MmffAtomTypeMatcher.fixNCNTypes | private void fixNCNTypes(String[] symbs, int[][] graph) {
for (int v = 0; v < graph.length; v++) {
if ("NCN+".equals(symbs[v])) {
boolean foundCNN = false;
for (int w : graph[v]) {
foundCNN = foundCNN || "CNN+".equals(symbs[w]) || "CIM+".equals(sym... | java | private void fixNCNTypes(String[] symbs, int[][] graph) {
for (int v = 0; v < graph.length; v++) {
if ("NCN+".equals(symbs[v])) {
boolean foundCNN = false;
for (int w : graph[v]) {
foundCNN = foundCNN || "CNN+".equals(symbs[w]) || "CIM+".equals(sym... | [
"private",
"void",
"fixNCNTypes",
"(",
"String",
"[",
"]",
"symbs",
",",
"int",
"[",
"]",
"[",
"]",
"graph",
")",
"{",
"for",
"(",
"int",
"v",
"=",
"0",
";",
"v",
"<",
"graph",
".",
"length",
";",
"v",
"++",
")",
"{",
"if",
"(",
"\"NCN+\"",
"... | Special case, 'NCN+' matches entries that the validation suite say should actually be 'NC=N'.
We can achieve 100% compliance by checking if NCN+ is still next to CNN+ or CIM+ after
aromatic types are assigned
@param symbs symbolic types
@param graph adjacency list graph | [
"Special",
"case",
"NCN",
"+",
"matches",
"entries",
"that",
"the",
"validation",
"suite",
"say",
"should",
"actually",
"be",
"NC",
"=",
"N",
".",
"We",
"can",
"achieve",
"100%",
"compliance",
"by",
"checking",
"if",
"NCN",
"+",
"is",
"still",
"next",
"t... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java#L149-L161 |
114,221 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java | MmffAtomTypeMatcher.checkPreconditions | private void checkPreconditions(IAtomContainer container) {
for (IAtom atom : container.atoms()) {
if (atom.getImplicitHydrogenCount() == null || atom.getImplicitHydrogenCount() != 0)
throw new IllegalArgumentException("Hydrogens should be unsuppressed (explicit)");
if (a... | java | private void checkPreconditions(IAtomContainer container) {
for (IAtom atom : container.atoms()) {
if (atom.getImplicitHydrogenCount() == null || atom.getImplicitHydrogenCount() != 0)
throw new IllegalArgumentException("Hydrogens should be unsuppressed (explicit)");
if (a... | [
"private",
"void",
"checkPreconditions",
"(",
"IAtomContainer",
"container",
")",
"{",
"for",
"(",
"IAtom",
"atom",
":",
"container",
".",
"atoms",
"(",
")",
")",
"{",
"if",
"(",
"atom",
".",
"getImplicitHydrogenCount",
"(",
")",
"==",
"null",
"||",
"atom"... | preconditions, 1. all hydrogens must be present as explicit nodes in the connection table.
this requires that each atom explicitly states it has exactly 0 hydrogens 2. the SMARTS treat
all atoms as aliphatic and therefore no aromatic flags should be set, we could remove this
but ideally we don't want to modify the stru... | [
"preconditions",
"1",
".",
"all",
"hydrogens",
"must",
"be",
"present",
"as",
"explicit",
"nodes",
"in",
"the",
"connection",
"table",
".",
"this",
"requires",
"that",
"each",
"atom",
"explicitly",
"states",
"it",
"has",
"exactly",
"0",
"hydrogens",
"2",
"."... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java#L171-L178 |
114,222 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java | MmffAtomTypeMatcher.assignHydrogenTypes | private void assignHydrogenTypes(IAtomContainer container, String[] symbs, int[][] graph) {
for (int v = 0; v < graph.length; v++) {
if (container.getAtom(v).getSymbol().equals("H") && graph[v].length == 1) {
int w = graph[v][0];
symbs[v] = this.hydrogenMap.get(symbs[... | java | private void assignHydrogenTypes(IAtomContainer container, String[] symbs, int[][] graph) {
for (int v = 0; v < graph.length; v++) {
if (container.getAtom(v).getSymbol().equals("H") && graph[v].length == 1) {
int w = graph[v][0];
symbs[v] = this.hydrogenMap.get(symbs[... | [
"private",
"void",
"assignHydrogenTypes",
"(",
"IAtomContainer",
"container",
",",
"String",
"[",
"]",
"symbs",
",",
"int",
"[",
"]",
"[",
"]",
"graph",
")",
"{",
"for",
"(",
"int",
"v",
"=",
"0",
";",
"v",
"<",
"graph",
".",
"length",
";",
"v",
"+... | Hydrogen types, assigned based on the MMFFHDEF.PAR parent associations.
@param container input structure representation
@param symbs symbolic atom types
@param graph adjacency list graph | [
"Hydrogen",
"types",
"assigned",
"based",
"on",
"the",
"MMFFHDEF",
".",
"PAR",
"parent",
"associations",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java#L187-L194 |
114,223 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java | MmffAtomTypeMatcher.assignPreliminaryTypes | private void assignPreliminaryTypes(IAtomContainer container, String[] symbs) {
// shallow copy
IAtomContainer cpy = container.getBuilder().newInstance(IAtomContainer.class, container);
Cycles.markRingAtomsAndBonds(cpy);
for (AtomTypePattern matcher : patterns) {
for (final i... | java | private void assignPreliminaryTypes(IAtomContainer container, String[] symbs) {
// shallow copy
IAtomContainer cpy = container.getBuilder().newInstance(IAtomContainer.class, container);
Cycles.markRingAtomsAndBonds(cpy);
for (AtomTypePattern matcher : patterns) {
for (final i... | [
"private",
"void",
"assignPreliminaryTypes",
"(",
"IAtomContainer",
"container",
",",
"String",
"[",
"]",
"symbs",
")",
"{",
"// shallow copy",
"IAtomContainer",
"cpy",
"=",
"container",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IAtomContainer",
".",
... | Preliminary atom types are assigned using SMARTS definitions.
@param container input structure representation
@param symbs symbolic atom types | [
"Preliminary",
"atom",
"types",
"are",
"assigned",
"using",
"SMARTS",
"definitions",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java#L202-L213 |
114,224 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java | MmffAtomTypeMatcher.loadPatterns | static AtomTypePattern[] loadPatterns(InputStream smaIn) throws IOException {
List<AtomTypePattern> matchers = new ArrayList<AtomTypePattern>();
BufferedReader br = new BufferedReader(new InputStreamReader(smaIn));
String line = null;
while ((line = br.readLine()) != null) {
... | java | static AtomTypePattern[] loadPatterns(InputStream smaIn) throws IOException {
List<AtomTypePattern> matchers = new ArrayList<AtomTypePattern>();
BufferedReader br = new BufferedReader(new InputStreamReader(smaIn));
String line = null;
while ((line = br.readLine()) != null) {
... | [
"static",
"AtomTypePattern",
"[",
"]",
"loadPatterns",
"(",
"InputStream",
"smaIn",
")",
"throws",
"IOException",
"{",
"List",
"<",
"AtomTypePattern",
">",
"matchers",
"=",
"new",
"ArrayList",
"<",
"AtomTypePattern",
">",
"(",
")",
";",
"BufferedReader",
"br",
... | Internal - load the SMARTS patterns for each atom type from MMFFSYMB.sma.
@param smaIn input stream of MMFFSYMB.sma
@return array of patterns
@throws IOException | [
"Internal",
"-",
"load",
"the",
"SMARTS",
"patterns",
"for",
"each",
"atom",
"type",
"from",
"MMFFSYMB",
".",
"sma",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java#L222-L241 |
114,225 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java | MmffAtomTypeMatcher.loadHydrogenDefinitions | private Map<String, String> loadHydrogenDefinitions(InputStream hdefIn) throws IOException {
// maps of symbolic atom types to hydrogen atom types and internal types
final Map<String, String> hdefs = new HashMap<String, String>(200);
BufferedReader br = new BufferedReader(new InputStreamReader... | java | private Map<String, String> loadHydrogenDefinitions(InputStream hdefIn) throws IOException {
// maps of symbolic atom types to hydrogen atom types and internal types
final Map<String, String> hdefs = new HashMap<String, String>(200);
BufferedReader br = new BufferedReader(new InputStreamReader... | [
"private",
"Map",
"<",
"String",
",",
"String",
">",
"loadHydrogenDefinitions",
"(",
"InputStream",
"hdefIn",
")",
"throws",
"IOException",
"{",
"// maps of symbolic atom types to hydrogen atom types and internal types",
"final",
"Map",
"<",
"String",
",",
"String",
">",
... | Hydrogen atom types are assigned based on their parent types. The mmff-symb-mapping file
provides this mapping.
@param hdefIn input stream of mmff-symb-mapping.tsv
@return mapping of parent to hydrogen definitions
@throws IOException | [
"Hydrogen",
"atom",
"types",
"are",
"assigned",
"based",
"on",
"their",
"parent",
"types",
".",
"The",
"mmff",
"-",
"symb",
"-",
"mapping",
"file",
"provides",
"this",
"mapping",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/MmffAtomTypeMatcher.java#L251-L268 |
114,226 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/IsotopePatternManipulator.java | IsotopePatternManipulator.normalize | public static IsotopePattern normalize(IsotopePattern isotopeP) {
IsotopeContainer isoHighest = null;
double biggestAbundance = 0;
/* Extraction of the isoContainer with the highest abundance */
for (IsotopeContainer isoContainer : isotopeP.getIsotopes()) {
double abundance ... | java | public static IsotopePattern normalize(IsotopePattern isotopeP) {
IsotopeContainer isoHighest = null;
double biggestAbundance = 0;
/* Extraction of the isoContainer with the highest abundance */
for (IsotopeContainer isoContainer : isotopeP.getIsotopes()) {
double abundance ... | [
"public",
"static",
"IsotopePattern",
"normalize",
"(",
"IsotopePattern",
"isotopeP",
")",
"{",
"IsotopeContainer",
"isoHighest",
"=",
"null",
";",
"double",
"biggestAbundance",
"=",
"0",
";",
"/* Extraction of the isoContainer with the highest abundance */",
"for",
"(",
... | Return the isotope pattern normalized to the highest abundance.
@param isotopeP The IsotopePattern object to normalize
@return The IsotopePattern normalized | [
"Return",
"the",
"isotope",
"pattern",
"normalized",
"to",
"the",
"highest",
"abundance",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/IsotopePatternManipulator.java#L23-L55 |
114,227 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/IsotopePatternManipulator.java | IsotopePatternManipulator.sortAndNormalizedByIntensity | public static IsotopePattern sortAndNormalizedByIntensity(IsotopePattern isotopeP) {
IsotopePattern isoNorma = normalize(isotopeP);
return sortByIntensity(isoNorma);
} | java | public static IsotopePattern sortAndNormalizedByIntensity(IsotopePattern isotopeP) {
IsotopePattern isoNorma = normalize(isotopeP);
return sortByIntensity(isoNorma);
} | [
"public",
"static",
"IsotopePattern",
"sortAndNormalizedByIntensity",
"(",
"IsotopePattern",
"isotopeP",
")",
"{",
"IsotopePattern",
"isoNorma",
"=",
"normalize",
"(",
"isotopeP",
")",
";",
"return",
"sortByIntensity",
"(",
"isoNorma",
")",
";",
"}"
] | Return the isotope pattern sorted and normalized by intensity
to the highest abundance.
@param isotopeP The IsotopePattern object to sort
@return The IsotopePattern sorted | [
"Return",
"the",
"isotope",
"pattern",
"sorted",
"and",
"normalized",
"by",
"intensity",
"to",
"the",
"highest",
"abundance",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/IsotopePatternManipulator.java#L64-L67 |
114,228 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/IsotopePatternManipulator.java | IsotopePatternManipulator.sortByMass | public static IsotopePattern sortByMass(IsotopePattern isotopeP) {
try {
IsotopePattern isoSort = (IsotopePattern) isotopeP.clone();
// Do nothing for empty isotope pattern
if (isoSort.getNumberOfIsotopes() == 0)
return isoSort;
// S... | java | public static IsotopePattern sortByMass(IsotopePattern isotopeP) {
try {
IsotopePattern isoSort = (IsotopePattern) isotopeP.clone();
// Do nothing for empty isotope pattern
if (isoSort.getNumberOfIsotopes() == 0)
return isoSort;
// S... | [
"public",
"static",
"IsotopePattern",
"sortByMass",
"(",
"IsotopePattern",
"isotopeP",
")",
"{",
"try",
"{",
"IsotopePattern",
"isoSort",
"=",
"(",
"IsotopePattern",
")",
"isotopeP",
".",
"clone",
"(",
")",
";",
"// Do nothing for empty isotope pattern",
"if",
"(",
... | Return the isotope pattern sorted by mass
to the highest abundance.
@param isotopeP The IsotopePattern object to sort
@return The IsotopePattern sorted | [
"Return",
"the",
"isotope",
"pattern",
"sorted",
"by",
"mass",
"to",
"the",
"highest",
"abundance",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/IsotopePatternManipulator.java#L113-L140 |
114,229 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/ringsearch/cyclebasis/SimpleCycle.java | SimpleCycle.weight | public double weight() {
double result = 0;
Iterator edgeIterator = edgeSet().iterator();
while (edgeIterator.hasNext()) {
result += ((Edge) edgeIterator.next()).getWeight();
}
return result;
} | java | public double weight() {
double result = 0;
Iterator edgeIterator = edgeSet().iterator();
while (edgeIterator.hasNext()) {
result += ((Edge) edgeIterator.next()).getWeight();
}
return result;
} | [
"public",
"double",
"weight",
"(",
")",
"{",
"double",
"result",
"=",
"0",
";",
"Iterator",
"edgeIterator",
"=",
"edgeSet",
"(",
")",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"edgeIterator",
".",
"hasNext",
"(",
")",
")",
"{",
"result",
"+=",
"(... | Returns the sum of the weights of all edges in this cycle.
@return the sum of the weights of all edges in this cycle | [
"Returns",
"the",
"sum",
"of",
"the",
"weights",
"of",
"all",
"edges",
"in",
"this",
"cycle",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/ringsearch/cyclebasis/SimpleCycle.java#L91-L98 |
114,230 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/ringsearch/cyclebasis/SimpleCycle.java | SimpleCycle.vertexList | public List vertexList() {
List vertices = new ArrayList(edgeSet().size());
Object startVertex = vertexSet().iterator().next();
Object vertex = startVertex;
Object previousVertex = null;
Object nextVertex = null;
while (nextVertex != startVertex) {
assert (... | java | public List vertexList() {
List vertices = new ArrayList(edgeSet().size());
Object startVertex = vertexSet().iterator().next();
Object vertex = startVertex;
Object previousVertex = null;
Object nextVertex = null;
while (nextVertex != startVertex) {
assert (... | [
"public",
"List",
"vertexList",
"(",
")",
"{",
"List",
"vertices",
"=",
"new",
"ArrayList",
"(",
"edgeSet",
"(",
")",
".",
"size",
"(",
")",
")",
";",
"Object",
"startVertex",
"=",
"vertexSet",
"(",
")",
".",
"iterator",
"(",
")",
".",
"next",
"(",
... | Returns a list of the vertices contained in this cycle.
The vertices are in the order of a traversal of the cycle.
@return a list of the vertices contained in this cycle | [
"Returns",
"a",
"list",
"of",
"the",
"vertices",
"contained",
"in",
"this",
"cycle",
".",
"The",
"vertices",
"are",
"in",
"the",
"order",
"of",
"a",
"traversal",
"of",
"the",
"cycle",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/ringsearch/cyclebasis/SimpleCycle.java#L106-L135 |
114,231 | cdk/cdk | storage/io/src/main/java/org/openscience/cdk/geometry/ZMatrixTools.java | ZMatrixTools.zmatrixToCartesian | public static Point3d[] zmatrixToCartesian(double[] distances, int[] first_atoms, double[] angles,
int[] second_atoms, double[] dihedrals, int[] third_atoms) {
Point3d[] cartesianCoords = new Point3d[distances.length];
for (int index = 0; index < distances.length; index++) {
if (... | java | public static Point3d[] zmatrixToCartesian(double[] distances, int[] first_atoms, double[] angles,
int[] second_atoms, double[] dihedrals, int[] third_atoms) {
Point3d[] cartesianCoords = new Point3d[distances.length];
for (int index = 0; index < distances.length; index++) {
if (... | [
"public",
"static",
"Point3d",
"[",
"]",
"zmatrixToCartesian",
"(",
"double",
"[",
"]",
"distances",
",",
"int",
"[",
"]",
"first_atoms",
",",
"double",
"[",
"]",
"angles",
",",
"int",
"[",
"]",
"second_atoms",
",",
"double",
"[",
"]",
"dihedrals",
",",
... | Takes the given Z Matrix coordinates and converts them to cartesian coordinates.
The first Atom end up in the origin, the second on on the x axis, and the third
one in the XY plane. The rest is added by applying the Zmatrix distances, angles
and dihedrals. Angles are in degrees.
@param distances Array of distance ... | [
"Takes",
"the",
"given",
"Z",
"Matrix",
"coordinates",
"and",
"converts",
"them",
"to",
"cartesian",
"coordinates",
".",
"The",
"first",
"Atom",
"end",
"up",
"in",
"the",
"origin",
"the",
"second",
"on",
"on",
"the",
"x",
"axis",
"and",
"the",
"third",
"... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/io/src/main/java/org/openscience/cdk/geometry/ZMatrixTools.java#L57-L91 |
114,232 | cdk/cdk | descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/SigmaElectronegativityDescriptor.java | SigmaElectronegativityDescriptor.setParameters | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length > 1) {
throw new CDKException("SigmaElectronegativityDescriptor only expects one parameter");
}
if (!(params[0] instanceof Integer)) {
throw new CDKException("The parameter mu... | java | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length > 1) {
throw new CDKException("SigmaElectronegativityDescriptor only expects one parameter");
}
if (!(params[0] instanceof Integer)) {
throw new CDKException("The parameter mu... | [
"@",
"Override",
"public",
"void",
"setParameters",
"(",
"Object",
"[",
"]",
"params",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"params",
".",
"length",
">",
"1",
")",
"{",
"throw",
"new",
"CDKException",
"(",
"\"SigmaElectronegativityDescriptor only expec... | Sets the parameters attribute of the SigmaElectronegativityDescriptor
object
@param params 1: max iterations (optional, defaults to 20)
@exception CDKException Description of the Exception | [
"Sets",
"the",
"parameters",
"attribute",
"of",
"the",
"SigmaElectronegativityDescriptor",
"object"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/SigmaElectronegativityDescriptor.java#L94-L104 |
114,233 | cdk/cdk | descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/SigmaElectronegativityDescriptor.java | SigmaElectronegativityDescriptor.calculate | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer ac) {
IAtomContainer clone;
IAtom localAtom;
try {
clone = (IAtomContainer) ac.clone();
localAtom = clone.getAtom(ac.indexOf(atom));
AtomContainerManipulator.percieveAtomTypesAndConfigu... | java | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer ac) {
IAtomContainer clone;
IAtom localAtom;
try {
clone = (IAtomContainer) ac.clone();
localAtom = clone.getAtom(ac.indexOf(atom));
AtomContainerManipulator.percieveAtomTypesAndConfigu... | [
"@",
"Override",
"public",
"DescriptorValue",
"calculate",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"ac",
")",
"{",
"IAtomContainer",
"clone",
";",
"IAtom",
"localAtom",
";",
"try",
"{",
"clone",
"=",
"(",
"IAtomContainer",
")",
"ac",
".",
"clone",
"(",
... | The method calculates the sigma electronegativity of a given atom
It is needed to call the addExplicitHydrogensToSatisfyValency method from the class tools.HydrogenAdder.
@param atom The IAtom for which the DescriptorValue is requested
@param ac AtomContainer
@return ret... | [
"The",
"method",
"calculates",
"the",
"sigma",
"electronegativity",
"of",
"a",
"given",
"atom",
"It",
"is",
"needed",
"to",
"call",
"the",
"addExplicitHydrogensToSatisfyValency",
"method",
"from",
"the",
"class",
"tools",
".",
"HydrogenAdder",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/SigmaElectronegativityDescriptor.java#L133-L156 |
114,234 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaRange.java | MolecularFormulaRange.addIsotope | public void addIsotope(IIsotope isotope, int countMin, int countMax) {
if (isotope == null)
throw new IllegalArgumentException("Isotope must not be null");
boolean flag = false;
for (Iterator<IIsotope> it = isotopes().iterator(); it.hasNext();) {
IIsoto... | java | public void addIsotope(IIsotope isotope, int countMin, int countMax) {
if (isotope == null)
throw new IllegalArgumentException("Isotope must not be null");
boolean flag = false;
for (Iterator<IIsotope> it = isotopes().iterator(); it.hasNext();) {
IIsoto... | [
"public",
"void",
"addIsotope",
"(",
"IIsotope",
"isotope",
",",
"int",
"countMin",
",",
"int",
"countMax",
")",
"{",
"if",
"(",
"isotope",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Isotope must not be null\"",
")",
";",
"boolean",
... | Adds an Isotope to this MolecularFormulaExpand in a number of
maximum and minimum occurrences allowed.
@param isotope The isotope to be added to this MolecularFormulaExpand
@param countMax The maximal number of occurrences to add
@param countMin The minimal number of occurrences to add | [
"Adds",
"an",
"Isotope",
"to",
"this",
"MolecularFormulaExpand",
"in",
"a",
"number",
"of",
"maximum",
"and",
"minimum",
"occurrences",
"allowed",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaRange.java#L67-L86 |
114,235 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaRange.java | MolecularFormulaRange.isotopes | public Iterable<IIsotope> isotopes() {
return new Iterable<IIsotope>() {
@Override
public Iterator<IIsotope> iterator() {
return isotopesMax.keySet().iterator();
}
};
} | java | public Iterable<IIsotope> isotopes() {
return new Iterable<IIsotope>() {
@Override
public Iterator<IIsotope> iterator() {
return isotopesMax.keySet().iterator();
}
};
} | [
"public",
"Iterable",
"<",
"IIsotope",
">",
"isotopes",
"(",
")",
"{",
"return",
"new",
"Iterable",
"<",
"IIsotope",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Iterator",
"<",
"IIsotope",
">",
"iterator",
"(",
")",
"{",
"return",
"isotopesMax",
".",... | Returns an Iterator for looping over all isotopes in this MolecularFormulaExpand.
@return An Iterator with the isotopes in this MolecularFormulaExpand | [
"Returns",
"an",
"Iterator",
"for",
"looping",
"over",
"all",
"isotopes",
"in",
"this",
"MolecularFormulaExpand",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaRange.java#L162-L170 |
114,236 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaRange.java | MolecularFormulaRange.removeIsotope | public void removeIsotope(IIsotope isotope) {
isotopesMax.remove(getIsotope(isotope));
isotopesMin.remove(getIsotope(isotope));
} | java | public void removeIsotope(IIsotope isotope) {
isotopesMax.remove(getIsotope(isotope));
isotopesMin.remove(getIsotope(isotope));
} | [
"public",
"void",
"removeIsotope",
"(",
"IIsotope",
"isotope",
")",
"{",
"isotopesMax",
".",
"remove",
"(",
"getIsotope",
"(",
"isotope",
")",
")",
";",
"isotopesMin",
".",
"remove",
"(",
"getIsotope",
"(",
"isotope",
")",
")",
";",
"}"
] | Removes the given isotope from the MolecularFormulaExpand.
@param isotope The IIsotope to be removed | [
"Removes",
"the",
"given",
"isotope",
"from",
"the",
"MolecularFormulaExpand",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/MolecularFormulaRange.java#L185-L188 |
114,237 | cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/MDLRXNReader.java | MDLRXNReader.readChemFile | private IChemFile readChemFile(IChemFile chemFile) throws CDKException {
IChemSequence chemSequence = chemFile.getBuilder().newInstance(IChemSequence.class);
IChemModel chemModel = chemFile.getBuilder().newInstance(IChemModel.class);
chemSequence.addChemModel(readChemModel(chemModel));
... | java | private IChemFile readChemFile(IChemFile chemFile) throws CDKException {
IChemSequence chemSequence = chemFile.getBuilder().newInstance(IChemSequence.class);
IChemModel chemModel = chemFile.getBuilder().newInstance(IChemModel.class);
chemSequence.addChemModel(readChemModel(chemModel));
... | [
"private",
"IChemFile",
"readChemFile",
"(",
"IChemFile",
"chemFile",
")",
"throws",
"CDKException",
"{",
"IChemSequence",
"chemSequence",
"=",
"chemFile",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IChemSequence",
".",
"class",
")",
";",
"IChemModel",... | Read a ChemFile from a file in MDL RDF format.
@param chemFile The IChemFile
@return The IChemFile that was read from the RDF file. | [
"Read",
"a",
"ChemFile",
"from",
"a",
"file",
"in",
"MDL",
"RDF",
"format",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLRXNReader.java#L183-L190 |
114,238 | cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/MDLRXNReader.java | MDLRXNReader.readChemModel | private IChemModel readChemModel(IChemModel chemModel) throws CDKException {
IReactionSet setOfReactions = chemModel.getReactionSet();
if (setOfReactions == null) {
setOfReactions = chemModel.getBuilder().newInstance(IReactionSet.class);
}
chemModel.setReactionSet(readReactio... | java | private IChemModel readChemModel(IChemModel chemModel) throws CDKException {
IReactionSet setOfReactions = chemModel.getReactionSet();
if (setOfReactions == null) {
setOfReactions = chemModel.getBuilder().newInstance(IReactionSet.class);
}
chemModel.setReactionSet(readReactio... | [
"private",
"IChemModel",
"readChemModel",
"(",
"IChemModel",
"chemModel",
")",
"throws",
"CDKException",
"{",
"IReactionSet",
"setOfReactions",
"=",
"chemModel",
".",
"getReactionSet",
"(",
")",
";",
"if",
"(",
"setOfReactions",
"==",
"null",
")",
"{",
"setOfReact... | Read a IChemModel from a file in MDL RDF format.
@param chemModel The IChemModel
@return The IChemModel that was read from the RDF file | [
"Read",
"a",
"IChemModel",
"from",
"a",
"file",
"in",
"MDL",
"RDF",
"format",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLRXNReader.java#L198-L205 |
114,239 | cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/MDLRXNReader.java | MDLRXNReader.readReactionSet | private IReactionSet readReactionSet(IReactionSet setOfReactions) throws CDKException {
IReaction r = readReaction(setOfReactions.getBuilder());
if (r != null) {
setOfReactions.addReaction(r);
}
try {
String line;
while ((line = input.readLine()) != ... | java | private IReactionSet readReactionSet(IReactionSet setOfReactions) throws CDKException {
IReaction r = readReaction(setOfReactions.getBuilder());
if (r != null) {
setOfReactions.addReaction(r);
}
try {
String line;
while ((line = input.readLine()) != ... | [
"private",
"IReactionSet",
"readReactionSet",
"(",
"IReactionSet",
"setOfReactions",
")",
"throws",
"CDKException",
"{",
"IReaction",
"r",
"=",
"readReaction",
"(",
"setOfReactions",
".",
"getBuilder",
"(",
")",
")",
";",
"if",
"(",
"r",
"!=",
"null",
")",
"{"... | Read a IReactionSet from a file in MDL RDF format.
@param setOfReactions The IReactionSet
@return The IReactionSet that was read from the RDF file | [
"Read",
"a",
"IReactionSet",
"from",
"a",
"file",
"in",
"MDL",
"RDF",
"format",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLRXNReader.java#L213-L283 |
114,240 | cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/CompatibilityMatrix.java | CompatibilityMatrix.markRow | void markRow(int i, int marking) {
for (int j = (i * mCols), end = j + mCols; j < end; j++)
if (data[j] > 0) data[j] = marking;
} | java | void markRow(int i, int marking) {
for (int j = (i * mCols), end = j + mCols; j < end; j++)
if (data[j] > 0) data[j] = marking;
} | [
"void",
"markRow",
"(",
"int",
"i",
",",
"int",
"marking",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"(",
"i",
"*",
"mCols",
")",
",",
"end",
"=",
"j",
"+",
"mCols",
";",
"j",
"<",
"end",
";",
"j",
"++",
")",
"if",
"(",
"data",
"[",
"j",
"]"... | Mark all values in row i allowing it to be reset later.
@param i row index
@param marking the marking to store (should be negative) | [
"Mark",
"all",
"values",
"in",
"row",
"i",
"allowing",
"it",
"to",
"be",
"reset",
"later",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/CompatibilityMatrix.java#L108-L111 |
114,241 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/Bond.java | Bond.setAtom | @Override
public void setAtom(IAtom atom, int position) {
if (atoms[position] == null && atom != null) atomCount++;
if (atoms[position] != null && atom == null) atomCount--;
atoms[position] = atom;
} | java | @Override
public void setAtom(IAtom atom, int position) {
if (atoms[position] == null && atom != null) atomCount++;
if (atoms[position] != null && atom == null) atomCount--;
atoms[position] = atom;
} | [
"@",
"Override",
"public",
"void",
"setAtom",
"(",
"IAtom",
"atom",
",",
"int",
"position",
")",
"{",
"if",
"(",
"atoms",
"[",
"position",
"]",
"==",
"null",
"&&",
"atom",
"!=",
"null",
")",
"atomCount",
"++",
";",
"if",
"(",
"atoms",
"[",
"position"... | Sets an Atom in this bond.
@param atom The atom to be set
@param position The position in this bond where the atom is to be inserted
@see #getAtom | [
"Sets",
"an",
"Atom",
"in",
"this",
"bond",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/Bond.java#L325-L330 |
114,242 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/Bond.java | Bond.setOrder | @Override
public void setOrder(Order order) {
this.order = order;
if (order != null) {
switch (order) {
case SINGLE:
this.electronCount = 2;
break;
case DOUBLE:
this.electronCount = 4;
... | java | @Override
public void setOrder(Order order) {
this.order = order;
if (order != null) {
switch (order) {
case SINGLE:
this.electronCount = 2;
break;
case DOUBLE:
this.electronCount = 4;
... | [
"@",
"Override",
"public",
"void",
"setOrder",
"(",
"Order",
"order",
")",
"{",
"this",
".",
"order",
"=",
"order",
";",
"if",
"(",
"order",
"!=",
"null",
")",
"{",
"switch",
"(",
"order",
")",
"{",
"case",
"SINGLE",
":",
"this",
".",
"electronCount"... | Sets the bond order of this bond.
@param order The bond order to be assigned to this bond
@see org.openscience.cdk.CDKConstants
org.openscience.cdk.CDKConstants for predefined values.
@see #getOrder | [
"Sets",
"the",
"bond",
"order",
"of",
"this",
"bond",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/Bond.java#L353-L381 |
114,243 | cdk/cdk | storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java | AminoAcids.aaBondInfo | public static int[][] aaBondInfo() {
if (aminoAcids == null) {
createAAs();
}
int[][] info = new int[153][4];
int counter = 0;
int total = 0;
for (int aa = 0; aa < aminoAcids.length; aa++) {
AminoAcid acid = aminoAcids[aa];
LOGGER.d... | java | public static int[][] aaBondInfo() {
if (aminoAcids == null) {
createAAs();
}
int[][] info = new int[153][4];
int counter = 0;
int total = 0;
for (int aa = 0; aa < aminoAcids.length; aa++) {
AminoAcid acid = aminoAcids[aa];
LOGGER.d... | [
"public",
"static",
"int",
"[",
"]",
"[",
"]",
"aaBondInfo",
"(",
")",
"{",
"if",
"(",
"aminoAcids",
"==",
"null",
")",
"{",
"createAAs",
"(",
")",
";",
"}",
"int",
"[",
"]",
"[",
"]",
"info",
"=",
"new",
"int",
"[",
"153",
"]",
"[",
"4",
"]"... | Creates matrix with info about the bonds in the amino acids.
0 = bond id, 1 = atom1 in bond, 2 = atom2 in bond, 3 = bond order.
@return info | [
"Creates",
"matrix",
"with",
"info",
"about",
"the",
"bonds",
"in",
"the",
"amino",
"acids",
".",
"0",
"=",
"bond",
"id",
"1",
"=",
"atom1",
"in",
"bond",
"2",
"=",
"atom2",
"in",
"bond",
"3",
"=",
"bond",
"order",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java#L61-L95 |
114,244 | cdk/cdk | storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java | AminoAcids.getHashMapBySingleCharCode | public static Map<String, IAminoAcid> getHashMapBySingleCharCode() {
IAminoAcid[] monomers = createAAs();
HashMap<String, IAminoAcid> map = new HashMap<String, IAminoAcid>();
for (int i = 0; i < monomers.length; i++) {
map.put((String) monomers[i].getProperty(RESIDUE_NAME_SHORT), mon... | java | public static Map<String, IAminoAcid> getHashMapBySingleCharCode() {
IAminoAcid[] monomers = createAAs();
HashMap<String, IAminoAcid> map = new HashMap<String, IAminoAcid>();
for (int i = 0; i < monomers.length; i++) {
map.put((String) monomers[i].getProperty(RESIDUE_NAME_SHORT), mon... | [
"public",
"static",
"Map",
"<",
"String",
",",
"IAminoAcid",
">",
"getHashMapBySingleCharCode",
"(",
")",
"{",
"IAminoAcid",
"[",
"]",
"monomers",
"=",
"createAAs",
"(",
")",
";",
"HashMap",
"<",
"String",
",",
"IAminoAcid",
">",
"map",
"=",
"new",
"HashMa... | Returns a HashMap where the key is one of G, A, V, L, I, S, T, C, M, D,
N, E, Q, R, K, H, F, Y, W and P. | [
"Returns",
"a",
"HashMap",
"where",
"the",
"key",
"is",
"one",
"of",
"G",
"A",
"V",
"L",
"I",
"S",
"T",
"C",
"M",
"D",
"N",
"E",
"Q",
"R",
"K",
"H",
"F",
"Y",
"W",
"and",
"P",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java#L192-L199 |
114,245 | cdk/cdk | storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java | AminoAcids.getHashMapByThreeLetterCode | public static Map<String, IAminoAcid> getHashMapByThreeLetterCode() {
AminoAcid[] monomers = createAAs();
Map<String, IAminoAcid> map = new HashMap<String, IAminoAcid>();
for (int i = 0; i < monomers.length; i++) {
map.put((String) monomers[i].getProperty(RESIDUE_NAME), monomers[i]);... | java | public static Map<String, IAminoAcid> getHashMapByThreeLetterCode() {
AminoAcid[] monomers = createAAs();
Map<String, IAminoAcid> map = new HashMap<String, IAminoAcid>();
for (int i = 0; i < monomers.length; i++) {
map.put((String) monomers[i].getProperty(RESIDUE_NAME), monomers[i]);... | [
"public",
"static",
"Map",
"<",
"String",
",",
"IAminoAcid",
">",
"getHashMapByThreeLetterCode",
"(",
")",
"{",
"AminoAcid",
"[",
"]",
"monomers",
"=",
"createAAs",
"(",
")",
";",
"Map",
"<",
"String",
",",
"IAminoAcid",
">",
"map",
"=",
"new",
"HashMap",
... | Returns a HashMap where the key is one of GLY, ALA, VAL, LEU, ILE, SER,
THR, CYS, MET, ASP, ASN, GLU, GLN, ARG, LYS, HIS, PHE, TYR, TRP AND PRO. | [
"Returns",
"a",
"HashMap",
"where",
"the",
"key",
"is",
"one",
"of",
"GLY",
"ALA",
"VAL",
"LEU",
"ILE",
"SER",
"THR",
"CYS",
"MET",
"ASP",
"ASN",
"GLU",
"GLN",
"ARG",
"LYS",
"HIS",
"PHE",
"TYR",
"TRP",
"AND",
"PRO",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java#L205-L212 |
114,246 | cdk/cdk | storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java | AminoAcids.convertThreeLetterCodeToOneLetterCode | public static String convertThreeLetterCodeToOneLetterCode(String threeLetterCode) {
AminoAcid[] monomers = createAAs();
for (int i = 0; i < monomers.length; i++) {
if (monomers[i].getProperty(RESIDUE_NAME).equals(threeLetterCode)) {
return (String) monomers[i].getProperty(RE... | java | public static String convertThreeLetterCodeToOneLetterCode(String threeLetterCode) {
AminoAcid[] monomers = createAAs();
for (int i = 0; i < monomers.length; i++) {
if (monomers[i].getProperty(RESIDUE_NAME).equals(threeLetterCode)) {
return (String) monomers[i].getProperty(RE... | [
"public",
"static",
"String",
"convertThreeLetterCodeToOneLetterCode",
"(",
"String",
"threeLetterCode",
")",
"{",
"AminoAcid",
"[",
"]",
"monomers",
"=",
"createAAs",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"monomers",
".",
"length",... | Returns the one letter code of an amino acid given a three letter code.
For example, it will return "V" when "Val" was passed. | [
"Returns",
"the",
"one",
"letter",
"code",
"of",
"an",
"amino",
"acid",
"given",
"a",
"three",
"letter",
"code",
".",
"For",
"example",
"it",
"will",
"return",
"V",
"when",
"Val",
"was",
"passed",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java#L218-L226 |
114,247 | cdk/cdk | storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java | AminoAcids.convertOneLetterCodeToThreeLetterCode | public static String convertOneLetterCodeToThreeLetterCode(String oneLetterCode) {
AminoAcid[] monomers = createAAs();
for (int i = 0; i < monomers.length; i++) {
if (monomers[i].getProperty(RESIDUE_NAME_SHORT).equals(oneLetterCode)) {
return (String) monomers[i].getProperty(... | java | public static String convertOneLetterCodeToThreeLetterCode(String oneLetterCode) {
AminoAcid[] monomers = createAAs();
for (int i = 0; i < monomers.length; i++) {
if (monomers[i].getProperty(RESIDUE_NAME_SHORT).equals(oneLetterCode)) {
return (String) monomers[i].getProperty(... | [
"public",
"static",
"String",
"convertOneLetterCodeToThreeLetterCode",
"(",
"String",
"oneLetterCode",
")",
"{",
"AminoAcid",
"[",
"]",
"monomers",
"=",
"createAAs",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"monomers",
".",
"length",
... | Returns the three letter code of an amino acid given a one letter code.
For example, it will return "Val" when "V" was passed. | [
"Returns",
"the",
"three",
"letter",
"code",
"of",
"an",
"amino",
"acid",
"given",
"a",
"one",
"letter",
"code",
".",
"For",
"example",
"it",
"will",
"return",
"Val",
"when",
"V",
"was",
"passed",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/pdb/src/main/java/org/openscience/cdk/templates/AminoAcids.java#L232-L240 |
114,248 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.rotate | public static void rotate(IAtomContainer atomCon, Point2d center, double angle) {
Point2d point;
double costheta = Math.cos(angle);
double sintheta = Math.sin(angle);
IAtom atom;
for (int i = 0; i < atomCon.getAtomCount(); i++) {
atom = atomCon.getAtom(i);
... | java | public static void rotate(IAtomContainer atomCon, Point2d center, double angle) {
Point2d point;
double costheta = Math.cos(angle);
double sintheta = Math.sin(angle);
IAtom atom;
for (int i = 0; i < atomCon.getAtomCount(); i++) {
atom = atomCon.getAtom(i);
... | [
"public",
"static",
"void",
"rotate",
"(",
"IAtomContainer",
"atomCon",
",",
"Point2d",
"center",
",",
"double",
"angle",
")",
"{",
"Point2d",
"point",
";",
"double",
"costheta",
"=",
"Math",
".",
"cos",
"(",
"angle",
")",
";",
"double",
"sintheta",
"=",
... | Rotates a molecule around a given center by a given angle.
@param atomCon The molecule to be rotated
@param center A point giving the rotation center
@param angle The angle by which to rotate the molecule, in radians | [
"Rotates",
"a",
"molecule",
"around",
"a",
"given",
"center",
"by",
"a",
"given",
"angle",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L215-L228 |
114,249 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.rotate | public static void rotate(IAtom atom, Point3d p1, Point3d p2, double angle) {
double costheta, sintheta;
Point3d r = new Point3d();
r.x = p2.x - p1.x;
r.y = p2.y - p1.y;
r.z = p2.z - p1.z;
normalize(r);
angle = angle * Math.PI / 180.0;
costheta = Math.c... | java | public static void rotate(IAtom atom, Point3d p1, Point3d p2, double angle) {
double costheta, sintheta;
Point3d r = new Point3d();
r.x = p2.x - p1.x;
r.y = p2.y - p1.y;
r.z = p2.z - p1.z;
normalize(r);
angle = angle * Math.PI / 180.0;
costheta = Math.c... | [
"public",
"static",
"void",
"rotate",
"(",
"IAtom",
"atom",
",",
"Point3d",
"p1",
",",
"Point3d",
"p2",
",",
"double",
"angle",
")",
"{",
"double",
"costheta",
",",
"sintheta",
";",
"Point3d",
"r",
"=",
"new",
"Point3d",
"(",
")",
";",
"r",
".",
"x",... | Rotates a 3D point about a specified line segment by a specified angle.
The code is based on code available <a href="http://astronomy.swin.edu.au/~pbourke/geometry/rotate/source.c">here</a>.
Positive angles are anticlockwise looking down the axis towards the origin.
Assume right hand coordinate system.
@param atom Th... | [
"Rotates",
"a",
"3D",
"point",
"about",
"a",
"specified",
"line",
"segment",
"by",
"a",
"specified",
"angle",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L242-L279 |
114,250 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.normalize | public static void normalize(Point3d point) {
double sum = Math.sqrt(point.x * point.x + point.y * point.y + point.z * point.z);
point.x = point.x / sum;
point.y = point.y / sum;
point.z = point.z / sum;
} | java | public static void normalize(Point3d point) {
double sum = Math.sqrt(point.x * point.x + point.y * point.y + point.z * point.z);
point.x = point.x / sum;
point.y = point.y / sum;
point.z = point.z / sum;
} | [
"public",
"static",
"void",
"normalize",
"(",
"Point3d",
"point",
")",
"{",
"double",
"sum",
"=",
"Math",
".",
"sqrt",
"(",
"point",
".",
"x",
"*",
"point",
".",
"x",
"+",
"point",
".",
"y",
"*",
"point",
".",
"y",
"+",
"point",
".",
"z",
"*",
... | Normalizes a point.
@param point The point to normalize | [
"Normalizes",
"a",
"point",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L286-L291 |
114,251 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.getRectangle2D | public static Rectangle2D getRectangle2D(IAtomContainer container) {
double[] minmax = getMinMax(container);
return new Rectangle2D.Double(minmax[0], minmax[1], minmax[2] - minmax[0], minmax[3] - minmax[1]);
} | java | public static Rectangle2D getRectangle2D(IAtomContainer container) {
double[] minmax = getMinMax(container);
return new Rectangle2D.Double(minmax[0], minmax[1], minmax[2] - minmax[0], minmax[3] - minmax[1]);
} | [
"public",
"static",
"Rectangle2D",
"getRectangle2D",
"(",
"IAtomContainer",
"container",
")",
"{",
"double",
"[",
"]",
"minmax",
"=",
"getMinMax",
"(",
"container",
")",
";",
"return",
"new",
"Rectangle2D",
".",
"Double",
"(",
"minmax",
"[",
"0",
"]",
",",
... | Returns the 2D rectangle spanning the space occupied by the atom
container.
@param container {@link IAtomContainer} to calculate the rectangle for
@return a {@link Rectangle2D} describing the space occupied | [
"Returns",
"the",
"2D",
"rectangle",
"spanning",
"the",
"space",
"occupied",
"by",
"the",
"atom",
"container",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L316-L319 |
114,252 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.getAngle | public static double getAngle(double xDiff, double yDiff) {
double angle = 0;
// logger.debug("getAngle->xDiff: " + xDiff);
// logger.debug("getAngle->yDiff: " + yDiff);
if (xDiff >= 0 && yDiff >= 0) {
angle = Math.atan(yDiff / xDiff);
} else if (xDiff < 0 && yDiff ... | java | public static double getAngle(double xDiff, double yDiff) {
double angle = 0;
// logger.debug("getAngle->xDiff: " + xDiff);
// logger.debug("getAngle->yDiff: " + yDiff);
if (xDiff >= 0 && yDiff >= 0) {
angle = Math.atan(yDiff / xDiff);
} else if (xDiff < 0 && yDiff ... | [
"public",
"static",
"double",
"getAngle",
"(",
"double",
"xDiff",
",",
"double",
"yDiff",
")",
"{",
"double",
"angle",
"=",
"0",
";",
"//\t\tlogger.debug(\"getAngle->xDiff: \" + xDiff);",
"//\t\tlogger.debug(\"getAngle->yDiff: \" + yDiff);",
"if",
"(",
"xDiff",
">=",
"0... | Gets the angle attribute of the GeometryTools class.
@param xDiff Description of the Parameter
@param yDiff Description of the Parameter
@return The angle value | [
"Gets",
"the",
"angle",
"attribute",
"of",
"the",
"GeometryTools",
"class",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L584-L598 |
114,253 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.calculatePerpendicularUnitVector | public static Vector2d calculatePerpendicularUnitVector(Point2d point1, Point2d point2) {
Vector2d vector = new Vector2d();
vector.sub(point2, point1);
vector.normalize();
// Return the perpendicular vector
return new Vector2d(-1.0 * vector.y, vector.x);
} | java | public static Vector2d calculatePerpendicularUnitVector(Point2d point1, Point2d point2) {
Vector2d vector = new Vector2d();
vector.sub(point2, point1);
vector.normalize();
// Return the perpendicular vector
return new Vector2d(-1.0 * vector.y, vector.x);
} | [
"public",
"static",
"Vector2d",
"calculatePerpendicularUnitVector",
"(",
"Point2d",
"point1",
",",
"Point2d",
"point2",
")",
"{",
"Vector2d",
"vector",
"=",
"new",
"Vector2d",
"(",
")",
";",
"vector",
".",
"sub",
"(",
"point2",
",",
"point1",
")",
";",
"vect... | Determines the normalized vector orthogonal on the vector p1->p2.
@param point1 Description of the Parameter
@param point2 Description of the Parameter
@return Description of the Return Value | [
"Determines",
"the",
"normalized",
"vector",
"orthogonal",
"on",
"the",
"vector",
"p1",
"-",
">",
";",
"p2",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L1145-L1152 |
114,254 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.findClosestInSpace | public static List<IAtom> findClosestInSpace(IAtomContainer container, IAtom startAtom, int max)
throws CDKException {
Point3d originalPoint = startAtom.getPoint3d();
if (originalPoint == null) {
throw new CDKException("No point3d, but findClosestInSpace is working on point3ds");... | java | public static List<IAtom> findClosestInSpace(IAtomContainer container, IAtom startAtom, int max)
throws CDKException {
Point3d originalPoint = startAtom.getPoint3d();
if (originalPoint == null) {
throw new CDKException("No point3d, but findClosestInSpace is working on point3ds");... | [
"public",
"static",
"List",
"<",
"IAtom",
">",
"findClosestInSpace",
"(",
"IAtomContainer",
"container",
",",
"IAtom",
"startAtom",
",",
"int",
"max",
")",
"throws",
"CDKException",
"{",
"Point3d",
"originalPoint",
"=",
"startAtom",
".",
"getPoint3d",
"(",
")",
... | Returns the atoms which are closes to an atom in an AtomContainer by
distance in 3d.
@param container The AtomContainer to examine
@param startAtom the atom to start from
@param max the number of neighbours to return
@return the average bond length
@exception CDKExce... | [
"Returns",
"the",
"atoms",
"which",
"are",
"closes",
"to",
"an",
"atom",
"in",
"an",
"AtomContainer",
"by",
"distance",
"in",
"3d",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L1248-L1274 |
114,255 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.getAllAtomRMSD | public static double getAllAtomRMSD(IAtomContainer firstAtomContainer, IAtomContainer secondAtomContainer,
Map<Integer, Integer> mappedAtoms, boolean Coords3d) throws CDKException {
//logger.debug("**** GT getAllAtomRMSD ****");
double sum = 0;
double RMSD;
Iterator<Integer> ... | java | public static double getAllAtomRMSD(IAtomContainer firstAtomContainer, IAtomContainer secondAtomContainer,
Map<Integer, Integer> mappedAtoms, boolean Coords3d) throws CDKException {
//logger.debug("**** GT getAllAtomRMSD ****");
double sum = 0;
double RMSD;
Iterator<Integer> ... | [
"public",
"static",
"double",
"getAllAtomRMSD",
"(",
"IAtomContainer",
"firstAtomContainer",
",",
"IAtomContainer",
"secondAtomContainer",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"mappedAtoms",
",",
"boolean",
"Coords3d",
")",
"throws",
"CDKException",
"{",
... | Return the RMSD 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 ... | [
"Return",
"the",
"RMSD",
"between",
"the",
"2",
"aligned",
"molecules",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L1517-L1550 |
114,256 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.getHeavyAtomRMSD | public static double getHeavyAtomRMSD(IAtomContainer firstAtomContainer, IAtomContainer secondAtomContainer,
Map<Integer, Integer> mappedAtoms, boolean hetAtomOnly, boolean Coords3d) {
//logger.debug("**** GT getAllAtomRMSD ****");
double sum = 0;
double RMSD = 0;
Iterator<In... | java | public static double getHeavyAtomRMSD(IAtomContainer firstAtomContainer, IAtomContainer secondAtomContainer,
Map<Integer, Integer> mappedAtoms, boolean hetAtomOnly, boolean Coords3d) {
//logger.debug("**** GT getAllAtomRMSD ****");
double sum = 0;
double RMSD = 0;
Iterator<In... | [
"public",
"static",
"double",
"getHeavyAtomRMSD",
"(",
"IAtomContainer",
"firstAtomContainer",
",",
"IAtomContainer",
"secondAtomContainer",
",",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"mappedAtoms",
",",
"boolean",
"hetAtomOnly",
",",
"boolean",
"Coords3d",
")",... | Return the RMSD of the heavy atoms 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
@pa... | [
"Return",
"the",
"RMSD",
"of",
"the",
"heavy",
"atoms",
"between",
"the",
"2",
"aligned",
"molecules",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L1563-L1613 |
114,257 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.getBondLengthAverage3D | public static double getBondLengthAverage3D(IAtomContainer container) {
double bondLengthSum = 0;
int bondCounter = 0;
for (IBond bond : container.bonds()) {
IAtom atom1 = bond.getBegin();
IAtom atom2 = bond.getEnd();
if (atom1.getPoint3d() != null && atom2.ge... | java | public static double getBondLengthAverage3D(IAtomContainer container) {
double bondLengthSum = 0;
int bondCounter = 0;
for (IBond bond : container.bonds()) {
IAtom atom1 = bond.getBegin();
IAtom atom2 = bond.getEnd();
if (atom1.getPoint3d() != null && atom2.ge... | [
"public",
"static",
"double",
"getBondLengthAverage3D",
"(",
"IAtomContainer",
"container",
")",
"{",
"double",
"bondLengthSum",
"=",
"0",
";",
"int",
"bondCounter",
"=",
"0",
";",
"for",
"(",
"IBond",
"bond",
":",
"container",
".",
"bonds",
"(",
")",
")",
... | An average of all 3D bond length values is produced, using point3ds in atoms.
Atom's with no coordinates are disregarded.
@param container The AtomContainer for which the average bond length is to be
calculated
@return the average bond length | [
"An",
"average",
"of",
"all",
"3D",
"bond",
"length",
"values",
"is",
"produced",
"using",
"point3ds",
"in",
"atoms",
".",
"Atom",
"s",
"with",
"no",
"coordinates",
"are",
"disregarded",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L1623-L1635 |
114,258 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.shiftContainer | public static Rectangle2D shiftContainer(IAtomContainer container, Rectangle2D bounds, Rectangle2D last, double gap) {
// determine if the containers are overlapping
if (last.getMaxX() + gap >= bounds.getMinX()) {
double xShift = last.getMaxX() + gap - bounds.getMinX();
Vector2d ... | java | public static Rectangle2D shiftContainer(IAtomContainer container, Rectangle2D bounds, Rectangle2D last, double gap) {
// determine if the containers are overlapping
if (last.getMaxX() + gap >= bounds.getMinX()) {
double xShift = last.getMaxX() + gap - bounds.getMinX();
Vector2d ... | [
"public",
"static",
"Rectangle2D",
"shiftContainer",
"(",
"IAtomContainer",
"container",
",",
"Rectangle2D",
"bounds",
",",
"Rectangle2D",
"last",
",",
"double",
"gap",
")",
"{",
"// determine if the containers are overlapping",
"if",
"(",
"last",
".",
"getMaxX",
"(",... | Shift the container horizontally to the right to make its bounds not
overlap with the other bounds.
@param container the {@link IAtomContainer} to shift to the right
@param bounds the {@link Rectangle2D} of the {@link IAtomContainer}
to shift
@param last the bounds that is used as reference
@param gap th... | [
"Shift",
"the",
"container",
"horizontally",
"to",
"the",
"right",
"to",
"make",
"its",
"bounds",
"not",
"overlap",
"with",
"the",
"other",
"bounds",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L1649-L1660 |
114,259 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.shiftReactionVertical | public static Rectangle2D shiftReactionVertical(IReaction reaction, Rectangle2D bounds, Rectangle2D last, double gap) {
// determine if the reactions are overlapping
if (last.getMaxY() + gap >= bounds.getMinY()) {
double yShift = bounds.getHeight() + last.getHeight() + gap;
Vecto... | java | public static Rectangle2D shiftReactionVertical(IReaction reaction, Rectangle2D bounds, Rectangle2D last, double gap) {
// determine if the reactions are overlapping
if (last.getMaxY() + gap >= bounds.getMinY()) {
double yShift = bounds.getHeight() + last.getHeight() + gap;
Vecto... | [
"public",
"static",
"Rectangle2D",
"shiftReactionVertical",
"(",
"IReaction",
"reaction",
",",
"Rectangle2D",
"bounds",
",",
"Rectangle2D",
"last",
",",
"double",
"gap",
")",
"{",
"// determine if the reactions are overlapping",
"if",
"(",
"last",
".",
"getMaxY",
"(",... | Shift the containers in a reaction vertically upwards to not overlap
with the reference Rectangle2D. The shift is such that the given
gap is realized, but only if the reactions are actually overlapping.
@param reaction the reaction to shift
@param bounds the bounds of the reaction to shift
@param last the bounds... | [
"Shift",
"the",
"containers",
"in",
"a",
"reaction",
"vertically",
"upwards",
"to",
"not",
"overlap",
"with",
"the",
"reference",
"Rectangle2D",
".",
"The",
"shift",
"is",
"such",
"that",
"the",
"given",
"gap",
"is",
"realized",
"but",
"only",
"if",
"the",
... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L1709-L1723 |
114,260 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/qsar/DescriptorValue.java | DescriptorValue.getNames | public String[] getNames() {
if (descriptorNames == null || descriptorNames.length == 0) {
String title = specification.getImplementationTitle();
if (value instanceof BooleanResult || value instanceof DoubleResult || value instanceof IntegerResult) {
descriptorNames = new... | java | public String[] getNames() {
if (descriptorNames == null || descriptorNames.length == 0) {
String title = specification.getImplementationTitle();
if (value instanceof BooleanResult || value instanceof DoubleResult || value instanceof IntegerResult) {
descriptorNames = new... | [
"public",
"String",
"[",
"]",
"getNames",
"(",
")",
"{",
"if",
"(",
"descriptorNames",
"==",
"null",
"||",
"descriptorNames",
".",
"length",
"==",
"0",
")",
"{",
"String",
"title",
"=",
"specification",
".",
"getImplementationTitle",
"(",
")",
";",
"if",
... | Returns an array of names for each descriptor value calculated.
Many descriptors return multiple values. In general it is useful for the
descriptor to indicate the names for each value. When a descriptor creates
a <code>DescriptorValue</code> object, it should supply an array of names equal
in length to the number of ... | [
"Returns",
"an",
"array",
"of",
"names",
"for",
"each",
"descriptor",
"value",
"calculated",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/qsar/DescriptorValue.java#L129-L148 |
114,261 | cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java | Expr.and | public Expr and(Expr expr) {
if (type == Type.TRUE) {
set(expr);
} else if (expr.type != Type.TRUE) {
if (type.isLogical() && !expr.type.isLogical()) {
if (type == AND)
right.and(expr);
else if (type != NOT)
... | java | public Expr and(Expr expr) {
if (type == Type.TRUE) {
set(expr);
} else if (expr.type != Type.TRUE) {
if (type.isLogical() && !expr.type.isLogical()) {
if (type == AND)
right.and(expr);
else if (type != NOT)
... | [
"public",
"Expr",
"and",
"(",
"Expr",
"expr",
")",
"{",
"if",
"(",
"type",
"==",
"Type",
".",
"TRUE",
")",
"{",
"set",
"(",
"expr",
")",
";",
"}",
"else",
"if",
"(",
"expr",
".",
"type",
"!=",
"Type",
".",
"TRUE",
")",
"{",
"if",
"(",
"type",... | Utility, combine this expression with another, using conjunction.
The expression will only match if both conditions are met.
@param expr the other expression
@return self for chaining | [
"Utility",
"combine",
"this",
"expression",
"with",
"another",
"using",
"conjunction",
".",
"The",
"expression",
"will",
"only",
"match",
"if",
"both",
"conditions",
"are",
"met",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java#L458-L474 |
114,262 | cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java | Expr.or | public Expr or(Expr expr) {
if (type == Type.TRUE ||
type == Type.FALSE ||
type == NONE) {
set(expr);
} else if (expr.type != Type.TRUE &&
expr.type != Type.FALSE &&
expr.type != Type.NONE) {
if (type.isLogical() && !e... | java | public Expr or(Expr expr) {
if (type == Type.TRUE ||
type == Type.FALSE ||
type == NONE) {
set(expr);
} else if (expr.type != Type.TRUE &&
expr.type != Type.FALSE &&
expr.type != Type.NONE) {
if (type.isLogical() && !e... | [
"public",
"Expr",
"or",
"(",
"Expr",
"expr",
")",
"{",
"if",
"(",
"type",
"==",
"Type",
".",
"TRUE",
"||",
"type",
"==",
"Type",
".",
"FALSE",
"||",
"type",
"==",
"NONE",
")",
"{",
"set",
"(",
"expr",
")",
";",
"}",
"else",
"if",
"(",
"expr",
... | Utility, combine this expression with another, using disjunction.
The expression will match if either conditions is met.
@param expr the other expression
@return self for chaining | [
"Utility",
"combine",
"this",
"expression",
"with",
"another",
"using",
"disjunction",
".",
"The",
"expression",
"will",
"match",
"if",
"either",
"conditions",
"is",
"met",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java#L482-L502 |
114,263 | cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java | Expr.setPrimitive | public void setPrimitive(Type type, int val) {
if (type.hasValue()) {
this.type = type;
this.value = val;
this.left = null;
this.right = null;
this.query = null;
} else {
throw new IllegalArgumentException("Value provided for non-va... | java | public void setPrimitive(Type type, int val) {
if (type.hasValue()) {
this.type = type;
this.value = val;
this.left = null;
this.right = null;
this.query = null;
} else {
throw new IllegalArgumentException("Value provided for non-va... | [
"public",
"void",
"setPrimitive",
"(",
"Type",
"type",
",",
"int",
"val",
")",
"{",
"if",
"(",
"type",
".",
"hasValue",
"(",
")",
")",
"{",
"this",
".",
"type",
"=",
"type",
";",
"this",
".",
"value",
"=",
"val",
";",
"this",
".",
"left",
"=",
... | Set the primitive value of this atom expression.
@param type the type of expression
@param val the value to check | [
"Set",
"the",
"primitive",
"value",
"of",
"this",
"atom",
"expression",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java#L558-L569 |
114,264 | cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java | Expr.setLogical | public void setLogical(Type type, Expr left, Expr right) {
switch (type) {
case AND:
case OR:
this.type = type;
this.value = 0;
this.left = left;
this.right = right;
this.query = null;
break;
... | java | public void setLogical(Type type, Expr left, Expr right) {
switch (type) {
case AND:
case OR:
this.type = type;
this.value = 0;
this.left = left;
this.right = right;
this.query = null;
break;
... | [
"public",
"void",
"setLogical",
"(",
"Type",
"type",
",",
"Expr",
"left",
",",
"Expr",
"right",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"AND",
":",
"case",
"OR",
":",
"this",
".",
"type",
"=",
"type",
";",
"this",
".",
"value",
"=",
"0... | Set the logical value of this atom expression.
@param type the type of expression
@param left the left sub-expression
@param right the right sub-expression | [
"Set",
"the",
"logical",
"value",
"of",
"this",
"atom",
"expression",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java#L595-L623 |
114,265 | cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java | Expr.setRecursive | private void setRecursive(Type type, IAtomContainer mol) {
switch (type) {
case RECURSIVE:
this.type = type;
this.value = 0;
this.left = null;
this.right = null;
this.query = mol;
this.ptrn = null;
... | java | private void setRecursive(Type type, IAtomContainer mol) {
switch (type) {
case RECURSIVE:
this.type = type;
this.value = 0;
this.left = null;
this.right = null;
this.query = mol;
this.ptrn = null;
... | [
"private",
"void",
"setRecursive",
"(",
"Type",
"type",
",",
"IAtomContainer",
"mol",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"RECURSIVE",
":",
"this",
".",
"type",
"=",
"type",
";",
"this",
".",
"value",
"=",
"0",
";",
"this",
".",
"left"... | Set the recursive value of this atom expression.
@param type the type of expression
@param mol the recursive pattern | [
"Set",
"the",
"recursive",
"value",
"of",
"this",
"atom",
"expression",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/matchers/Expr.java#L631-L644 |
114,266 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java | ReactionSetManipulator.getAllMolecules | public static IAtomContainerSet getAllMolecules(IReactionSet set) {
IAtomContainerSet moleculeSet = set.getBuilder().newInstance(IAtomContainerSet.class);
for (IReaction reaction : set.reactions()) {
IAtomContainerSet molecules = ReactionManipulator.getAllMolecules(reaction);
for... | java | public static IAtomContainerSet getAllMolecules(IReactionSet set) {
IAtomContainerSet moleculeSet = set.getBuilder().newInstance(IAtomContainerSet.class);
for (IReaction reaction : set.reactions()) {
IAtomContainerSet molecules = ReactionManipulator.getAllMolecules(reaction);
for... | [
"public",
"static",
"IAtomContainerSet",
"getAllMolecules",
"(",
"IReactionSet",
"set",
")",
"{",
"IAtomContainerSet",
"moleculeSet",
"=",
"set",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IAtomContainerSet",
".",
"class",
")",
";",
"for",
"(",
"IRea... | get all Molecules object from a set of Reactions.
@param set The set of reaction to inspect
@return The IAtomContanerSet | [
"get",
"all",
"Molecules",
"object",
"from",
"a",
"set",
"of",
"Reactions",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java#L79-L96 |
114,267 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java | ReactionSetManipulator.getRelevantReactions | public static IReactionSet getRelevantReactions(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
IReactionSet reactSetProd = getRelevantReactionsAsProduct(reactSet, molecule);
for (IReaction reaction : reactSetPro... | java | public static IReactionSet getRelevantReactions(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
IReactionSet reactSetProd = getRelevantReactionsAsProduct(reactSet, molecule);
for (IReaction reaction : reactSetPro... | [
"public",
"static",
"IReactionSet",
"getRelevantReactions",
"(",
"IReactionSet",
"reactSet",
",",
"IAtomContainer",
"molecule",
")",
"{",
"IReactionSet",
"newReactSet",
"=",
"reactSet",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IReactionSet",
".",
"clas... | Get all Reactions object containing a Molecule from a set of Reactions.
@param reactSet The set of reaction to inspect
@param molecule The molecule to find
@return The IReactionSet | [
"Get",
"all",
"Reactions",
"object",
"containing",
"a",
"Molecule",
"from",
"a",
"set",
"of",
"Reactions",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java#L144-L153 |
114,268 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java | ReactionSetManipulator.getRelevantReactionsAsReactant | public static IReactionSet getRelevantReactionsAsReactant(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
for (IReaction reaction : reactSet.reactions()) {
for (IAtomContainer atomContainer : reaction.getReac... | java | public static IReactionSet getRelevantReactionsAsReactant(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
for (IReaction reaction : reactSet.reactions()) {
for (IAtomContainer atomContainer : reaction.getReac... | [
"public",
"static",
"IReactionSet",
"getRelevantReactionsAsReactant",
"(",
"IReactionSet",
"reactSet",
",",
"IAtomContainer",
"molecule",
")",
"{",
"IReactionSet",
"newReactSet",
"=",
"reactSet",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IReactionSet",
".... | Get all Reactions object containing a Molecule as a Reactant from a set
of Reactions.
@param reactSet The set of reaction to inspect
@param molecule The molecule to find as a reactant
@return The IReactionSet | [
"Get",
"all",
"Reactions",
"object",
"containing",
"a",
"Molecule",
"as",
"a",
"Reactant",
"from",
"a",
"set",
"of",
"Reactions",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java#L163-L170 |
114,269 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java | ReactionSetManipulator.getRelevantReactionsAsProduct | public static IReactionSet getRelevantReactionsAsProduct(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
for (IReaction reaction : reactSet.reactions()) {
for (IAtomContainer atomContainer : reaction.getProdu... | java | public static IReactionSet getRelevantReactionsAsProduct(IReactionSet reactSet, IAtomContainer molecule) {
IReactionSet newReactSet = reactSet.getBuilder().newInstance(IReactionSet.class);
for (IReaction reaction : reactSet.reactions()) {
for (IAtomContainer atomContainer : reaction.getProdu... | [
"public",
"static",
"IReactionSet",
"getRelevantReactionsAsProduct",
"(",
"IReactionSet",
"reactSet",
",",
"IAtomContainer",
"molecule",
")",
"{",
"IReactionSet",
"newReactSet",
"=",
"reactSet",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IReactionSet",
"."... | Get all Reactions object containing a Molecule as a Product from a set of
Reactions.
@param reactSet The set of reaction to inspect
@param molecule The molecule to find as a product
@return The IReactionSet | [
"Get",
"all",
"Reactions",
"object",
"containing",
"a",
"Molecule",
"as",
"a",
"Product",
"from",
"a",
"set",
"of",
"Reactions",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java#L180-L187 |
114,270 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java | ReactionSetManipulator.getReactionByAtomContainerID | public static IReaction getReactionByAtomContainerID(IReactionSet reactionSet, String id) {
for (IReaction reaction : reactionSet.reactions()) {
if (AtomContainerSetManipulator.containsByID(reaction.getProducts(), id)) return reaction;
}
for (IReaction reaction : reactionSet.reaction... | java | public static IReaction getReactionByAtomContainerID(IReactionSet reactionSet, String id) {
for (IReaction reaction : reactionSet.reactions()) {
if (AtomContainerSetManipulator.containsByID(reaction.getProducts(), id)) return reaction;
}
for (IReaction reaction : reactionSet.reaction... | [
"public",
"static",
"IReaction",
"getReactionByAtomContainerID",
"(",
"IReactionSet",
"reactionSet",
",",
"String",
"id",
")",
"{",
"for",
"(",
"IReaction",
"reaction",
":",
"reactionSet",
".",
"reactions",
"(",
")",
")",
"{",
"if",
"(",
"AtomContainerSetManipulat... | Gets a reaction from a ReactionSet by ID of any product or reactant. If several exist,
only the first one will be returned.
@param reactionSet The reactionSet to search in
@param id The id to search for.
@return The Reaction or null; | [
"Gets",
"a",
"reaction",
"from",
"a",
"ReactionSet",
"by",
"ID",
"of",
"any",
"product",
"or",
"reactant",
".",
"If",
"several",
"exist",
"only",
"the",
"first",
"one",
"will",
"be",
"returned",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java#L232-L240 |
114,271 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java | ReactionSetManipulator.getReactionByReactionID | public static IReaction getReactionByReactionID(IReactionSet reactionSet, String id) {
Iterable<IReaction> reactionIter = reactionSet.reactions();
for (IReaction reaction : reactionIter) {
if (reaction.getID() != null && reaction.getID().equals(id)) {
return reaction;
... | java | public static IReaction getReactionByReactionID(IReactionSet reactionSet, String id) {
Iterable<IReaction> reactionIter = reactionSet.reactions();
for (IReaction reaction : reactionIter) {
if (reaction.getID() != null && reaction.getID().equals(id)) {
return reaction;
... | [
"public",
"static",
"IReaction",
"getReactionByReactionID",
"(",
"IReactionSet",
"reactionSet",
",",
"String",
"id",
")",
"{",
"Iterable",
"<",
"IReaction",
">",
"reactionIter",
"=",
"reactionSet",
".",
"reactions",
"(",
")",
";",
"for",
"(",
"IReaction",
"react... | Gets a reaction from a ReactionSet by ID. If several exist,
only the first one will be returned.
@param reactionSet The reactionSet to search in
@param id The id to search for.
@return The Reaction or null; | [
"Gets",
"a",
"reaction",
"from",
"a",
"ReactionSet",
"by",
"ID",
".",
"If",
"several",
"exist",
"only",
"the",
"first",
"one",
"will",
"be",
"returned",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSetManipulator.java#L250-L258 |
114,272 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemSequenceManipulator.java | ChemSequenceManipulator.getAtomCount | public static int getAtomCount(IChemSequence sequence) {
int count = 0;
for (int i = 0; i < sequence.getChemModelCount(); i++) {
count += ChemModelManipulator.getAtomCount(sequence.getChemModel(i));
}
return count;
} | java | public static int getAtomCount(IChemSequence sequence) {
int count = 0;
for (int i = 0; i < sequence.getChemModelCount(); i++) {
count += ChemModelManipulator.getAtomCount(sequence.getChemModel(i));
}
return count;
} | [
"public",
"static",
"int",
"getAtomCount",
"(",
"IChemSequence",
"sequence",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sequence",
".",
"getChemModelCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"count",
... | Get the total number of atoms inside an IChemSequence.
@param sequence The IChemSequence object.
@return The number of Atom objects inside. | [
"Get",
"the",
"total",
"number",
"of",
"atoms",
"inside",
"an",
"IChemSequence",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemSequenceManipulator.java#L50-L56 |
114,273 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemSequenceManipulator.java | ChemSequenceManipulator.getBondCount | public static int getBondCount(IChemSequence sequence) {
int count = 0;
for (int i = 0; i < sequence.getChemModelCount(); i++) {
count += ChemModelManipulator.getBondCount(sequence.getChemModel(i));
}
return count;
} | java | public static int getBondCount(IChemSequence sequence) {
int count = 0;
for (int i = 0; i < sequence.getChemModelCount(); i++) {
count += ChemModelManipulator.getBondCount(sequence.getChemModel(i));
}
return count;
} | [
"public",
"static",
"int",
"getBondCount",
"(",
"IChemSequence",
"sequence",
")",
"{",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sequence",
".",
"getChemModelCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"count",
... | Get the total number of bonds inside an IChemSequence.
@param sequence The IChemSequence object.
@return The number of Bond objects inside. | [
"Get",
"the",
"total",
"number",
"of",
"bonds",
"inside",
"an",
"IChemSequence",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemSequenceManipulator.java#L64-L70 |
114,274 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemSequenceManipulator.java | ChemSequenceManipulator.getAllAtomContainers | public static List<IAtomContainer> getAllAtomContainers(IChemSequence sequence) {
List<IAtomContainer> acList = new ArrayList<IAtomContainer>();
for (IChemModel model : sequence.chemModels()) {
acList.addAll(ChemModelManipulator.getAllAtomContainers(model));
}
return acList;
... | java | public static List<IAtomContainer> getAllAtomContainers(IChemSequence sequence) {
List<IAtomContainer> acList = new ArrayList<IAtomContainer>();
for (IChemModel model : sequence.chemModels()) {
acList.addAll(ChemModelManipulator.getAllAtomContainers(model));
}
return acList;
... | [
"public",
"static",
"List",
"<",
"IAtomContainer",
">",
"getAllAtomContainers",
"(",
"IChemSequence",
"sequence",
")",
"{",
"List",
"<",
"IAtomContainer",
">",
"acList",
"=",
"new",
"ArrayList",
"<",
"IAtomContainer",
">",
"(",
")",
";",
"for",
"(",
"IChemMode... | Returns all the AtomContainer's of a ChemSequence. | [
"Returns",
"all",
"the",
"AtomContainer",
"s",
"of",
"a",
"ChemSequence",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemSequenceManipulator.java#L75-L81 |
114,275 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemSequenceManipulator.java | ChemSequenceManipulator.getAllChemObjects | public static List<IChemObject> getAllChemObjects(IChemSequence sequence) {
List<IChemObject> list = new ArrayList<IChemObject>();
// list.add(sequence);
for (int i = 0; i < sequence.getChemModelCount(); i++) {
list.add(sequence.getChemModel(i));
List<IChemObject> current... | java | public static List<IChemObject> getAllChemObjects(IChemSequence sequence) {
List<IChemObject> list = new ArrayList<IChemObject>();
// list.add(sequence);
for (int i = 0; i < sequence.getChemModelCount(); i++) {
list.add(sequence.getChemModel(i));
List<IChemObject> current... | [
"public",
"static",
"List",
"<",
"IChemObject",
">",
"getAllChemObjects",
"(",
"IChemSequence",
"sequence",
")",
"{",
"List",
"<",
"IChemObject",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"IChemObject",
">",
"(",
")",
";",
"// list.add(sequence);",
"for",
"("... | Returns a List of all IChemObject inside a ChemSequence.
@return A List of all ChemObjects. | [
"Returns",
"a",
"List",
"of",
"all",
"IChemObject",
"inside",
"a",
"ChemSequence",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemSequenceManipulator.java#L88-L100 |
114,276 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java | RingSet.getRings | @Override
public IRingSet getRings(IBond bond) {
IRingSet rings = bond.getBuilder().newInstance(IRingSet.class);
Ring ring;
for (int i = 0; i < getAtomContainerCount(); i++) {
ring = (Ring) getAtomContainer(i);
if (ring.contains(bond)) {
rings.addAtomC... | java | @Override
public IRingSet getRings(IBond bond) {
IRingSet rings = bond.getBuilder().newInstance(IRingSet.class);
Ring ring;
for (int i = 0; i < getAtomContainerCount(); i++) {
ring = (Ring) getAtomContainer(i);
if (ring.contains(bond)) {
rings.addAtomC... | [
"@",
"Override",
"public",
"IRingSet",
"getRings",
"(",
"IBond",
"bond",
")",
"{",
"IRingSet",
"rings",
"=",
"bond",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IRingSet",
".",
"class",
")",
";",
"Ring",
"ring",
";",
"for",
"(",
"int",
"i",
... | Returns a vector of all rings that this bond is part of.
@param bond The bond to be checked
@return A vector of all rings that this bond is part of | [
"Returns",
"a",
"vector",
"of",
"all",
"rings",
"that",
"this",
"bond",
"is",
"part",
"of",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java#L62-L73 |
114,277 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java | RingSet.getRings | @Override
public IRingSet getRings(IAtom atom) {
IRingSet rings = new RingSet();
IRing ring;
for (int i = 0; i < getAtomContainerCount(); i++) {
ring = (Ring) getAtomContainer(i);
if (ring.contains(atom)) {
rings.addAtomContainer(ring);
}
... | java | @Override
public IRingSet getRings(IAtom atom) {
IRingSet rings = new RingSet();
IRing ring;
for (int i = 0; i < getAtomContainerCount(); i++) {
ring = (Ring) getAtomContainer(i);
if (ring.contains(atom)) {
rings.addAtomContainer(ring);
}
... | [
"@",
"Override",
"public",
"IRingSet",
"getRings",
"(",
"IAtom",
"atom",
")",
"{",
"IRingSet",
"rings",
"=",
"new",
"RingSet",
"(",
")",
";",
"IRing",
"ring",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getAtomContainerCount",
"(",
")",
";... | Returns a vector of all rings that this atom is part of.
@param atom The atom to be checked
@return A vector of all rings that this bond is part of | [
"Returns",
"a",
"vector",
"of",
"all",
"rings",
"that",
"this",
"atom",
"is",
"part",
"of",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java#L82-L93 |
114,278 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java | RingSet.getConnectedRings | @Override
public IRingSet getConnectedRings(IRing ring) {
IRingSet connectedRings = ring.getBuilder().newInstance(IRingSet.class);
IRing tempRing;
IAtom atom;
for (int i = 0; i < ring.getAtomCount(); i++) {
atom = ring.getAtom(i);
for (int j = 0; j < getAtomCo... | java | @Override
public IRingSet getConnectedRings(IRing ring) {
IRingSet connectedRings = ring.getBuilder().newInstance(IRingSet.class);
IRing tempRing;
IAtom atom;
for (int i = 0; i < ring.getAtomCount(); i++) {
atom = ring.getAtom(i);
for (int j = 0; j < getAtomCo... | [
"@",
"Override",
"public",
"IRingSet",
"getConnectedRings",
"(",
"IRing",
"ring",
")",
"{",
"IRingSet",
"connectedRings",
"=",
"ring",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IRingSet",
".",
"class",
")",
";",
"IRing",
"tempRing",
";",
"IAtom"... | Returns all the rings in the RingSet that share
one or more atoms with a given ring.
@param ring A ring with which all return rings must share one or more atoms
@return All the rings that share one or more atoms with a given ring. | [
"Returns",
"all",
"the",
"rings",
"in",
"the",
"RingSet",
"that",
"share",
"one",
"or",
"more",
"atoms",
"with",
"a",
"given",
"ring",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java#L103-L118 |
114,279 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java | RingSet.add | @Override
public void add(IRingSet ringSet) {
for (int f = 0; f < ringSet.getAtomContainerCount(); f++) {
if (!contains(ringSet.getAtomContainer(f))) {
addAtomContainer(ringSet.getAtomContainer(f));
}
}
} | java | @Override
public void add(IRingSet ringSet) {
for (int f = 0; f < ringSet.getAtomContainerCount(); f++) {
if (!contains(ringSet.getAtomContainer(f))) {
addAtomContainer(ringSet.getAtomContainer(f));
}
}
} | [
"@",
"Override",
"public",
"void",
"add",
"(",
"IRingSet",
"ringSet",
")",
"{",
"for",
"(",
"int",
"f",
"=",
"0",
";",
"f",
"<",
"ringSet",
".",
"getAtomContainerCount",
"(",
")",
";",
"f",
"++",
")",
"{",
"if",
"(",
"!",
"contains",
"(",
"ringSet"... | Adds all rings of another RingSet if they are not already part of this ring set.
If you want to add a single ring to the set use {@link #addAtomContainer(org.openscience.cdk.interfaces.IAtomContainer)}
@param ringSet the ring set to be united with this one. | [
"Adds",
"all",
"rings",
"of",
"another",
"RingSet",
"if",
"they",
"are",
"not",
"already",
"part",
"of",
"this",
"ring",
"set",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java#L127-L134 |
114,280 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java | RingSet.contains | @Override
public boolean contains(IAtom atom) {
for (int i = 0; i < getAtomContainerCount(); i++) {
if (getAtomContainer(i).contains(atom)) {
return true;
}
}
return false;
} | java | @Override
public boolean contains(IAtom atom) {
for (int i = 0; i < getAtomContainerCount(); i++) {
if (getAtomContainer(i).contains(atom)) {
return true;
}
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"contains",
"(",
"IAtom",
"atom",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getAtomContainerCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"getAtomContainer",
"(",
"i",
")",
".",
"cont... | True, if at least one of the rings in the ringset contains
the given atom.
@param atom Atom to check
@return true, if the ringset contains the atom | [
"True",
"if",
"at",
"least",
"one",
"of",
"the",
"rings",
"in",
"the",
"ringset",
"contains",
"the",
"given",
"atom",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java#L143-L151 |
114,281 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java | RingSet.contains | @Override
public boolean contains(IAtomContainer ring) {
for (int i = 0; i < getAtomContainerCount(); i++) {
if (ring == getAtomContainer(i)) {
return true;
}
}
return false;
} | java | @Override
public boolean contains(IAtomContainer ring) {
for (int i = 0; i < getAtomContainerCount(); i++) {
if (ring == getAtomContainer(i)) {
return true;
}
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"contains",
"(",
"IAtomContainer",
"ring",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getAtomContainerCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"ring",
"==",
"getAtomContainer",
"(",
... | Checks for presence of a ring in this RingSet.
@param ring The ring to check
@return true if ring is part of RingSet | [
"Checks",
"for",
"presence",
"of",
"a",
"ring",
"in",
"this",
"RingSet",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/RingSet.java#L160-L168 |
114,282 | cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/UllmannState.java | UllmannState.verify | private boolean verify(int n, int m) {
for (int n_prime : g1[n]) {
boolean found = false;
for (int m_prime : g2[m]) {
if (matrix.get(n_prime, m_prime) && bondMatcher.matches(bond1.get(n, n_prime), bonds2.get(m, m_prime))) {
found = true;
... | java | private boolean verify(int n, int m) {
for (int n_prime : g1[n]) {
boolean found = false;
for (int m_prime : g2[m]) {
if (matrix.get(n_prime, m_prime) && bondMatcher.matches(bond1.get(n, n_prime), bonds2.get(m, m_prime))) {
found = true;
... | [
"private",
"boolean",
"verify",
"(",
"int",
"n",
",",
"int",
"m",
")",
"{",
"for",
"(",
"int",
"n_prime",
":",
"g1",
"[",
"n",
"]",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"for",
"(",
"int",
"m_prime",
":",
"g2",
"[",
"m",
"]",
")",
... | Verify that for every vertex adjacent to n, there should be at least one
feasible candidate adjacent which can be mapped. If no such candidate
exists the mapping of n -> m is not longer valid.
@param n query vertex
@param m target vertex
@return mapping is still valid | [
"Verify",
"that",
"for",
"every",
"vertex",
"adjacent",
"to",
"n",
"there",
"should",
"be",
"at",
"least",
"one",
"feasible",
"candidate",
"adjacent",
"which",
"can",
"be",
"mapped",
".",
"If",
"no",
"such",
"candidate",
"exists",
"the",
"mapping",
"of",
"... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/UllmannState.java#L205-L217 |
114,283 | cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/UllmannState.java | UllmannState.hasCandidate | private boolean hasCandidate(int n) {
for (int j = (n * matrix.mCols), end = (j + matrix.mCols); j < end; j++)
if (matrix.get(j)) return true;
return false;
} | java | private boolean hasCandidate(int n) {
for (int j = (n * matrix.mCols), end = (j + matrix.mCols); j < end; j++)
if (matrix.get(j)) return true;
return false;
} | [
"private",
"boolean",
"hasCandidate",
"(",
"int",
"n",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"(",
"n",
"*",
"matrix",
".",
"mCols",
")",
",",
"end",
"=",
"(",
"j",
"+",
"matrix",
".",
"mCols",
")",
";",
"j",
"<",
"end",
";",
"j",
"++",
")",
... | Check if there are any feasible mappings left for the query vertex n. We
scan the compatibility matrix to see if any value is > 0.
@param n query vertex
@return a candidate is present | [
"Check",
"if",
"there",
"are",
"any",
"feasible",
"mappings",
"left",
"for",
"the",
"query",
"vertex",
"n",
".",
"We",
"scan",
"the",
"compatibility",
"matrix",
"to",
"see",
"if",
"any",
"value",
"is",
">",
"0",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/UllmannState.java#L226-L230 |
114,284 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java | AtomTypeFactory.getInstance | public static AtomTypeFactory getInstance(InputStream ins, String format, IChemObjectBuilder builder) {
return new AtomTypeFactory(ins, format, builder);
} | java | public static AtomTypeFactory getInstance(InputStream ins, String format, IChemObjectBuilder builder) {
return new AtomTypeFactory(ins, format, builder);
} | [
"public",
"static",
"AtomTypeFactory",
"getInstance",
"(",
"InputStream",
"ins",
",",
"String",
"format",
",",
"IChemObjectBuilder",
"builder",
")",
"{",
"return",
"new",
"AtomTypeFactory",
"(",
"ins",
",",
"format",
",",
"builder",
")",
";",
"}"
] | Method to create a default AtomTypeFactory, using the given InputStream.
An AtomType of this kind is not cached.
@see #getInstance(String, IChemObjectBuilder)
@param ins InputStream containing the data
@param format String representing the possible formats ('xml' and 'txt')
@param ... | [
"Method",
"to",
"create",
"a",
"default",
"AtomTypeFactory",
"using",
"the",
"given",
"InputStream",
".",
"An",
"AtomType",
"of",
"this",
"kind",
"is",
"not",
"cached",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java#L129-L131 |
114,285 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java | AtomTypeFactory.readConfiguration | private void readConfiguration(String fileName, IChemObjectBuilder builder) {
logger.info("Reading config file from ", fileName);
InputStream ins;
{
//try to see if this is a resource
ins = this.getClass().getClassLoader().getResourceAsStream(fileName);
if (i... | java | private void readConfiguration(String fileName, IChemObjectBuilder builder) {
logger.info("Reading config file from ", fileName);
InputStream ins;
{
//try to see if this is a resource
ins = this.getClass().getClassLoader().getResourceAsStream(fileName);
if (i... | [
"private",
"void",
"readConfiguration",
"(",
"String",
"fileName",
",",
"IChemObjectBuilder",
"builder",
")",
"{",
"logger",
".",
"info",
"(",
"\"Reading config file from \"",
",",
"fileName",
")",
";",
"InputStream",
"ins",
";",
"{",
"//try to see if this is a resour... | Read the configuration from a text file.
@param fileName name of the configuration file
@param builder INewChemObjectBuilder used to make IChemObject instances | [
"Read",
"the",
"configuration",
"from",
"a",
"text",
"file",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java#L176-L210 |
114,286 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java | AtomTypeFactory.getAtomType | public IAtomType getAtomType(String identifier) throws NoSuchAtomTypeException {
IAtomType type = atomTypes.get(identifier);
if (type != null) return type;
throw new NoSuchAtomTypeException("The AtomType " + identifier + " could not be found");
} | java | public IAtomType getAtomType(String identifier) throws NoSuchAtomTypeException {
IAtomType type = atomTypes.get(identifier);
if (type != null) return type;
throw new NoSuchAtomTypeException("The AtomType " + identifier + " could not be found");
} | [
"public",
"IAtomType",
"getAtomType",
"(",
"String",
"identifier",
")",
"throws",
"NoSuchAtomTypeException",
"{",
"IAtomType",
"type",
"=",
"atomTypes",
".",
"get",
"(",
"identifier",
")",
";",
"if",
"(",
"type",
"!=",
"null",
")",
"return",
"type",
";",
"th... | Get an AtomType with the given ID.
@param identifier an ID for a particular atom type (like C$)
@return The AtomType for this id
@exception NoSuchAtomTypeException Thrown if the atom type does not exist. | [
"Get",
"an",
"AtomType",
"with",
"the",
"given",
"ID",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java#L266-L270 |
114,287 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java | AtomTypeFactory.getAtomTypes | public IAtomType[] getAtomTypes(String symbol) {
logger.debug("Request for atomtype for symbol ", symbol);
List<IAtomType> atomList = new ArrayList<IAtomType>();
for (IAtomType atomType : atomTypes.values()) {
if (Objects.equals(atomType.getSymbol(), symbol)) {
atomLi... | java | public IAtomType[] getAtomTypes(String symbol) {
logger.debug("Request for atomtype for symbol ", symbol);
List<IAtomType> atomList = new ArrayList<IAtomType>();
for (IAtomType atomType : atomTypes.values()) {
if (Objects.equals(atomType.getSymbol(), symbol)) {
atomLi... | [
"public",
"IAtomType",
"[",
"]",
"getAtomTypes",
"(",
"String",
"symbol",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Request for atomtype for symbol \"",
",",
"symbol",
")",
";",
"List",
"<",
"IAtomType",
">",
"atomList",
"=",
"new",
"ArrayList",
"<",
"IAtomTyp... | Get an array of all atomTypes known to the AtomTypeFactory for the given
element symbol and atomtype class.
@param symbol An element symbol to search for
@return An array of atomtypes that matches the given element symbol
and atomtype class | [
"Get",
"an",
"array",
"of",
"all",
"atomTypes",
"known",
"to",
"the",
"AtomTypeFactory",
"for",
"the",
"given",
"element",
"symbol",
"and",
"atomtype",
"class",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java#L280-L294 |
114,288 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java | AtomTypeFactory.getAllAtomTypes | public IAtomType[] getAllAtomTypes() {
logger.debug("Returning list of size: ", getSize());
return (IAtomType[]) atomTypes.values().toArray(new IAtomType[atomTypes.size()]);
} | java | public IAtomType[] getAllAtomTypes() {
logger.debug("Returning list of size: ", getSize());
return (IAtomType[]) atomTypes.values().toArray(new IAtomType[atomTypes.size()]);
} | [
"public",
"IAtomType",
"[",
"]",
"getAllAtomTypes",
"(",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Returning list of size: \"",
",",
"getSize",
"(",
")",
")",
";",
"return",
"(",
"IAtomType",
"[",
"]",
")",
"atomTypes",
".",
"values",
"(",
")",
".",
"toA... | Gets the allAtomTypes attribute of the AtomTypeFactory object.
@return The allAtomTypes value | [
"Gets",
"the",
"allAtomTypes",
"attribute",
"of",
"the",
"AtomTypeFactory",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java#L301-L304 |
114,289 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java | AtomTypeFactory.configure | public IAtom configure(IAtom atom) throws CDKException {
if (atom instanceof IPseudoAtom) {
// do not try to configure PseudoAtom's
return atom;
}
try {
IAtomType atomType;
String atomTypeName = atom.getAtomTypeName();
if (atomTypeName ... | java | public IAtom configure(IAtom atom) throws CDKException {
if (atom instanceof IPseudoAtom) {
// do not try to configure PseudoAtom's
return atom;
}
try {
IAtomType atomType;
String atomTypeName = atom.getAtomTypeName();
if (atomTypeName ... | [
"public",
"IAtom",
"configure",
"(",
"IAtom",
"atom",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"atom",
"instanceof",
"IPseudoAtom",
")",
"{",
"// do not try to configure PseudoAtom's",
"return",
"atom",
";",
"}",
"try",
"{",
"IAtomType",
"atomType",
";",
"... | Configures an atom. Finds the correct element type by looking at the Atom's
atom type name, and if that fails, picks the first atom type matching
the Atom's element symbol..
@param atom The atom to be configured
@return The configured atom
@throws CDKException when it could not recognize and configure th... | [
"Configures",
"an",
"atom",
".",
"Finds",
"the",
"correct",
"element",
"type",
"by",
"looking",
"at",
"the",
"Atom",
"s",
"atom",
"type",
"name",
"and",
"if",
"that",
"fails",
"picks",
"the",
"first",
"atom",
"type",
"matching",
"the",
"Atom",
"s",
"elem... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/AtomTypeFactory.java#L316-L358 |
114,290 | cdk/cdk | display/render/src/main/java/org/openscience/cdk/renderer/color/PartialAtomicChargeColors.java | PartialAtomicChargeColors.getAtomColor | @Override
public Color getAtomColor(IAtom atom, Color defaultColor) {
Color color = defaultColor;
if (atom.getCharge() == null) return defaultColor;
double charge = atom.getCharge();
if (charge > 0.0) {
if (charge < 1.0) {
int index = 255 - (int) (charge *... | java | @Override
public Color getAtomColor(IAtom atom, Color defaultColor) {
Color color = defaultColor;
if (atom.getCharge() == null) return defaultColor;
double charge = atom.getCharge();
if (charge > 0.0) {
if (charge < 1.0) {
int index = 255 - (int) (charge *... | [
"@",
"Override",
"public",
"Color",
"getAtomColor",
"(",
"IAtom",
"atom",
",",
"Color",
"defaultColor",
")",
"{",
"Color",
"color",
"=",
"defaultColor",
";",
"if",
"(",
"atom",
".",
"getCharge",
"(",
")",
"==",
"null",
")",
"return",
"defaultColor",
";",
... | Returns the a color reflecting the given atom's partial charge, or
defaults to the given color if no color is defined.
@param atom IAtom to get a color for
@param defaultColor Color returned if this scheme does not define
a color for the passed IAtom
@return the color for the given atom. | [
"Returns",
"the",
"a",
"color",
"reflecting",
"the",
"given",
"atom",
"s",
"partial",
"charge",
"or",
"defaults",
"to",
"the",
"given",
"color",
"if",
"no",
"color",
"is",
"defined",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/color/PartialAtomicChargeColors.java#L59-L80 |
114,291 | cdk/cdk | descriptor/fingerprint/src/main/java/org/openscience/cdk/fingerprint/PubchemFingerprinter.java | PubchemFingerprinter.getBitFingerprint | @Override
public IBitFingerprint getBitFingerprint(IAtomContainer atomContainer) throws CDKException {
generateFp(atomContainer);
BitSet fp = new BitSet(FP_SIZE);
for (int i = 0; i < FP_SIZE; i++) {
if (isBitOn(i)) fp.set(i);
}
return new BitSetFingerprint(fp);
... | java | @Override
public IBitFingerprint getBitFingerprint(IAtomContainer atomContainer) throws CDKException {
generateFp(atomContainer);
BitSet fp = new BitSet(FP_SIZE);
for (int i = 0; i < FP_SIZE; i++) {
if (isBitOn(i)) fp.set(i);
}
return new BitSetFingerprint(fp);
... | [
"@",
"Override",
"public",
"IBitFingerprint",
"getBitFingerprint",
"(",
"IAtomContainer",
"atomContainer",
")",
"throws",
"CDKException",
"{",
"generateFp",
"(",
"atomContainer",
")",
";",
"BitSet",
"fp",
"=",
"new",
"BitSet",
"(",
"FP_SIZE",
")",
";",
"for",
"(... | Calculate 881 bit Pubchem fingerprint for a molecule.
See
<a href="ftp://ftp.ncbi.nlm.nih.gov/pubchem/specifications/pubchem_fingerprints.txt">here</a>
for a description of each bit position.
@param atomContainer the molecule to consider
@return the fingerprint
@throws CDKException if there is an error during substru... | [
"Calculate",
"881",
"bit",
"Pubchem",
"fingerprint",
"for",
"a",
"molecule",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/fingerprint/src/main/java/org/openscience/cdk/fingerprint/PubchemFingerprinter.java#L117-L125 |
114,292 | cdk/cdk | descriptor/fingerprint/src/main/java/org/openscience/cdk/fingerprint/PubchemFingerprinter.java | PubchemFingerprinter.decode | public static BitSet decode(String enc) {
byte[] fp = base64Decode(enc);
if (fp.length < 4) {
throw new IllegalArgumentException("Input is not a proper PubChem base64 encoded fingerprint");
}
int len = (fp[0] << 24) | (fp[1] << 16) | (fp[2] << 8) | (fp[3] & 0xff);
if... | java | public static BitSet decode(String enc) {
byte[] fp = base64Decode(enc);
if (fp.length < 4) {
throw new IllegalArgumentException("Input is not a proper PubChem base64 encoded fingerprint");
}
int len = (fp[0] << 24) | (fp[1] << 16) | (fp[2] << 8) | (fp[3] & 0xff);
if... | [
"public",
"static",
"BitSet",
"decode",
"(",
"String",
"enc",
")",
"{",
"byte",
"[",
"]",
"fp",
"=",
"base64Decode",
"(",
"enc",
")",
";",
"if",
"(",
"fp",
".",
"length",
"<",
"4",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Input is ... | Returns a fingerprint from a Base64 encoded Pubchem fingerprint.
@param enc The Base64 encoded fingerprint
@return A BitSet corresponding to the input fingerprint | [
"Returns",
"a",
"fingerprint",
"from",
"a",
"Base64",
"encoded",
"Pubchem",
"fingerprint",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/fingerprint/src/main/java/org/openscience/cdk/fingerprint/PubchemFingerprinter.java#L346-L369 |
114,293 | cdk/cdk | descriptor/fingerprint/src/main/java/org/openscience/cdk/fingerprint/PubchemFingerprinter.java | PubchemFingerprinter.encode | private String encode() {
byte[] pack = new byte[4 + m_bits.length];
pack[0] = (byte) ((FP_SIZE & 0xffffffff) >> 24);
pack[1] = (byte) ((FP_SIZE & 0x00ffffff) >> 16);
pack[2] = (byte) ((FP_SIZE & 0x0000ffff) >> 8);
pack[3] = (byte) (FP_SIZE & 0x000000ff);
for (int i = 0;... | java | private String encode() {
byte[] pack = new byte[4 + m_bits.length];
pack[0] = (byte) ((FP_SIZE & 0xffffffff) >> 24);
pack[1] = (byte) ((FP_SIZE & 0x00ffffff) >> 16);
pack[2] = (byte) ((FP_SIZE & 0x0000ffff) >> 8);
pack[3] = (byte) (FP_SIZE & 0x000000ff);
for (int i = 0;... | [
"private",
"String",
"encode",
"(",
")",
"{",
"byte",
"[",
"]",
"pack",
"=",
"new",
"byte",
"[",
"4",
"+",
"m_bits",
".",
"length",
"]",
";",
"pack",
"[",
"0",
"]",
"=",
"(",
"byte",
")",
"(",
"(",
"FP_SIZE",
"&",
"0xffffffff",
")",
">>",
"24",... | the first four bytes contains the length of the fingerprint | [
"the",
"first",
"four",
"bytes",
"contains",
"the",
"length",
"of",
"the",
"fingerprint"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/fingerprint/src/main/java/org/openscience/cdk/fingerprint/PubchemFingerprinter.java#L372-L383 |
114,294 | cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java | SmilesParser.parseReactionSmiles | public IReaction parseReactionSmiles(String smiles) throws InvalidSmilesException {
if (!smiles.contains(">"))
throw new InvalidSmilesException("Not a reaction SMILES: " + smiles);
final int first = smiles.indexOf('>');
final int second = smiles.indexOf('>', first + 1);
i... | java | public IReaction parseReactionSmiles(String smiles) throws InvalidSmilesException {
if (!smiles.contains(">"))
throw new InvalidSmilesException("Not a reaction SMILES: " + smiles);
final int first = smiles.indexOf('>');
final int second = smiles.indexOf('>', first + 1);
i... | [
"public",
"IReaction",
"parseReactionSmiles",
"(",
"String",
"smiles",
")",
"throws",
"InvalidSmilesException",
"{",
"if",
"(",
"!",
"smiles",
".",
"contains",
"(",
"\">\"",
")",
")",
"throw",
"new",
"InvalidSmilesException",
"(",
"\"Not a reaction SMILES: \"",
"+",... | Parse a reaction SMILES.
@param smiles The SMILES string to parse
@return An instance of {@link org.openscience.cdk.interfaces.IReaction}
@throws InvalidSmilesException if the string cannot be parsed
@see #parseSmiles(String) | [
"Parse",
"a",
"reaction",
"SMILES",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java#L190-L246 |
114,295 | cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java | SmilesParser.parseMolCXSMILES | private void parseMolCXSMILES(String title, IAtomContainer mol) {
CxSmilesState cxstate;
int pos;
if (title != null && title.startsWith("|")) {
if ((pos = CxSmilesParser.processCx(title, cxstate = new CxSmilesState())) >= 0) {
// set the correct title
... | java | private void parseMolCXSMILES(String title, IAtomContainer mol) {
CxSmilesState cxstate;
int pos;
if (title != null && title.startsWith("|")) {
if ((pos = CxSmilesParser.processCx(title, cxstate = new CxSmilesState())) >= 0) {
// set the correct title
... | [
"private",
"void",
"parseMolCXSMILES",
"(",
"String",
"title",
",",
"IAtomContainer",
"mol",
")",
"{",
"CxSmilesState",
"cxstate",
";",
"int",
"pos",
";",
"if",
"(",
"title",
"!=",
"null",
"&&",
"title",
".",
"startsWith",
"(",
"\"|\"",
")",
")",
"{",
"i... | Parses CXSMILES layer and set attributes for atoms and bonds on the provided molecule.
@param title SMILES title field
@param mol molecule | [
"Parses",
"CXSMILES",
"layer",
"and",
"set",
"attributes",
"for",
"atoms",
"and",
"bonds",
"on",
"the",
"provided",
"molecule",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java#L310-L330 |
114,296 | cdk/cdk | storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java | SmilesParser.parseRxnCXSMILES | private void parseRxnCXSMILES(String title, IReaction rxn) {
CxSmilesState cxstate;
int pos;
if (title != null && title.startsWith("|")) {
if ((pos = CxSmilesParser.processCx(title, cxstate = new CxSmilesState())) >= 0) {
// set the correct title
rxn.... | java | private void parseRxnCXSMILES(String title, IReaction rxn) {
CxSmilesState cxstate;
int pos;
if (title != null && title.startsWith("|")) {
if ((pos = CxSmilesParser.processCx(title, cxstate = new CxSmilesState())) >= 0) {
// set the correct title
rxn.... | [
"private",
"void",
"parseRxnCXSMILES",
"(",
"String",
"title",
",",
"IReaction",
"rxn",
")",
"{",
"CxSmilesState",
"cxstate",
";",
"int",
"pos",
";",
"if",
"(",
"title",
"!=",
"null",
"&&",
"title",
".",
"startsWith",
"(",
"\"|\"",
")",
")",
"{",
"if",
... | Parses CXSMILES layer and set attributes for atoms and bonds on the provided reaction.
@param title SMILES title field
@param rxn parsed reaction | [
"Parses",
"CXSMILES",
"layer",
"and",
"set",
"attributes",
"for",
"atoms",
"and",
"bonds",
"on",
"the",
"provided",
"reaction",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/smiles/src/main/java/org/openscience/cdk/smiles/SmilesParser.java#L338-L374 |
114,297 | cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/AromaticBondsCountDescriptor.java | AromaticBondsCountDescriptor.setParameters | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length != 1) {
throw new CDKException("AromaticBondsCountDescriptor expects one parameter");
}
if (!(params[0] instanceof Boolean)) {
throw new CDKException("The first parameter must... | java | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length != 1) {
throw new CDKException("AromaticBondsCountDescriptor expects one parameter");
}
if (!(params[0] instanceof Boolean)) {
throw new CDKException("The first parameter must... | [
"@",
"Override",
"public",
"void",
"setParameters",
"(",
"Object",
"[",
"]",
"params",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"params",
".",
"length",
"!=",
"1",
")",
"{",
"throw",
"new",
"CDKException",
"(",
"\"AromaticBondsCountDescriptor expects one p... | Sets the parameters attribute of the AromaticBondsCountDescriptor object.
This descriptor takes one parameter, which should be Boolean to indicate whether
aromaticity has been checked (TRUE) or not (FALSE).
@param params The new parameters value
@exception CDKException if more than one parameter or a non... | [
"Sets",
"the",
"parameters",
"attribute",
"of",
"the",
"AromaticBondsCountDescriptor",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/AromaticBondsCountDescriptor.java#L103-L113 |
114,298 | cdk/cdk | base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java | AtomTypeAwareSaturationChecker.checkBond | private void checkBond(IAtomContainer atomContainer, int index) throws CDKException {
IBond bond = atomContainer.getBond(index);
if (bond != null && bond.getFlag(CDKConstants.SINGLE_OR_DOUBLE)) {
try {
oldBondOrder = bond.getOrder();
bond.setOrder(IBond.Order... | java | private void checkBond(IAtomContainer atomContainer, int index) throws CDKException {
IBond bond = atomContainer.getBond(index);
if (bond != null && bond.getFlag(CDKConstants.SINGLE_OR_DOUBLE)) {
try {
oldBondOrder = bond.getOrder();
bond.setOrder(IBond.Order... | [
"private",
"void",
"checkBond",
"(",
"IAtomContainer",
"atomContainer",
",",
"int",
"index",
")",
"throws",
"CDKException",
"{",
"IBond",
"bond",
"=",
"atomContainer",
".",
"getBond",
"(",
"index",
")",
";",
"if",
"(",
"bond",
"!=",
"null",
"&&",
"bond",
"... | This method tries to set the bond order on the current bond.
@param atomContainer The molecule
@param index The index of the current bond
@throws CDKException when no suitable solution can be found | [
"This",
"method",
"tries",
"to",
"set",
"the",
"bond",
"order",
"on",
"the",
"current",
"bond",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java#L164-L177 |
114,299 | cdk/cdk | base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java | AtomTypeAwareSaturationChecker.setMaxBondOrder | private void setMaxBondOrder(IBond bond, IAtomContainer atomContainer) throws CDKException {
if (bondOrderCanBeIncreased(bond, atomContainer)) {
if (bond.getOrder() != IBond.Order.QUADRUPLE)
bond.setOrder(BondManipulator.increaseBondOrder(bond.getOrder()));
else
... | java | private void setMaxBondOrder(IBond bond, IAtomContainer atomContainer) throws CDKException {
if (bondOrderCanBeIncreased(bond, atomContainer)) {
if (bond.getOrder() != IBond.Order.QUADRUPLE)
bond.setOrder(BondManipulator.increaseBondOrder(bond.getOrder()));
else
... | [
"private",
"void",
"setMaxBondOrder",
"(",
"IBond",
"bond",
",",
"IAtomContainer",
"atomContainer",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"bondOrderCanBeIncreased",
"(",
"bond",
",",
"atomContainer",
")",
")",
"{",
"if",
"(",
"bond",
".",
"getOrder",
... | This method decides the highest bond order that the bond can have and set
it to that.
@param bond The bond to be investigated
@param atomContainer The {@link IAtomContainer} that contains the bond
@throws CDKEXception when the bond cannot be further increased | [
"This",
"method",
"decides",
"the",
"highest",
"bond",
"order",
"that",
"the",
"bond",
"can",
"have",
"and",
"set",
"it",
"to",
"that",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java#L187-L194 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.