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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
113,800 | cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/Reaction.java | Reaction.setProductCoefficient | @Override
public boolean setProductCoefficient(IAtomContainer product, Double coefficient) {
boolean result = products.setMultiplier(product, coefficient);
return result;
} | java | @Override
public boolean setProductCoefficient(IAtomContainer product, Double coefficient) {
boolean result = products.setMultiplier(product, coefficient);
return result;
} | [
"@",
"Override",
"public",
"boolean",
"setProductCoefficient",
"(",
"IAtomContainer",
"product",
",",
"Double",
"coefficient",
")",
"{",
"boolean",
"result",
"=",
"products",
".",
"setMultiplier",
"(",
"product",
",",
"coefficient",
")",
";",
"return",
"result",
... | Sets the coefficient of a a product to a given value.
@param product Product for which the coefficient is set
@param coefficient The new coefficient for the given product
@return true if Molecule has been found and stoichiometry has been set.
@see #getProductCoefficient | [
"Sets",
"the",
"coefficient",
"of",
"a",
"a",
"product",
"to",
"a",
"given",
"value",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/Reaction.java#L323-L327 |
113,801 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/rebond/RebondTool.java | RebondTool.bondAtom | private void bondAtom(IAtomContainer container, IAtom atom) {
double myCovalentRadius = atom.getCovalentRadius();
double searchRadius = myCovalentRadius + maxCovalentRadius + bondTolerance;
Point tupleAtom = new Point(atom.getPoint3d().x, atom.getPoint3d().y, atom.getPoint3d().z);
for (B... | java | private void bondAtom(IAtomContainer container, IAtom atom) {
double myCovalentRadius = atom.getCovalentRadius();
double searchRadius = myCovalentRadius + maxCovalentRadius + bondTolerance;
Point tupleAtom = new Point(atom.getPoint3d().x, atom.getPoint3d().y, atom.getPoint3d().z);
for (B... | [
"private",
"void",
"bondAtom",
"(",
"IAtomContainer",
"container",
",",
"IAtom",
"atom",
")",
"{",
"double",
"myCovalentRadius",
"=",
"atom",
".",
"getCovalentRadius",
"(",
")",
";",
"double",
"searchRadius",
"=",
"myCovalentRadius",
"+",
"maxCovalentRadius",
"+",... | Rebonds one atom by looking up nearby atom using the binary space partition tree. | [
"Rebonds",
"one",
"atom",
"by",
"looking",
"up",
"nearby",
"atom",
"using",
"the",
"binary",
"space",
"partition",
"tree",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/rebond/RebondTool.java#L96-L110 |
113,802 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/graph/rebond/RebondTool.java | RebondTool.isBonded | private boolean isBonded(double covalentRadiusA, double covalentRadiusB, double distance2) {
double maxAcceptable = covalentRadiusA + covalentRadiusB + bondTolerance;
double maxAcceptable2 = maxAcceptable * maxAcceptable;
double minBondDistance2 = this.minBondDistance * this.minBondDistance;
... | java | private boolean isBonded(double covalentRadiusA, double covalentRadiusB, double distance2) {
double maxAcceptable = covalentRadiusA + covalentRadiusB + bondTolerance;
double maxAcceptable2 = maxAcceptable * maxAcceptable;
double minBondDistance2 = this.minBondDistance * this.minBondDistance;
... | [
"private",
"boolean",
"isBonded",
"(",
"double",
"covalentRadiusA",
",",
"double",
"covalentRadiusB",
",",
"double",
"distance2",
")",
"{",
"double",
"maxAcceptable",
"=",
"covalentRadiusA",
"+",
"covalentRadiusB",
"+",
"bondTolerance",
";",
"double",
"maxAcceptable2"... | Returns the bond order for the bond. At this moment, it only returns
0 or 1, but not 2 or 3, or aromatic bond order. | [
"Returns",
"the",
"bond",
"order",
"for",
"the",
"bond",
".",
"At",
"this",
"moment",
"it",
"only",
"returns",
"0",
"or",
"1",
"but",
"not",
"2",
"or",
"3",
"or",
"aromatic",
"bond",
"order",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/graph/rebond/RebondTool.java#L117-L123 |
113,803 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/aromaticity/CDKHueckelAromaticityDetector.java | CDKHueckelAromaticityDetector.isHueckelValid | private static boolean isHueckelValid(IAtomContainer singleRing) throws CDKException {
int electronCount = 0;
for (IAtom ringAtom : singleRing.atoms()) {
if (ringAtom.getHybridization() != CDKConstants.UNSET && (ringAtom.getHybridization() == Hybridization.SP2)
|| ringAto... | java | private static boolean isHueckelValid(IAtomContainer singleRing) throws CDKException {
int electronCount = 0;
for (IAtom ringAtom : singleRing.atoms()) {
if (ringAtom.getHybridization() != CDKConstants.UNSET && (ringAtom.getHybridization() == Hybridization.SP2)
|| ringAto... | [
"private",
"static",
"boolean",
"isHueckelValid",
"(",
"IAtomContainer",
"singleRing",
")",
"throws",
"CDKException",
"{",
"int",
"electronCount",
"=",
"0",
";",
"for",
"(",
"IAtom",
"ringAtom",
":",
"singleRing",
".",
"atoms",
"(",
")",
")",
"{",
"if",
"(",... | Tests if the electron count matches the Hückel 4n+2 rule. | [
"Tests",
"if",
"the",
"electron",
"count",
"matches",
"the",
"Hü",
";",
"ckel",
"4n",
"+",
"2",
"rule",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/aromaticity/CDKHueckelAromaticityDetector.java#L150-L193 |
113,804 | cdk/cdk | display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java | RendererModel.setHighlightedAtom | public void setHighlightedAtom(IAtom highlightedAtom) {
if ((this.highlightedAtom != null) || (highlightedAtom != null)) {
this.highlightedAtom = highlightedAtom;
fireChange();
}
} | java | public void setHighlightedAtom(IAtom highlightedAtom) {
if ((this.highlightedAtom != null) || (highlightedAtom != null)) {
this.highlightedAtom = highlightedAtom;
fireChange();
}
} | [
"public",
"void",
"setHighlightedAtom",
"(",
"IAtom",
"highlightedAtom",
")",
"{",
"if",
"(",
"(",
"this",
".",
"highlightedAtom",
"!=",
"null",
")",
"||",
"(",
"highlightedAtom",
"!=",
"null",
")",
")",
"{",
"this",
".",
"highlightedAtom",
"=",
"highlighted... | Sets the atom currently highlighted.
@param highlightedAtom
The atom to be highlighted | [
"Sets",
"the",
"atom",
"currently",
"highlighted",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java#L329-L334 |
113,805 | cdk/cdk | display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java | RendererModel.setHighlightedBond | public void setHighlightedBond(IBond highlightedBond) {
if ((this.highlightedBond != null) || (highlightedBond != null)) {
this.highlightedBond = highlightedBond;
fireChange();
}
} | java | public void setHighlightedBond(IBond highlightedBond) {
if ((this.highlightedBond != null) || (highlightedBond != null)) {
this.highlightedBond = highlightedBond;
fireChange();
}
} | [
"public",
"void",
"setHighlightedBond",
"(",
"IBond",
"highlightedBond",
")",
"{",
"if",
"(",
"(",
"this",
".",
"highlightedBond",
"!=",
"null",
")",
"||",
"(",
"highlightedBond",
"!=",
"null",
")",
")",
"{",
"this",
".",
"highlightedBond",
"=",
"highlighted... | Sets the Bond currently highlighted.
@param highlightedBond
The Bond to be currently highlighted | [
"Sets",
"the",
"Bond",
"currently",
"highlighted",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java#L351-L356 |
113,806 | cdk/cdk | display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java | RendererModel.addCDKChangeListener | public void addCDKChangeListener(ICDKChangeListener listener) {
if (listeners == null) {
listeners = new ArrayList<ICDKChangeListener>();
}
if (!listeners.contains(listener)) {
listeners.add(listener);
}
} | java | public void addCDKChangeListener(ICDKChangeListener listener) {
if (listeners == null) {
listeners = new ArrayList<ICDKChangeListener>();
}
if (!listeners.contains(listener)) {
listeners.add(listener);
}
} | [
"public",
"void",
"addCDKChangeListener",
"(",
"ICDKChangeListener",
"listener",
")",
"{",
"if",
"(",
"listeners",
"==",
"null",
")",
"{",
"listeners",
"=",
"new",
"ArrayList",
"<",
"ICDKChangeListener",
">",
"(",
")",
";",
"}",
"if",
"(",
"!",
"listeners",
... | Adds a change listener to the list of listeners.
@param listener
The listener added to the list | [
"Adds",
"a",
"change",
"listener",
"to",
"the",
"list",
"of",
"listeners",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java#L385-L392 |
113,807 | cdk/cdk | display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java | RendererModel.fireChange | public void fireChange() {
if (getNotification() && listeners != null) {
EventObject event = new EventObject(this);
for (int i = 0; i < listeners.size(); i++) {
listeners.get(i).stateChanged(event);
}
}
} | java | public void fireChange() {
if (getNotification() && listeners != null) {
EventObject event = new EventObject(this);
for (int i = 0; i < listeners.size(); i++) {
listeners.get(i).stateChanged(event);
}
}
} | [
"public",
"void",
"fireChange",
"(",
")",
"{",
"if",
"(",
"getNotification",
"(",
")",
"&&",
"listeners",
"!=",
"null",
")",
"{",
"EventObject",
"event",
"=",
"new",
"EventObject",
"(",
"this",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
... | Notifies registered listeners of certain changes that have occurred in
this model. | [
"Notifies",
"registered",
"listeners",
"of",
"certain",
"changes",
"that",
"have",
"occurred",
"in",
"this",
"model",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java#L408-L415 |
113,808 | cdk/cdk | display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java | RendererModel.getToolTipText | public String getToolTipText(IAtom atom) {
if (toolTipTextMap.get(atom) != null) {
return toolTipTextMap.get(atom);
} else {
return null;
}
} | java | public String getToolTipText(IAtom atom) {
if (toolTipTextMap.get(atom) != null) {
return toolTipTextMap.get(atom);
} else {
return null;
}
} | [
"public",
"String",
"getToolTipText",
"(",
"IAtom",
"atom",
")",
"{",
"if",
"(",
"toolTipTextMap",
".",
"get",
"(",
"atom",
")",
"!=",
"null",
")",
"{",
"return",
"toolTipTextMap",
".",
"get",
"(",
"atom",
")",
";",
"}",
"else",
"{",
"return",
"null",
... | Gets the toolTipText for atom certain atom.
@param atom
The atom.
@return The toolTipText value. | [
"Gets",
"the",
"toolTipText",
"for",
"atom",
"certain",
"atom",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/RendererModel.java#L424-L430 |
113,809 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MMFF94ParametersCall.java | MMFF94ParametersCall.getAngleData | public List getAngleData(String angleType, String id1, String id2, String id3) throws Exception {
String akey = "";
if (pSet.containsKey(("angle" + angleType + ";" + id1 + ";" + id2 + ";" + id3))) {
akey = "angle" + angleType + ";" + id1 + ";" + id2 + ";" + id3;
} else if (pSet.conta... | java | public List getAngleData(String angleType, String id1, String id2, String id3) throws Exception {
String akey = "";
if (pSet.containsKey(("angle" + angleType + ";" + id1 + ";" + id2 + ";" + id3))) {
akey = "angle" + angleType + ";" + id1 + ";" + id2 + ";" + id3;
} else if (pSet.conta... | [
"public",
"List",
"getAngleData",
"(",
"String",
"angleType",
",",
"String",
"id1",
",",
"String",
"id2",
",",
"String",
"id3",
")",
"throws",
"Exception",
"{",
"String",
"akey",
"=",
"\"\"",
";",
"if",
"(",
"pSet",
".",
"containsKey",
"(",
"(",
"\"angle... | Gets the angle parameter set.
@param id1 ID from Atom 1.
@param id2 ID from Atom 2.
@param id3 ID from Atom 3.
@return The angle data from the force field parameter set
@exception Exception Description of the Exception | [
"Gets",
"the",
"angle",
"parameter",
"set",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MMFF94ParametersCall.java#L65-L80 |
113,810 | cdk/cdk | descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR.java | RDFProtonDescriptor_GHR.getNearestBondtoAGivenAtom | private int getNearestBondtoAGivenAtom(IAtomContainer mol, IAtom atom, IBond bond) {
int nearestBond = 0;
double[] values;
double distance = 0;
IAtom atom0 = bond.getBegin();
List<IBond> bondsAtLeft = mol.getConnectedBondsList(atom0);
int partial;
for (int i = 0; ... | java | private int getNearestBondtoAGivenAtom(IAtomContainer mol, IAtom atom, IBond bond) {
int nearestBond = 0;
double[] values;
double distance = 0;
IAtom atom0 = bond.getBegin();
List<IBond> bondsAtLeft = mol.getConnectedBondsList(atom0);
int partial;
for (int i = 0; ... | [
"private",
"int",
"getNearestBondtoAGivenAtom",
"(",
"IAtomContainer",
"mol",
",",
"IAtom",
"atom",
",",
"IBond",
"bond",
")",
"{",
"int",
"nearestBond",
"=",
"0",
";",
"double",
"[",
"]",
"values",
";",
"double",
"distance",
"=",
"0",
";",
"IAtom",
"atom0... | this method returns a bond bonded to this double bond | [
"this",
"method",
"returns",
"a",
"bond",
"bonded",
"to",
"this",
"double",
"bond"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsaratomic/src/main/java/org/openscience/cdk/qsar/descriptors/atomic/RDFProtonDescriptor_GHR.java#L512-L534 |
113,811 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/stereo/ExtendedCisTrans.java | ExtendedCisTrans.getOtherAtom | private static IAtom getOtherAtom(IAtomContainer mol, IAtom atom, IAtom other) {
List<IBond> bonds = mol.getConnectedBondsList(atom);
if (bonds.size() != 2)
return null;
if (bonds.get(0).contains(other))
return bonds.get(1).getOrder() == IBond.Order.DOUBLE
... | java | private static IAtom getOtherAtom(IAtomContainer mol, IAtom atom, IAtom other) {
List<IBond> bonds = mol.getConnectedBondsList(atom);
if (bonds.size() != 2)
return null;
if (bonds.get(0).contains(other))
return bonds.get(1).getOrder() == IBond.Order.DOUBLE
... | [
"private",
"static",
"IAtom",
"getOtherAtom",
"(",
"IAtomContainer",
"mol",
",",
"IAtom",
"atom",
",",
"IAtom",
"other",
")",
"{",
"List",
"<",
"IBond",
">",
"bonds",
"=",
"mol",
".",
"getConnectedBondsList",
"(",
"atom",
")",
";",
"if",
"(",
"bonds",
".... | internal, find a neighbor connected to 'atom' that is not 'other' | [
"internal",
"find",
"a",
"neighbor",
"connected",
"to",
"atom",
"that",
"is",
"not",
"other"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/stereo/ExtendedCisTrans.java#L56-L65 |
113,812 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java | Mmff.effectiveCharges | public boolean effectiveCharges(IAtomContainer mol) {
int[][] adjList = mol.getProperty(MMFF_ADJLIST_CACHE);
GraphUtil.EdgeToBondMap edgeMap = mol.getProperty(MMFF_EDGEMAP_CACHE);
if (adjList == null || edgeMap == null)
throw new IllegalArgumentException("Invoke assignAtomTypes fir... | java | public boolean effectiveCharges(IAtomContainer mol) {
int[][] adjList = mol.getProperty(MMFF_ADJLIST_CACHE);
GraphUtil.EdgeToBondMap edgeMap = mol.getProperty(MMFF_EDGEMAP_CACHE);
if (adjList == null || edgeMap == null)
throw new IllegalArgumentException("Invoke assignAtomTypes fir... | [
"public",
"boolean",
"effectiveCharges",
"(",
"IAtomContainer",
"mol",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"adjList",
"=",
"mol",
".",
"getProperty",
"(",
"MMFF_ADJLIST_CACHE",
")",
";",
"GraphUtil",
".",
"EdgeToBondMap",
"edgeMap",
"=",
"mol",
".",
"getPro... | Assign the effective formal charges used by MMFF in calculating the
final partial charge values. Atom types must be assigned first. All
existing charges are cleared.
@param mol molecule
@return charges were assigned
@see #partialCharges(IAtomContainer)
@see #assignAtomTypes(IAtomContainer) | [
"Assign",
"the",
"effective",
"formal",
"charges",
"used",
"by",
"MMFF",
"in",
"calculating",
"the",
"final",
"partial",
"charge",
"values",
".",
"Atom",
"types",
"must",
"be",
"assigned",
"first",
".",
"All",
"existing",
"charges",
"are",
"cleared",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java#L151-L163 |
113,813 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java | Mmff.partialCharges | public boolean partialCharges(IAtomContainer mol) {
int[][] adjList = mol.getProperty(MMFF_ADJLIST_CACHE);
GraphUtil.EdgeToBondMap edgeMap = mol.getProperty(MMFF_EDGEMAP_CACHE);
if (adjList == null || edgeMap == null)
throw new IllegalArgumentException("Invoke assignAtomTypes first... | java | public boolean partialCharges(IAtomContainer mol) {
int[][] adjList = mol.getProperty(MMFF_ADJLIST_CACHE);
GraphUtil.EdgeToBondMap edgeMap = mol.getProperty(MMFF_EDGEMAP_CACHE);
if (adjList == null || edgeMap == null)
throw new IllegalArgumentException("Invoke assignAtomTypes first... | [
"public",
"boolean",
"partialCharges",
"(",
"IAtomContainer",
"mol",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"adjList",
"=",
"mol",
".",
"getProperty",
"(",
"MMFF_ADJLIST_CACHE",
")",
";",
"GraphUtil",
".",
"EdgeToBondMap",
"edgeMap",
"=",
"mol",
".",
"getPrope... | Assign the partial charges, all existing charges are cleared.
Atom types must be assigned first.
@param mol molecule
@return charges were assigned
@see #effectiveCharges(IAtomContainer)
@see #assignAtomTypes(IAtomContainer) | [
"Assign",
"the",
"partial",
"charges",
"all",
"existing",
"charges",
"are",
"cleared",
".",
"Atom",
"types",
"must",
"be",
"assigned",
"first",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java#L174-L218 |
113,814 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java | Mmff.clearProps | public void clearProps(IAtomContainer mol) {
mol.removeProperty(MMFF_EDGEMAP_CACHE);
mol.removeProperty(MMFF_ADJLIST_CACHE);
for (IBond bond : mol.bonds())
bond.removeProperty(MMFF_AROM);
} | java | public void clearProps(IAtomContainer mol) {
mol.removeProperty(MMFF_EDGEMAP_CACHE);
mol.removeProperty(MMFF_ADJLIST_CACHE);
for (IBond bond : mol.bonds())
bond.removeProperty(MMFF_AROM);
} | [
"public",
"void",
"clearProps",
"(",
"IAtomContainer",
"mol",
")",
"{",
"mol",
".",
"removeProperty",
"(",
"MMFF_EDGEMAP_CACHE",
")",
";",
"mol",
".",
"removeProperty",
"(",
"MMFF_ADJLIST_CACHE",
")",
";",
"for",
"(",
"IBond",
"bond",
":",
"mol",
".",
"bonds... | Clear all transient properties assigned by this class. Assigned charges
and atom type names remain set.
@param mol molecule | [
"Clear",
"all",
"transient",
"properties",
"assigned",
"by",
"this",
"class",
".",
"Assigned",
"charges",
"and",
"atom",
"type",
"names",
"remain",
"set",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java#L226-L231 |
113,815 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java | Mmff.effectiveCharges | void effectiveCharges(IAtomContainer mol, int[][] adjList) {
double[] tmp = new double[mol.getAtomCount()];
for (int v = 0; v < tmp.length; v++) {
IAtom atom = mol.getAtom(v);
int intType = mmffParamSet.intType(atom.getAtomTypeName());
// unknown
if (intT... | java | void effectiveCharges(IAtomContainer mol, int[][] adjList) {
double[] tmp = new double[mol.getAtomCount()];
for (int v = 0; v < tmp.length; v++) {
IAtom atom = mol.getAtom(v);
int intType = mmffParamSet.intType(atom.getAtomTypeName());
// unknown
if (intT... | [
"void",
"effectiveCharges",
"(",
"IAtomContainer",
"mol",
",",
"int",
"[",
"]",
"[",
"]",
"adjList",
")",
"{",
"double",
"[",
"]",
"tmp",
"=",
"new",
"double",
"[",
"mol",
".",
"getAtomCount",
"(",
")",
"]",
";",
"for",
"(",
"int",
"v",
"=",
"0",
... | Internal effective charges method.
@param mol molecule
@param adjList adjacency list representation
@see {@link #effectiveCharges(IAtomContainer)} | [
"Internal",
"effective",
"charges",
"method",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java#L344-L394 |
113,816 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java | Mmff.getAromatics | private Set<IChemObject> getAromatics(IAtomContainer mol) {
Set<IChemObject> oldArom = new HashSet<>();
for (IAtom atom : mol.atoms())
if (atom.getFlag(CDKConstants.ISAROMATIC))
oldArom.add(atom);
for (IBond bond : mol.bonds())
if (bond.getFlag(CDKConstant... | java | private Set<IChemObject> getAromatics(IAtomContainer mol) {
Set<IChemObject> oldArom = new HashSet<>();
for (IAtom atom : mol.atoms())
if (atom.getFlag(CDKConstants.ISAROMATIC))
oldArom.add(atom);
for (IBond bond : mol.bonds())
if (bond.getFlag(CDKConstant... | [
"private",
"Set",
"<",
"IChemObject",
">",
"getAromatics",
"(",
"IAtomContainer",
"mol",
")",
"{",
"Set",
"<",
"IChemObject",
">",
"oldArom",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"IAtom",
"atom",
":",
"mol",
".",
"atoms",
"(",
")",
... | Helper method to find all existing aromatic chem objects.
@param mol molecule
@return chem objects | [
"Helper",
"method",
"to",
"find",
"all",
"existing",
"aromatic",
"chem",
"objects",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/forcefield/mmff/Mmff.java#L402-L411 |
113,817 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java | MM2BasedParameterSetReader.setAtomTypes | private void setAtomTypes(IChemObjectBuilder builder) throws Exception {
String name = "";
String rootType = "";
int an = 0;
int rl = 255;
int gl = 20;
int bl = 147;
int maxbond = 0;
double mass = 0.0;
st.nextToken();
String sid = st.nextT... | java | private void setAtomTypes(IChemObjectBuilder builder) throws Exception {
String name = "";
String rootType = "";
int an = 0;
int rl = 255;
int gl = 20;
int bl = 147;
int maxbond = 0;
double mass = 0.0;
st.nextToken();
String sid = st.nextT... | [
"private",
"void",
"setAtomTypes",
"(",
"IChemObjectBuilder",
"builder",
")",
"throws",
"Exception",
"{",
"String",
"name",
"=",
"\"\"",
";",
"String",
"rootType",
"=",
"\"\"",
";",
"int",
"an",
"=",
"0",
";",
"int",
"rl",
"=",
"255",
";",
"int",
"gl",
... | Read and stores the atom types in a vector
@exception Exception Description of the Exception | [
"Read",
"and",
"stores",
"the",
"atom",
"types",
"in",
"a",
"vector"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java#L250-L287 |
113,818 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java | MM2BasedParameterSetReader.setvdWaals | private void setvdWaals() throws Exception {
List data = new Vector();
st.nextToken();
String sid = st.nextToken();
String sradius = st.nextToken();
String sepsi = st.nextToken();
try {
double epsi = new Double(sepsi).doubleValue();
double radius =... | java | private void setvdWaals() throws Exception {
List data = new Vector();
st.nextToken();
String sid = st.nextToken();
String sradius = st.nextToken();
String sepsi = st.nextToken();
try {
double epsi = new Double(sepsi).doubleValue();
double radius =... | [
"private",
"void",
"setvdWaals",
"(",
")",
"throws",
"Exception",
"{",
"List",
"data",
"=",
"new",
"Vector",
"(",
")",
";",
"st",
".",
"nextToken",
"(",
")",
";",
"String",
"sid",
"=",
"st",
".",
"nextToken",
"(",
")",
";",
"String",
"sradius",
"=",
... | Read vdw radius, stored into the parameter set
@exception Exception Description of the Exception | [
"Read",
"vdw",
"radius",
"stored",
"into",
"the",
"parameter",
"set"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java#L294-L312 |
113,819 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java | MM2BasedParameterSetReader.setOpBend | private void setOpBend() throws Exception {
List data = new Vector();
st.nextToken();
String sid1 = st.nextToken();
String sid2 = st.nextToken();
String value1 = st.nextToken();
try {
double va1 = new Double(value1).doubleValue();
data.add(new Dou... | java | private void setOpBend() throws Exception {
List data = new Vector();
st.nextToken();
String sid1 = st.nextToken();
String sid2 = st.nextToken();
String value1 = st.nextToken();
try {
double va1 = new Double(value1).doubleValue();
data.add(new Dou... | [
"private",
"void",
"setOpBend",
"(",
")",
"throws",
"Exception",
"{",
"List",
"data",
"=",
"new",
"Vector",
"(",
")",
";",
"st",
".",
"nextToken",
"(",
")",
";",
"String",
"sid1",
"=",
"st",
".",
"nextToken",
"(",
")",
";",
"String",
"sid2",
"=",
"... | Sets the opBend attribute stored into the parameter set
@exception Exception Description of the Exception | [
"Sets",
"the",
"opBend",
"attribute",
"stored",
"into",
"the",
"parameter",
"set"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java#L551-L573 |
113,820 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java | MM2BasedParameterSetReader.setDipole | private void setDipole() throws Exception {
List data = new Vector();
st.nextToken();
String sid1 = st.nextToken();
String sid2 = st.nextToken();
String value1 = st.nextToken();
String value2 = st.nextToken();
try {
double va1 = new Double(value1).dou... | java | private void setDipole() throws Exception {
List data = new Vector();
st.nextToken();
String sid1 = st.nextToken();
String sid2 = st.nextToken();
String value1 = st.nextToken();
String value2 = st.nextToken();
try {
double va1 = new Double(value1).dou... | [
"private",
"void",
"setDipole",
"(",
")",
"throws",
"Exception",
"{",
"List",
"data",
"=",
"new",
"Vector",
"(",
")",
";",
"st",
".",
"nextToken",
"(",
")",
";",
"String",
"sid1",
"=",
"st",
".",
"nextToken",
"(",
")",
";",
"String",
"sid2",
"=",
"... | Sets the dipole attribute stored into the parameter set
@exception Exception Description of the Exception | [
"Sets",
"the",
"dipole",
"attribute",
"stored",
"into",
"the",
"parameter",
"set"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java#L682-L701 |
113,821 | cdk/cdk | tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java | MM2BasedParameterSetReader.massNumber | private Integer massNumber(int atomicNumber, double exactMass) throws IOException {
String symbol = PeriodicTable.getSymbol(atomicNumber);
IIsotope isotope = Isotopes.getInstance().getIsotope(symbol, exactMass, 0.001);
return isotope != null ? isotope.getMassNumber() : null;
} | java | private Integer massNumber(int atomicNumber, double exactMass) throws IOException {
String symbol = PeriodicTable.getSymbol(atomicNumber);
IIsotope isotope = Isotopes.getInstance().getIsotope(symbol, exactMass, 0.001);
return isotope != null ? isotope.getMassNumber() : null;
} | [
"private",
"Integer",
"massNumber",
"(",
"int",
"atomicNumber",
",",
"double",
"exactMass",
")",
"throws",
"IOException",
"{",
"String",
"symbol",
"=",
"PeriodicTable",
".",
"getSymbol",
"(",
"atomicNumber",
")",
";",
"IIsotope",
"isotope",
"=",
"Isotopes",
".",... | Mass number for a atom with a given atomic number and exact mass.
@param atomicNumber atomic number
@param exactMass exact mass
@return the mass number (or null) if no mass number was found
@throws IOException isotope configuration could not be loaded | [
"Mass",
"number",
"for",
"a",
"atom",
"with",
"a",
"given",
"atomic",
"number",
"and",
"exact",
"mass",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/forcefield/src/main/java/org/openscience/cdk/modeling/builder3d/MM2BasedParameterSetReader.java#L885-L889 |
113,822 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/MarkedElement.java | MarkedElement.markup | public static MarkedElement markup(IRenderingElement elem, String... classes) {
assert elem != null;
MarkedElement tagElem = new MarkedElement(elem);
for (String cls : classes)
tagElem.aggClass(cls);
return tagElem;
} | java | public static MarkedElement markup(IRenderingElement elem, String... classes) {
assert elem != null;
MarkedElement tagElem = new MarkedElement(elem);
for (String cls : classes)
tagElem.aggClass(cls);
return tagElem;
} | [
"public",
"static",
"MarkedElement",
"markup",
"(",
"IRenderingElement",
"elem",
",",
"String",
"...",
"classes",
")",
"{",
"assert",
"elem",
"!=",
"null",
";",
"MarkedElement",
"tagElem",
"=",
"new",
"MarkedElement",
"(",
"elem",
")",
";",
"for",
"(",
"Stri... | Markup a rendering element with the specified classes.
@param elem rendering element
@param classes classes
@return the marked element | [
"Markup",
"a",
"rendering",
"element",
"with",
"the",
"specified",
"classes",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/MarkedElement.java#L125-L131 |
113,823 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.setForceField | private void setForceField(String ffname, IChemObjectBuilder builder) throws CDKException {
if (ffname == null) {
ffname = "mm2";
}
try {
forceFieldName = ffname;
ffc.setForceFieldConfigurator(ffname, builder);
parameterSet = ffc.getParameterSet();... | java | private void setForceField(String ffname, IChemObjectBuilder builder) throws CDKException {
if (ffname == null) {
ffname = "mm2";
}
try {
forceFieldName = ffname;
ffc.setForceFieldConfigurator(ffname, builder);
parameterSet = ffc.getParameterSet();... | [
"private",
"void",
"setForceField",
"(",
"String",
"ffname",
",",
"IChemObjectBuilder",
"builder",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"ffname",
"==",
"null",
")",
"{",
"ffname",
"=",
"\"mm2\"",
";",
"}",
"try",
"{",
"forceFieldName",
"=",
"ffname... | Sets the forceField attribute of the ModelBuilder3D object.
@param ffname forceField name | [
"Sets",
"the",
"forceField",
"attribute",
"of",
"the",
"ModelBuilder3D",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L134-L147 |
113,824 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.getRingSetOfAtom | private IRingSet getRingSetOfAtom(List ringSystems, IAtom atom) {
IRingSet ringSetOfAtom = null;
for (int i = 0; i < ringSystems.size(); i++) {
if (((IRingSet) ringSystems.get(i)).contains(atom)) {
return (IRingSet) ringSystems.get(i);
}
}
return r... | java | private IRingSet getRingSetOfAtom(List ringSystems, IAtom atom) {
IRingSet ringSetOfAtom = null;
for (int i = 0; i < ringSystems.size(); i++) {
if (((IRingSet) ringSystems.get(i)).contains(atom)) {
return (IRingSet) ringSystems.get(i);
}
}
return r... | [
"private",
"IRingSet",
"getRingSetOfAtom",
"(",
"List",
"ringSystems",
",",
"IAtom",
"atom",
")",
"{",
"IRingSet",
"ringSetOfAtom",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ringSystems",
".",
"size",
"(",
")",
";",
"i",
"++",... | Gets the ringSetOfAtom attribute of the ModelBuilder3D object.
@return The ringSetOfAtom value | [
"Gets",
"the",
"ringSetOfAtom",
"attribute",
"of",
"the",
"ModelBuilder3D",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L250-L258 |
113,825 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.layoutMolecule | private void layoutMolecule(List ringSetMolecule, IAtomContainer molecule, AtomPlacer3D ap3d,
AtomTetrahedralLigandPlacer3D atlp3d, AtomPlacer atomPlacer) throws CDKException, IOException,
CloneNotSupportedException {
//logger.debug("****** LAYOUT MOLECULE MAIN *******");
IAtomCo... | java | private void layoutMolecule(List ringSetMolecule, IAtomContainer molecule, AtomPlacer3D ap3d,
AtomTetrahedralLigandPlacer3D atlp3d, AtomPlacer atomPlacer) throws CDKException, IOException,
CloneNotSupportedException {
//logger.debug("****** LAYOUT MOLECULE MAIN *******");
IAtomCo... | [
"private",
"void",
"layoutMolecule",
"(",
"List",
"ringSetMolecule",
",",
"IAtomContainer",
"molecule",
",",
"AtomPlacer3D",
"ap3d",
",",
"AtomTetrahedralLigandPlacer3D",
"atlp3d",
",",
"AtomPlacer",
"atomPlacer",
")",
"throws",
"CDKException",
",",
"IOException",
",",
... | Layout the molecule, starts with ring systems and than aliphatic chains.
@param ringSetMolecule ringSystems of the molecule | [
"Layout",
"the",
"molecule",
"starts",
"with",
"ring",
"systems",
"and",
"than",
"aliphatic",
"chains",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L265-L312 |
113,826 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.setBranchAtom | private void setBranchAtom(IAtomContainer molecule, IAtom unplacedAtom, IAtom atomA, IAtomContainer atomNeighbours,
AtomPlacer3D ap3d, AtomTetrahedralLigandPlacer3D atlp3d) throws CDKException {
//logger.debug("****** SET Branch Atom ****** >"+molecule.indexOf(unplacedAtom));
IAtomContainer ... | java | private void setBranchAtom(IAtomContainer molecule, IAtom unplacedAtom, IAtom atomA, IAtomContainer atomNeighbours,
AtomPlacer3D ap3d, AtomTetrahedralLigandPlacer3D atlp3d) throws CDKException {
//logger.debug("****** SET Branch Atom ****** >"+molecule.indexOf(unplacedAtom));
IAtomContainer ... | [
"private",
"void",
"setBranchAtom",
"(",
"IAtomContainer",
"molecule",
",",
"IAtom",
"unplacedAtom",
",",
"IAtom",
"atomA",
",",
"IAtomContainer",
"atomNeighbours",
",",
"AtomPlacer3D",
"ap3d",
",",
"AtomTetrahedralLigandPlacer3D",
"atlp3d",
")",
"throws",
"CDKException... | Sets a branch atom to a ring or aliphatic chain.
@param unplacedAtom The new branchAtom
@param atomA placed atom to which the unplaced atom is connected
@param atomNeighbours placed atomNeighbours of atomA | [
"Sets",
"a",
"branch",
"atom",
"to",
"a",
"ring",
"or",
"aliphatic",
"chain",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L399-L452 |
113,827 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.searchAndPlaceBranches | private void searchAndPlaceBranches(IAtomContainer molecule, IAtomContainer chain, AtomPlacer3D ap3d,
AtomTetrahedralLigandPlacer3D atlp3d, AtomPlacer atomPlacer) throws CDKException {
//logger.debug("****** SEARCH AND PLACE ****** Chain length: "+chain.getAtomCount());
List atoms = null;
... | java | private void searchAndPlaceBranches(IAtomContainer molecule, IAtomContainer chain, AtomPlacer3D ap3d,
AtomTetrahedralLigandPlacer3D atlp3d, AtomPlacer atomPlacer) throws CDKException {
//logger.debug("****** SEARCH AND PLACE ****** Chain length: "+chain.getAtomCount());
List atoms = null;
... | [
"private",
"void",
"searchAndPlaceBranches",
"(",
"IAtomContainer",
"molecule",
",",
"IAtomContainer",
"chain",
",",
"AtomPlacer3D",
"ap3d",
",",
"AtomTetrahedralLigandPlacer3D",
"atlp3d",
",",
"AtomPlacer",
"atomPlacer",
")",
"throws",
"CDKException",
"{",
"//logger.debu... | Search and place branches of a chain or ring.
@param chain AtomContainer if atoms in an aliphatic chain or ring system | [
"Search",
"and",
"place",
"branches",
"of",
"a",
"chain",
"or",
"ring",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L459-L491 |
113,828 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.placeLinearChains3D | private void placeLinearChains3D(IAtomContainer molecule, IAtomContainer startAtoms, AtomPlacer3D ap3d,
AtomTetrahedralLigandPlacer3D atlp3d, AtomPlacer atomPlacer) throws CDKException {
//logger.debug("****** PLACE LINEAR CHAINS ******");
IAtom dihPlacedAtom = null;
IAtom thirdPlace... | java | private void placeLinearChains3D(IAtomContainer molecule, IAtomContainer startAtoms, AtomPlacer3D ap3d,
AtomTetrahedralLigandPlacer3D atlp3d, AtomPlacer atomPlacer) throws CDKException {
//logger.debug("****** PLACE LINEAR CHAINS ******");
IAtom dihPlacedAtom = null;
IAtom thirdPlace... | [
"private",
"void",
"placeLinearChains3D",
"(",
"IAtomContainer",
"molecule",
",",
"IAtomContainer",
"startAtoms",
",",
"AtomPlacer3D",
"ap3d",
",",
"AtomTetrahedralLigandPlacer3D",
"atlp3d",
",",
"AtomPlacer",
"atomPlacer",
")",
"throws",
"CDKException",
"{",
"//logger.de... | Layout all aliphatic chains with ZMatrix.
@param startAtoms AtomContainer of possible start atoms for a chain | [
"Layout",
"all",
"aliphatic",
"chains",
"with",
"ZMatrix",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L498-L535 |
113,829 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.translateStructure | private void translateStructure(Point3d originalCoord, Point3d newCoord, IAtomContainer ac) {
Point3d transVector = new Point3d(originalCoord);
transVector.sub(newCoord);
for (int i = 0; i < ac.getAtomCount(); i++) {
if (!(ac.getAtom(i).getFlag(CDKConstants.ISPLACED))) {
... | java | private void translateStructure(Point3d originalCoord, Point3d newCoord, IAtomContainer ac) {
Point3d transVector = new Point3d(originalCoord);
transVector.sub(newCoord);
for (int i = 0; i < ac.getAtomCount(); i++) {
if (!(ac.getAtom(i).getFlag(CDKConstants.ISPLACED))) {
... | [
"private",
"void",
"translateStructure",
"(",
"Point3d",
"originalCoord",
",",
"Point3d",
"newCoord",
",",
"IAtomContainer",
"ac",
")",
"{",
"Point3d",
"transVector",
"=",
"new",
"Point3d",
"(",
"originalCoord",
")",
";",
"transVector",
".",
"sub",
"(",
"newCoor... | Translates the template ring system to new coordinates.
@param originalCoord original coordinates of the placed ring atom from template
@param newCoord new coordinates from branch placement
@param ac AtomContainer contains atoms of ring system | [
"Translates",
"the",
"template",
"ring",
"system",
"to",
"new",
"coordinates",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L544-L553 |
113,830 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.setAtomsToPlace | private void setAtomsToPlace(IAtomContainer ac) {
for (int i = 0; i < ac.getAtomCount(); i++) {
ac.getAtom(i).setFlag(CDKConstants.ISPLACED, true);
}
} | java | private void setAtomsToPlace(IAtomContainer ac) {
for (int i = 0; i < ac.getAtomCount(); i++) {
ac.getAtom(i).setFlag(CDKConstants.ISPLACED, true);
}
} | [
"private",
"void",
"setAtomsToPlace",
"(",
"IAtomContainer",
"ac",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"ac",
".",
"getAtomCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"ac",
".",
"getAtom",
"(",
"i",
")",
".",
"setFlag",
"(",... | Sets the atomsToPlace attribute of the ModelBuilder3D object.
@param ac The new atomsToPlace value | [
"Sets",
"the",
"atomsToPlace",
"attribute",
"of",
"the",
"ModelBuilder3D",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L577-L581 |
113,831 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.setAtomsToUnPlaced | private void setAtomsToUnPlaced(IAtomContainer molecule) {
for (int i = 0; i < molecule.getAtomCount(); i++) {
molecule.getAtom(i).setFlag(CDKConstants.ISPLACED, false);
}
} | java | private void setAtomsToUnPlaced(IAtomContainer molecule) {
for (int i = 0; i < molecule.getAtomCount(); i++) {
molecule.getAtom(i).setFlag(CDKConstants.ISPLACED, false);
}
} | [
"private",
"void",
"setAtomsToUnPlaced",
"(",
"IAtomContainer",
"molecule",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"molecule",
".",
"getAtomCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"molecule",
".",
"getAtom",
"(",
"i",
")",
"."... | Sets the atomsToUnPlaced attribute of the ModelBuilder3D object. | [
"Sets",
"the",
"atomsToUnPlaced",
"attribute",
"of",
"the",
"ModelBuilder3D",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L586-L590 |
113,832 | cdk/cdk | tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java | ModelBuilder3D.setAtomsToUnVisited | private void setAtomsToUnVisited(IAtomContainer molecule) {
for (int i = 0; i < molecule.getAtomCount(); i++) {
molecule.getAtom(i).setFlag(CDKConstants.VISITED, false);
}
} | java | private void setAtomsToUnVisited(IAtomContainer molecule) {
for (int i = 0; i < molecule.getAtomCount(); i++) {
molecule.getAtom(i).setFlag(CDKConstants.VISITED, false);
}
} | [
"private",
"void",
"setAtomsToUnVisited",
"(",
"IAtomContainer",
"molecule",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"molecule",
".",
"getAtomCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"molecule",
".",
"getAtom",
"(",
"i",
")",
".... | Sets the atomsToUnVisited attribute of the ModelBuilder3D object. | [
"Sets",
"the",
"atomsToUnVisited",
"attribute",
"of",
"the",
"ModelBuilder3D",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/builder3d/src/main/java/org/openscience/cdk/modeling/builder3d/ModelBuilder3D.java#L595-L599 |
113,833 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java | ExtAtomContainerManipulator.makeDeepCopy | public static IAtomContainer makeDeepCopy(IAtomContainer container) {
IAtomContainer newAtomContainer = container.getBuilder().newInstance(IAtomContainer.class);
// Deep copy of the Atoms
IAtom[] atoms = copyAtoms(container, newAtomContainer);
// Deep copy of the bonds
... | java | public static IAtomContainer makeDeepCopy(IAtomContainer container) {
IAtomContainer newAtomContainer = container.getBuilder().newInstance(IAtomContainer.class);
// Deep copy of the Atoms
IAtom[] atoms = copyAtoms(container, newAtomContainer);
// Deep copy of the bonds
... | [
"public",
"static",
"IAtomContainer",
"makeDeepCopy",
"(",
"IAtomContainer",
"container",
")",
"{",
"IAtomContainer",
"newAtomContainer",
"=",
"container",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IAtomContainer",
".",
"class",
")",
";",
"// Deep ... | Retrurns deep copy of the molecule
@param container
@return deep copy of the mol | [
"Retrurns",
"deep",
"copy",
"of",
"the",
"molecule"
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java#L89-L118 |
113,834 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java | ExtAtomContainerManipulator.getExplicitHydrogenCount | public static int getExplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
int hCount = 0;
for (IAtom iAtom : atomContainer.getConnectedAtomsList(atom)) {
IAtom connectedAtom = iAtom;
if (connectedAtom.getSymbol().equals("H")) {
hCount++;
}... | java | public static int getExplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
int hCount = 0;
for (IAtom iAtom : atomContainer.getConnectedAtomsList(atom)) {
IAtom connectedAtom = iAtom;
if (connectedAtom.getSymbol().equals("H")) {
hCount++;
}... | [
"public",
"static",
"int",
"getExplicitHydrogenCount",
"(",
"IAtomContainer",
"atomContainer",
",",
"IAtom",
"atom",
")",
"{",
"int",
"hCount",
"=",
"0",
";",
"for",
"(",
"IAtom",
"iAtom",
":",
"atomContainer",
".",
"getConnectedAtomsList",
"(",
"atom",
")",
"... | Returns The number of explicit hydrogens for a given IAtom.
@param atomContainer
@param atom
@return The number of explicit hydrogens on the given IAtom. | [
"Returns",
"The",
"number",
"of",
"explicit",
"hydrogens",
"for",
"a",
"given",
"IAtom",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java#L188-L197 |
113,835 | cdk/cdk | legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java | ExtAtomContainerManipulator.getHydrogenCount | public static int getHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
return getExplicitHydrogenCount(atomContainer, atom) + getImplicitHydrogenCount(atom);
} | java | public static int getHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
return getExplicitHydrogenCount(atomContainer, atom) + getImplicitHydrogenCount(atom);
} | [
"public",
"static",
"int",
"getHydrogenCount",
"(",
"IAtomContainer",
"atomContainer",
",",
"IAtom",
"atom",
")",
"{",
"return",
"getExplicitHydrogenCount",
"(",
"atomContainer",
",",
"atom",
")",
"+",
"getImplicitHydrogenCount",
"(",
"atom",
")",
";",
"}"
] | The summed implicit + explicit hydrogens of the given IAtom.
@param atomContainer
@param atom
@return The summed implicit + explicit hydrogens of the given IAtom. | [
"The",
"summed",
"implicit",
"+",
"explicit",
"hydrogens",
"of",
"the",
"given",
"IAtom",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/smsd/tools/ExtAtomContainerManipulator.java#L214-L216 |
113,836 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/sgroup/Sgroup.java | Sgroup.getValue | @SuppressWarnings("unchecked")
public <T> T getValue(SgroupKey key) {
return (T) attributes.get(key);
} | java | @SuppressWarnings("unchecked")
public <T> T getValue(SgroupKey key) {
return (T) attributes.get(key);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"getValue",
"(",
"SgroupKey",
"key",
")",
"{",
"return",
"(",
"T",
")",
"attributes",
".",
"get",
"(",
"key",
")",
";",
"}"
] | Access an attribute for the Sgroup.
@param key attribute key | [
"Access",
"an",
"attribute",
"for",
"the",
"Sgroup",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/sgroup/Sgroup.java#L183-L186 |
113,837 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/sgroup/Sgroup.java | Sgroup.addBracket | public final void addBracket(SgroupBracket bracket) {
List<SgroupBracket> brackets = getValue(SgroupKey.CtabBracket);
if (brackets == null) {
putValue(SgroupKey.CtabBracket,
brackets = new ArrayList<>(2));
}
brackets.add(bracket);
} | java | public final void addBracket(SgroupBracket bracket) {
List<SgroupBracket> brackets = getValue(SgroupKey.CtabBracket);
if (brackets == null) {
putValue(SgroupKey.CtabBracket,
brackets = new ArrayList<>(2));
}
brackets.add(bracket);
} | [
"public",
"final",
"void",
"addBracket",
"(",
"SgroupBracket",
"bracket",
")",
"{",
"List",
"<",
"SgroupBracket",
">",
"brackets",
"=",
"getValue",
"(",
"SgroupKey",
".",
"CtabBracket",
")",
";",
"if",
"(",
"brackets",
"==",
"null",
")",
"{",
"putValue",
"... | Add a bracket for this Sgroup.
@param bracket sgroup bracket | [
"Add",
"a",
"bracket",
"for",
"this",
"Sgroup",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/sgroup/Sgroup.java#L209-L216 |
113,838 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.calculateScreenBounds | public Rectangle calculateScreenBounds(Rectangle2D modelBounds) {
double scale = rendererModel.getParameter(Scale.class).getValue();
double zoom = rendererModel.getParameter(ZoomFactor.class).getValue();
double margin = rendererModel.getParameter(Margin.class).getValue();
Point2d modelSc... | java | public Rectangle calculateScreenBounds(Rectangle2D modelBounds) {
double scale = rendererModel.getParameter(Scale.class).getValue();
double zoom = rendererModel.getParameter(ZoomFactor.class).getValue();
double margin = rendererModel.getParameter(Margin.class).getValue();
Point2d modelSc... | [
"public",
"Rectangle",
"calculateScreenBounds",
"(",
"Rectangle2D",
"modelBounds",
")",
"{",
"double",
"scale",
"=",
"rendererModel",
".",
"getParameter",
"(",
"Scale",
".",
"class",
")",
".",
"getValue",
"(",
")",
";",
"double",
"zoom",
"=",
"rendererModel",
... | Converts a bounding rectangle in 'model space' into the equivalent
bounds in 'screen space'. Used to determine how much space the model
will take up on screen given a particular scale, zoom, and margin.
@param modelBounds the bounds of the model
@return the bounds of the diagram as drawn on screen | [
"Converts",
"a",
"bounding",
"rectangle",
"in",
"model",
"space",
"into",
"the",
"equivalent",
"bounds",
"in",
"screen",
"space",
".",
"Used",
"to",
"determine",
"how",
"much",
"space",
"the",
"model",
"will",
"take",
"up",
"on",
"screen",
"given",
"a",
"p... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L144-L153 |
113,839 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.toModelCoordinates | public Point2d toModelCoordinates(double screenX, double screenY) {
try {
double[] dest = new double[2];
double[] src = new double[]{screenX, screenY};
transform.inverseTransform(src, 0, dest, 0, 1);
return new Point2d(dest[0], dest[1]);
} catch (Noninvert... | java | public Point2d toModelCoordinates(double screenX, double screenY) {
try {
double[] dest = new double[2];
double[] src = new double[]{screenX, screenY};
transform.inverseTransform(src, 0, dest, 0, 1);
return new Point2d(dest[0], dest[1]);
} catch (Noninvert... | [
"public",
"Point2d",
"toModelCoordinates",
"(",
"double",
"screenX",
",",
"double",
"screenY",
")",
"{",
"try",
"{",
"double",
"[",
"]",
"dest",
"=",
"new",
"double",
"[",
"2",
"]",
";",
"double",
"[",
"]",
"src",
"=",
"new",
"double",
"[",
"]",
"{",... | Convert a point in screen space into a point in model space.
@param screenX the screen x-coordinate
@param screenY the screen y-coordinate
@return the equivalent point in model space, or (0,0) if there is an error | [
"Convert",
"a",
"point",
"in",
"screen",
"space",
"into",
"a",
"point",
"in",
"model",
"space",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L162-L171 |
113,840 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.toScreenCoordinates | public Point2d toScreenCoordinates(double modelX, double modelY) {
double[] dest = new double[2];
transform.transform(new double[]{modelX, modelY}, 0, dest, 0, 1);
return new Point2d(dest[0], dest[1]);
} | java | public Point2d toScreenCoordinates(double modelX, double modelY) {
double[] dest = new double[2];
transform.transform(new double[]{modelX, modelY}, 0, dest, 0, 1);
return new Point2d(dest[0], dest[1]);
} | [
"public",
"Point2d",
"toScreenCoordinates",
"(",
"double",
"modelX",
",",
"double",
"modelY",
")",
"{",
"double",
"[",
"]",
"dest",
"=",
"new",
"double",
"[",
"2",
"]",
";",
"transform",
".",
"transform",
"(",
"new",
"double",
"[",
"]",
"{",
"modelX",
... | Convert a point in model space into a point in screen space.
@param modelX the model x-coordinate
@param modelY the model y-coordinate
@return the equivalent point in screen space | [
"Convert",
"a",
"point",
"in",
"model",
"space",
"into",
"a",
"point",
"in",
"screen",
"space",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L180-L184 |
113,841 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.shiftDrawCenter | public void shiftDrawCenter(double shiftX, double shiftY) {
drawCenter.set(drawCenter.x + shiftX, drawCenter.y + shiftY);
setup();
} | java | public void shiftDrawCenter(double shiftX, double shiftY) {
drawCenter.set(drawCenter.x + shiftX, drawCenter.y + shiftY);
setup();
} | [
"public",
"void",
"shiftDrawCenter",
"(",
"double",
"shiftX",
",",
"double",
"shiftY",
")",
"{",
"drawCenter",
".",
"set",
"(",
"drawCenter",
".",
"x",
"+",
"shiftX",
",",
"drawCenter",
".",
"y",
"+",
"shiftY",
")",
";",
"setup",
"(",
")",
";",
"}"
] | Move the draw center by dx and dy.
@param shiftX the x shift
@param shiftY the y shift | [
"Move",
"the",
"draw",
"center",
"by",
"dx",
"and",
"dy",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L260-L263 |
113,842 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.setZoomToFit | public void setZoomToFit(double drawWidth, double drawHeight, double diagramWidth, double diagramHeight) {
double margin = rendererModel.getParameter(Margin.class).getValue();
// determine the zoom needed to fit the diagram to the screen
double widthRatio = drawWidth / (diagramWidth + (2 * mar... | java | public void setZoomToFit(double drawWidth, double drawHeight, double diagramWidth, double diagramHeight) {
double margin = rendererModel.getParameter(Margin.class).getValue();
// determine the zoom needed to fit the diagram to the screen
double widthRatio = drawWidth / (diagramWidth + (2 * mar... | [
"public",
"void",
"setZoomToFit",
"(",
"double",
"drawWidth",
",",
"double",
"drawHeight",
",",
"double",
"diagramWidth",
",",
"double",
"diagramHeight",
")",
"{",
"double",
"margin",
"=",
"rendererModel",
".",
"getParameter",
"(",
"Margin",
".",
"class",
")",
... | Calculate and set the zoom factor needed to completely fit the diagram
onto the screen bounds.
@param drawWidth the width of the area to draw onto
@param drawHeight the height of the area to draw onto
@param diagramWidth the width of the diagram
@param diagramHeight the height of the diagram | [
"Calculate",
"and",
"set",
"the",
"zoom",
"factor",
"needed",
"to",
"completely",
"fit",
"the",
"diagram",
"onto",
"the",
"screen",
"bounds",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L292-L307 |
113,843 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.paint | protected void paint(IDrawVisitor drawVisitor, IRenderingElement diagram) {
if (diagram == null) return;
// cache the diagram for quick-redraw
this.cachedDiagram = diagram;
fontManager.setFontName(rendererModel.getParameter(FontName.class).getValue());
fontManager.setFontStyle(... | java | protected void paint(IDrawVisitor drawVisitor, IRenderingElement diagram) {
if (diagram == null) return;
// cache the diagram for quick-redraw
this.cachedDiagram = diagram;
fontManager.setFontName(rendererModel.getParameter(FontName.class).getValue());
fontManager.setFontStyle(... | [
"protected",
"void",
"paint",
"(",
"IDrawVisitor",
"drawVisitor",
",",
"IRenderingElement",
"diagram",
")",
"{",
"if",
"(",
"diagram",
"==",
"null",
")",
"return",
";",
"// cache the diagram for quick-redraw",
"this",
".",
"cachedDiagram",
"=",
"diagram",
";",
"fo... | The target method for paintChemModel, paintReaction, and paintMolecule.
@param drawVisitor
the visitor to draw with
@param diagram
the IRenderingElement tree to render | [
"The",
"target",
"method",
"for",
"paintChemModel",
"paintReaction",
"and",
"paintMolecule",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L326-L339 |
113,844 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.setupTransformNatural | protected void setupTransformNatural(Rectangle2D modelBounds) {
double zoom = rendererModel.getParameter(ZoomFactor.class).getValue();
this.fontManager.setFontForZoom(zoom);
this.setup();
} | java | protected void setupTransformNatural(Rectangle2D modelBounds) {
double zoom = rendererModel.getParameter(ZoomFactor.class).getValue();
this.fontManager.setFontForZoom(zoom);
this.setup();
} | [
"protected",
"void",
"setupTransformNatural",
"(",
"Rectangle2D",
"modelBounds",
")",
"{",
"double",
"zoom",
"=",
"rendererModel",
".",
"getParameter",
"(",
"ZoomFactor",
".",
"class",
")",
".",
"getValue",
"(",
")",
";",
"this",
".",
"fontManager",
".",
"setF... | Set the transform for a non-fit to screen paint.
@param modelBounds
the bounding box of the model | [
"Set",
"the",
"transform",
"for",
"a",
"non",
"-",
"fit",
"to",
"screen",
"paint",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L347-L351 |
113,845 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.convertToDiagramBounds | protected Rectangle convertToDiagramBounds(Rectangle2D modelBounds) {
double xCenter = modelBounds.getCenterX();
double yCenter = modelBounds.getCenterY();
double modelWidth = modelBounds.getWidth();
double modelHeight = modelBounds.getHeight();
double scale = rendererModel.getP... | java | protected Rectangle convertToDiagramBounds(Rectangle2D modelBounds) {
double xCenter = modelBounds.getCenterX();
double yCenter = modelBounds.getCenterY();
double modelWidth = modelBounds.getWidth();
double modelHeight = modelBounds.getHeight();
double scale = rendererModel.getP... | [
"protected",
"Rectangle",
"convertToDiagramBounds",
"(",
"Rectangle2D",
"modelBounds",
")",
"{",
"double",
"xCenter",
"=",
"modelBounds",
".",
"getCenterX",
"(",
")",
";",
"double",
"yCenter",
"=",
"modelBounds",
".",
"getCenterY",
"(",
")",
";",
"double",
"mode... | Calculate the bounds of the diagram on screen, given the current scale,
zoom, and margin.
@param modelBounds the bounds in model space of the chem object
@return the bounds in screen space of the drawn diagram | [
"Calculate",
"the",
"bounds",
"of",
"the",
"diagram",
"on",
"screen",
"given",
"the",
"current",
"scale",
"zoom",
"and",
"margin",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L411-L434 |
113,846 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java | AbstractRenderer.setupTransformToFit | void setupTransformToFit(Rectangle2D screenBounds, Rectangle2D modelBounds, boolean reset) {
double scale = rendererModel.getParameter(Scale.class).getValue();
if (screenBounds == null) return;
setDrawCenter(screenBounds.getCenterX(), screenBounds.getCenterY());
double drawWidth = sc... | java | void setupTransformToFit(Rectangle2D screenBounds, Rectangle2D modelBounds, boolean reset) {
double scale = rendererModel.getParameter(Scale.class).getValue();
if (screenBounds == null) return;
setDrawCenter(screenBounds.getCenterX(), screenBounds.getCenterY());
double drawWidth = sc... | [
"void",
"setupTransformToFit",
"(",
"Rectangle2D",
"screenBounds",
",",
"Rectangle2D",
"modelBounds",
",",
"boolean",
"reset",
")",
"{",
"double",
"scale",
"=",
"rendererModel",
".",
"getParameter",
"(",
"Scale",
".",
"class",
")",
".",
"getValue",
"(",
")",
"... | Sets the transformation needed to draw the model on the canvas when
the diagram needs to fit the screen.
@param screenBounds
the bounding box of the draw area
@param modelBounds
the bounding box of the model
@param reset
if true, model center will be set to the modelBounds center
and the scale will be re-calculated | [
"Sets",
"the",
"transformation",
"needed",
"to",
"draw",
"the",
"model",
"on",
"the",
"canvas",
"when",
"the",
"diagram",
"needs",
"to",
"fit",
"the",
"screen",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AbstractRenderer.java#L448-L471 |
113,847 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/rules/IsotopePatternRule.java | IsotopePatternRule.setParameters | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length != 2) throw new CDKException("IsotopePatternRule expects two parameter");
if (!(params[0] instanceof List)) throw new CDKException("The parameter one must be of type List<Double[]>");
if (!(params[... | java | @Override
public void setParameters(Object[] params) throws CDKException {
if (params.length != 2) throw new CDKException("IsotopePatternRule expects two parameter");
if (!(params[0] instanceof List)) throw new CDKException("The parameter one must be of type List<Double[]>");
if (!(params[... | [
"@",
"Override",
"public",
"void",
"setParameters",
"(",
"Object",
"[",
"]",
"params",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"params",
".",
"length",
"!=",
"2",
")",
"throw",
"new",
"CDKException",
"(",
"\"IsotopePatternRule expects two parameter\"",
")... | Sets the parameters attribute of the IsotopePatternRule object.
@param params The new parameters value
@throws CDKException Description of the Exception
@see #getParameters | [
"Sets",
"the",
"parameters",
"attribute",
"of",
"the",
"IsotopePatternRule",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/rules/IsotopePatternRule.java#L88-L102 |
113,848 | cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/formula/rules/IsotopePatternRule.java | IsotopePatternRule.getParameters | @Override
public Object[] getParameters() {
// return the parameters as used for the rule validation
Object[] params = new Object[2];
if (pattern == null)
params[0] = null;
else {
List<double[]> params0 = new ArrayList<double[]>();
for (IsotopeCont... | java | @Override
public Object[] getParameters() {
// return the parameters as used for the rule validation
Object[] params = new Object[2];
if (pattern == null)
params[0] = null;
else {
List<double[]> params0 = new ArrayList<double[]>();
for (IsotopeCont... | [
"@",
"Override",
"public",
"Object",
"[",
"]",
"getParameters",
"(",
")",
"{",
"// return the parameters as used for the rule validation",
"Object",
"[",
"]",
"params",
"=",
"new",
"Object",
"[",
"2",
"]",
";",
"if",
"(",
"pattern",
"==",
"null",
")",
"params"... | Gets the parameters attribute of the IsotopePatternRule object.
@return The parameters value
@see #setParameters | [
"Gets",
"the",
"parameters",
"attribute",
"of",
"the",
"IsotopePatternRule",
"object",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/formula/rules/IsotopePatternRule.java#L110-L125 |
113,849 | cdk/cdk | tool/structgen/src/main/java/org/openscience/cdk/structgen/stochastic/PartialFilledStructureMerger.java | PartialFilledStructureMerger.getAnotherUnsaturatedNode | private IAtom getAnotherUnsaturatedNode(IAtom exclusionAtom,
IAtomContainer exclusionAtomContainer,
IAtomContainerSet atomContainers) throws CDKException {
IAtom atom;
for (IAtomContainer ac : atomContainers.atomCon... | java | private IAtom getAnotherUnsaturatedNode(IAtom exclusionAtom,
IAtomContainer exclusionAtomContainer,
IAtomContainerSet atomContainers) throws CDKException {
IAtom atom;
for (IAtomContainer ac : atomContainers.atomCon... | [
"private",
"IAtom",
"getAnotherUnsaturatedNode",
"(",
"IAtom",
"exclusionAtom",
",",
"IAtomContainer",
"exclusionAtomContainer",
",",
"IAtomContainerSet",
"atomContainers",
")",
"throws",
"CDKException",
"{",
"IAtom",
"atom",
";",
"for",
"(",
"IAtomContainer",
"ac",
":"... | Gets a randomly selected unsaturated atom from the set. If there are any, it will be from another
container than exclusionAtom.
@return The unsaturated atom. | [
"Gets",
"a",
"randomly",
"selected",
"unsaturated",
"atom",
"from",
"the",
"set",
".",
"If",
"there",
"are",
"any",
"it",
"will",
"be",
"from",
"another",
"container",
"than",
"exclusionAtom",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/structgen/src/main/java/org/openscience/cdk/structgen/stochastic/PartialFilledStructureMerger.java#L123-L150 |
113,850 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AtomContainerRenderer.java | AtomContainerRenderer.setup | @Override
public void setup(IAtomContainer atomContainer, Rectangle screen) {
this.setScale(atomContainer);
Rectangle2D bounds = BoundsCalculator.calculateBounds(atomContainer);
this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY());
this.drawCenter = new Point2d(sc... | java | @Override
public void setup(IAtomContainer atomContainer, Rectangle screen) {
this.setScale(atomContainer);
Rectangle2D bounds = BoundsCalculator.calculateBounds(atomContainer);
this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY());
this.drawCenter = new Point2d(sc... | [
"@",
"Override",
"public",
"void",
"setup",
"(",
"IAtomContainer",
"atomContainer",
",",
"Rectangle",
"screen",
")",
"{",
"this",
".",
"setScale",
"(",
"atomContainer",
")",
";",
"Rectangle2D",
"bounds",
"=",
"BoundsCalculator",
".",
"calculateBounds",
"(",
"ato... | Setup the transformations necessary to draw this Atom Container.
@param atomContainer the atom container to use in the setup
@param screen the area to draw on | [
"Setup",
"the",
"transformations",
"necessary",
"to",
"draw",
"this",
"Atom",
"Container",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AtomContainerRenderer.java#L139-L146 |
113,851 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AtomContainerRenderer.java | AtomContainerRenderer.reset | public void reset() {
modelCenter = new Point2d(0, 0);
drawCenter = new Point2d(200, 200);
rendererModel.getParameter(ZoomFactor.class).setValue(1.0);
setup();
} | java | public void reset() {
modelCenter = new Point2d(0, 0);
drawCenter = new Point2d(200, 200);
rendererModel.getParameter(ZoomFactor.class).setValue(1.0);
setup();
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"modelCenter",
"=",
"new",
"Point2d",
"(",
"0",
",",
"0",
")",
";",
"drawCenter",
"=",
"new",
"Point2d",
"(",
"200",
",",
"200",
")",
";",
"rendererModel",
".",
"getParameter",
"(",
"ZoomFactor",
".",
"class",
... | Reset the draw center and model center, and set the zoom to 100%. | [
"Reset",
"the",
"draw",
"center",
"and",
"model",
"center",
"and",
"set",
"the",
"zoom",
"to",
"100%",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AtomContainerRenderer.java#L151-L156 |
113,852 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AtomContainerRenderer.java | AtomContainerRenderer.setScale | @Override
public void setScale(IAtomContainer atomContainer) {
double bondLength = GeometryUtil.getBondLengthAverage(atomContainer);
rendererModel.getParameter(Scale.class).setValue(this.calculateScaleForBondLength(bondLength));
} | java | @Override
public void setScale(IAtomContainer atomContainer) {
double bondLength = GeometryUtil.getBondLengthAverage(atomContainer);
rendererModel.getParameter(Scale.class).setValue(this.calculateScaleForBondLength(bondLength));
} | [
"@",
"Override",
"public",
"void",
"setScale",
"(",
"IAtomContainer",
"atomContainer",
")",
"{",
"double",
"bondLength",
"=",
"GeometryUtil",
".",
"getBondLengthAverage",
"(",
"atomContainer",
")",
";",
"rendererModel",
".",
"getParameter",
"(",
"Scale",
".",
"cla... | Set the scale for an IAtomContainer. It calculates the average bond
length of the model and calculates the multiplication factor to transform
this to the bond length that is set in the RendererModel.
@param atomContainer the atom container that will be drawn | [
"Set",
"the",
"scale",
"for",
"an",
"IAtomContainer",
".",
"It",
"calculates",
"the",
"average",
"bond",
"length",
"of",
"the",
"model",
"and",
"calculates",
"the",
"multiplication",
"factor",
"to",
"transform",
"this",
"to",
"the",
"bond",
"length",
"that",
... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AtomContainerRenderer.java#L165-L169 |
113,853 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AtomContainerRenderer.java | AtomContainerRenderer.estimatedBondLength | private static double estimatedBondLength(IAtomContainer container) {
if (container.getBondCount() > 0)
throw new IllegalArgumentException("structure has at least one bond - disconnected scaling not need");
if (container.getAtomCount() < 2) throw new IllegalArgumentException("structure must... | java | private static double estimatedBondLength(IAtomContainer container) {
if (container.getBondCount() > 0)
throw new IllegalArgumentException("structure has at least one bond - disconnected scaling not need");
if (container.getAtomCount() < 2) throw new IllegalArgumentException("structure must... | [
"private",
"static",
"double",
"estimatedBondLength",
"(",
"IAtomContainer",
"container",
")",
"{",
"if",
"(",
"container",
".",
"getBondCount",
"(",
")",
">",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"structure has at least one bond - disconnected s... | Determine an estimated bond length for disconnected structures. The
distance between all atoms is measured and then the minimum distance is
divided by 1.5. This length is required for scaling renderings.
@param container a chemical structure with no bonds at at least 2 atoms
@return the estimated bond length
@throws I... | [
"Determine",
"an",
"estimated",
"bond",
"length",
"for",
"disconnected",
"structures",
".",
"The",
"distance",
"between",
"all",
"atoms",
"is",
"measured",
"and",
"then",
"the",
"minimum",
"distance",
"is",
"divided",
"by",
"1",
".",
"5",
".",
"This",
"lengt... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AtomContainerRenderer.java#L197-L212 |
113,854 | cdk/cdk | storage/libiomd/src/main/java/org/openscience/cdk/libio/md/MDMolecule.java | MDMolecule.addResidue | public void addResidue(Residue residue) {
if (residues == null) residues = new ArrayList<Residue>();
//Check if exists
if (residues.contains(residue)) {
System.out.println("Residue: " + residue.getName() + " already present in molecule: " + getID());
return;
}
... | java | public void addResidue(Residue residue) {
if (residues == null) residues = new ArrayList<Residue>();
//Check if exists
if (residues.contains(residue)) {
System.out.println("Residue: " + residue.getName() + " already present in molecule: " + getID());
return;
}
... | [
"public",
"void",
"addResidue",
"(",
"Residue",
"residue",
")",
"{",
"if",
"(",
"residues",
"==",
"null",
")",
"residues",
"=",
"new",
"ArrayList",
"<",
"Residue",
">",
"(",
")",
";",
"//Check if exists",
"if",
"(",
"residues",
".",
"contains",
"(",
"res... | Add a Residue to the MDMolecule if not already present.
@param residue Residue to add | [
"Add",
"a",
"Residue",
"to",
"the",
"MDMolecule",
"if",
"not",
"already",
"present",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/libiomd/src/main/java/org/openscience/cdk/libio/md/MDMolecule.java#L68-L78 |
113,855 | cdk/cdk | storage/libiomd/src/main/java/org/openscience/cdk/libio/md/MDMolecule.java | MDMolecule.addChargeGroup | public void addChargeGroup(ChargeGroup chargeGroup) {
if (chargeGroups == null) chargeGroups = new ArrayList<ChargeGroup>();
//Check if exists
if (chargeGroups.contains(chargeGroup)) {
System.out.println("Charge group: " + chargeGroup.getNumber() + " already present in molecule: " +... | java | public void addChargeGroup(ChargeGroup chargeGroup) {
if (chargeGroups == null) chargeGroups = new ArrayList<ChargeGroup>();
//Check if exists
if (chargeGroups.contains(chargeGroup)) {
System.out.println("Charge group: " + chargeGroup.getNumber() + " already present in molecule: " +... | [
"public",
"void",
"addChargeGroup",
"(",
"ChargeGroup",
"chargeGroup",
")",
"{",
"if",
"(",
"chargeGroups",
"==",
"null",
")",
"chargeGroups",
"=",
"new",
"ArrayList",
"<",
"ChargeGroup",
">",
"(",
")",
";",
"//Check if exists",
"if",
"(",
"chargeGroups",
".",... | Add a ChargeGroup to the MDMolecule if not already present.
@param chargeGroup {@link ChargeGroup} to add | [
"Add",
"a",
"ChargeGroup",
"to",
"the",
"MDMolecule",
"if",
"not",
"already",
"present",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/libiomd/src/main/java/org/openscience/cdk/libio/md/MDMolecule.java#L93-L103 |
113,856 | cdk/cdk | base/interfaces/src/main/java/org/openscience/cdk/io/listener/PropertiesListener.java | PropertiesListener.setOutputWriter | public void setOutputWriter(Writer writer) {
if (writer instanceof PrintWriter) {
this.out = (PrintWriter) writer;
} else if (writer == null) {
this.out = null;
} else {
this.out = new PrintWriter(writer);
}
} | java | public void setOutputWriter(Writer writer) {
if (writer instanceof PrintWriter) {
this.out = (PrintWriter) writer;
} else if (writer == null) {
this.out = null;
} else {
this.out = new PrintWriter(writer);
}
} | [
"public",
"void",
"setOutputWriter",
"(",
"Writer",
"writer",
")",
"{",
"if",
"(",
"writer",
"instanceof",
"PrintWriter",
")",
"{",
"this",
".",
"out",
"=",
"(",
"PrintWriter",
")",
"writer",
";",
"}",
"else",
"if",
"(",
"writer",
"==",
"null",
")",
"{... | Overwrites the default writer to which the output is directed. | [
"Overwrites",
"the",
"default",
"writer",
"to",
"which",
"the",
"output",
"is",
"directed",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/interfaces/src/main/java/org/openscience/cdk/io/listener/PropertiesListener.java#L61-L69 |
113,857 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java | LonePairElectronChecker.allSaturated | public boolean allSaturated(IAtomContainer ac) throws CDKException {
logger.debug("Are all atoms saturated?");
for (int f = 0; f < ac.getAtomCount(); f++) {
if (!isSaturated(ac.getAtom(f), ac)) return false;
}
return true;
} | java | public boolean allSaturated(IAtomContainer ac) throws CDKException {
logger.debug("Are all atoms saturated?");
for (int f = 0; f < ac.getAtomCount(); f++) {
if (!isSaturated(ac.getAtom(f), ac)) return false;
}
return true;
} | [
"public",
"boolean",
"allSaturated",
"(",
"IAtomContainer",
"ac",
")",
"throws",
"CDKException",
"{",
"logger",
".",
"debug",
"(",
"\"Are all atoms saturated?\"",
")",
";",
"for",
"(",
"int",
"f",
"=",
"0",
";",
"f",
"<",
"ac",
".",
"getAtomCount",
"(",
")... | Determines of all atoms on the AtomContainer have
the right number the lone pair electrons. | [
"Determines",
"of",
"all",
"atoms",
"on",
"the",
"AtomContainer",
"have",
"the",
"right",
"number",
"the",
"lone",
"pair",
"electrons",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java#L66-L72 |
113,858 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java | LonePairElectronChecker.isSaturated | public boolean isSaturated(IAtom atom, IAtomContainer ac) throws CDKException {
createAtomTypeFactory(ac.getBuilder());
IAtomType atomType = factory.getAtomType(atom.getAtomTypeName());
int lpCount = (Integer) atomType.getProperty(CDKConstants.LONE_PAIR_COUNT);
int foundLPCount = ac.getC... | java | public boolean isSaturated(IAtom atom, IAtomContainer ac) throws CDKException {
createAtomTypeFactory(ac.getBuilder());
IAtomType atomType = factory.getAtomType(atom.getAtomTypeName());
int lpCount = (Integer) atomType.getProperty(CDKConstants.LONE_PAIR_COUNT);
int foundLPCount = ac.getC... | [
"public",
"boolean",
"isSaturated",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"ac",
")",
"throws",
"CDKException",
"{",
"createAtomTypeFactory",
"(",
"ac",
".",
"getBuilder",
"(",
")",
")",
";",
"IAtomType",
"atomType",
"=",
"factory",
".",
"getAtomType",
"... | Checks if an Atom is saturated their lone pair electrons
by comparing it with known AtomTypes.
@return True, if it's right saturated | [
"Checks",
"if",
"an",
"Atom",
"is",
"saturated",
"their",
"lone",
"pair",
"electrons",
"by",
"comparing",
"it",
"with",
"known",
"AtomTypes",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java#L80-L86 |
113,859 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java | LonePairElectronChecker.saturate | public void saturate(IAtomContainer atomContainer) throws CDKException {
logger.info("Saturating atomContainer by adjusting lone pair electrons...");
boolean allSaturated = allSaturated(atomContainer);
if (!allSaturated) {
for (int i = 0; i < atomContainer.getAtomCount(); i++) {
... | java | public void saturate(IAtomContainer atomContainer) throws CDKException {
logger.info("Saturating atomContainer by adjusting lone pair electrons...");
boolean allSaturated = allSaturated(atomContainer);
if (!allSaturated) {
for (int i = 0; i < atomContainer.getAtomCount(); i++) {
... | [
"public",
"void",
"saturate",
"(",
"IAtomContainer",
"atomContainer",
")",
"throws",
"CDKException",
"{",
"logger",
".",
"info",
"(",
"\"Saturating atomContainer by adjusting lone pair electrons...\"",
")",
";",
"boolean",
"allSaturated",
"=",
"allSaturated",
"(",
"atomCo... | Saturates a molecule by setting appropriate number lone pair electrons. | [
"Saturates",
"a",
"molecule",
"by",
"setting",
"appropriate",
"number",
"lone",
"pair",
"electrons",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java#L91-L99 |
113,860 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java | LonePairElectronChecker.saturate | public void saturate(IAtom atom, IAtomContainer ac) throws CDKException {
logger.info("Saturating atom by adjusting lone pair electrons...");
IAtomType atomType = factory.getAtomType(atom.getAtomTypeName());
int lpCount = (Integer) atomType.getProperty(CDKConstants.LONE_PAIR_COUNT);
int ... | java | public void saturate(IAtom atom, IAtomContainer ac) throws CDKException {
logger.info("Saturating atom by adjusting lone pair electrons...");
IAtomType atomType = factory.getAtomType(atom.getAtomTypeName());
int lpCount = (Integer) atomType.getProperty(CDKConstants.LONE_PAIR_COUNT);
int ... | [
"public",
"void",
"saturate",
"(",
"IAtom",
"atom",
",",
"IAtomContainer",
"ac",
")",
"throws",
"CDKException",
"{",
"logger",
".",
"info",
"(",
"\"Saturating atom by adjusting lone pair electrons...\"",
")",
";",
"IAtomType",
"atomType",
"=",
"factory",
".",
"getAt... | Saturates an IAtom by adding the appropriate number lone pairs. | [
"Saturates",
"an",
"IAtom",
"by",
"adding",
"the",
"appropriate",
"number",
"lone",
"pairs",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/LonePairElectronChecker.java#L104-L114 |
113,861 | cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/StabilizationCharges.java | StabilizationCharges.calculatePositive | public double calculatePositive(IAtomContainer atomContainer, IAtom atom) {
/* restrictions */
// if(atomContainer.getConnectedSingleElectronsCount(atom) > 0 || atom.getFormalCharge() != 1){
if (atom.getFormalCharge() != 1) {
return 0.0;
}
// only must be generat... | java | public double calculatePositive(IAtomContainer atomContainer, IAtom atom) {
/* restrictions */
// if(atomContainer.getConnectedSingleElectronsCount(atom) > 0 || atom.getFormalCharge() != 1){
if (atom.getFormalCharge() != 1) {
return 0.0;
}
// only must be generat... | [
"public",
"double",
"calculatePositive",
"(",
"IAtomContainer",
"atomContainer",
",",
"IAtom",
"atom",
")",
"{",
"/* restrictions */",
"// \tif(atomContainer.getConnectedSingleElectronsCount(atom) > 0 || atom.getFormalCharge() != 1){",
"if",
"(",
"atom",
".",
"getFormalCharge",
... | calculate the stabilization of orbitals when they contain deficiency of charge.
@param atomContainer the molecule to be considered
@param atom IAtom for which effective atom StabilizationCharges
factor should be calculated
@return stabilizationValue | [
"calculate",
"the",
"stabilization",
"of",
"orbitals",
"when",
"they",
"contain",
"deficiency",
"of",
"charge",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/StabilizationCharges.java#L61-L123 |
113,862 | cdk/cdk | descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/AtomCountDescriptor.java | AtomCountDescriptor.calculate | @Override
public DescriptorValue calculate(IAtomContainer container) {
int atomCount = 0;
if (container == null) {
return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
(int) Double.NaN), getDescriptorNames(), new CDK... | java | @Override
public DescriptorValue calculate(IAtomContainer container) {
int atomCount = 0;
if (container == null) {
return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
(int) Double.NaN), getDescriptorNames(), new CDK... | [
"@",
"Override",
"public",
"DescriptorValue",
"calculate",
"(",
"IAtomContainer",
"container",
")",
"{",
"int",
"atomCount",
"=",
"0",
";",
"if",
"(",
"container",
"==",
"null",
")",
"{",
"return",
"new",
"DescriptorValue",
"(",
"getSpecification",
"(",
")",
... | this could be useful for other descriptors like polar surface area... | [
"this",
"could",
"be",
"useful",
"for",
"other",
"descriptors",
"like",
"polar",
"surface",
"area",
"..."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/molecular/AtomCountDescriptor.java#L144-L186 |
113,863 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java | HOSECodeGenerator.createCode | private void createCode() throws CDKException {
List<TreeNode> sphereNodes = null;
TreeNode tn = null;
for (int f = 0; f < atomContainer.getAtomCount(); f++) {
atomContainer.getAtom(f).setFlag(CDKConstants.VISITED, false);
}
for (int f = 0; f < maxSphere; f++) {
... | java | private void createCode() throws CDKException {
List<TreeNode> sphereNodes = null;
TreeNode tn = null;
for (int f = 0; f < atomContainer.getAtomCount(); f++) {
atomContainer.getAtom(f).setFlag(CDKConstants.VISITED, false);
}
for (int f = 0; f < maxSphere; f++) {
... | [
"private",
"void",
"createCode",
"(",
")",
"throws",
"CDKException",
"{",
"List",
"<",
"TreeNode",
">",
"sphereNodes",
"=",
"null",
";",
"TreeNode",
"tn",
"=",
"null",
";",
"for",
"(",
"int",
"f",
"=",
"0",
";",
"f",
"<",
"atomContainer",
".",
"getAtom... | After recursively having established the spheres and assigning each node an
appropriate score, we now generate the complete HOSE code.
@exception org.openscience.cdk.exception.CDKException Thrown if something goes wrong | [
"After",
"recursively",
"having",
"established",
"the",
"spheres",
"and",
"assigning",
"each",
"node",
"an",
"appropriate",
"score",
"we",
"now",
"generate",
"the",
"complete",
"HOSE",
"code",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java#L432-L483 |
113,864 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java | HOSECodeGenerator.getSphereCode | private String getSphereCode(List<TreeNode> sphereNodes) throws CDKException {
if (sphereNodes == null || sphereNodes.size() < 1) {
return sphereDelimiters[sphere - 1];
}
TreeNode treeNode = null;
StringBuffer code = new StringBuffer();
/*
* append the tree n... | java | private String getSphereCode(List<TreeNode> sphereNodes) throws CDKException {
if (sphereNodes == null || sphereNodes.size() < 1) {
return sphereDelimiters[sphere - 1];
}
TreeNode treeNode = null;
StringBuffer code = new StringBuffer();
/*
* append the tree n... | [
"private",
"String",
"getSphereCode",
"(",
"List",
"<",
"TreeNode",
">",
"sphereNodes",
")",
"throws",
"CDKException",
"{",
"if",
"(",
"sphereNodes",
"==",
"null",
"||",
"sphereNodes",
".",
"size",
"(",
")",
"<",
"1",
")",
"{",
"return",
"sphereDelimiters",
... | Generates the string code for a given sphere.
@param sphereNodes A vector of TreeNodes for which a string code is to be generated
@return The SphereCode value
@exception org.openscience.cdk.exception.CDKException Thrown if something goes wrong | [
"Generates",
"the",
"string",
"code",
"for",
"a",
"given",
"sphere",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java#L492-L532 |
113,865 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java | HOSECodeGenerator.getElementRank | private double getElementRank(String symbol) {
for (int f = 0; f < rankedSymbols.length; f++) {
if (rankedSymbols[f].equals(symbol)) {
return symbolRankings[f];
}
}
IIsotope isotope = isotopeFac.getMajorIsotope(symbol);
if (isotope.getMassNumber() ... | java | private double getElementRank(String symbol) {
for (int f = 0; f < rankedSymbols.length; f++) {
if (rankedSymbols[f].equals(symbol)) {
return symbolRankings[f];
}
}
IIsotope isotope = isotopeFac.getMajorIsotope(symbol);
if (isotope.getMassNumber() ... | [
"private",
"double",
"getElementRank",
"(",
"String",
"symbol",
")",
"{",
"for",
"(",
"int",
"f",
"=",
"0",
";",
"f",
"<",
"rankedSymbols",
".",
"length",
";",
"f",
"++",
")",
"{",
"if",
"(",
"rankedSymbols",
"[",
"f",
"]",
".",
"equals",
"(",
"sym... | Gets the element rank for a given element symbol as given in Bremser's
publication.
@param symbol The element symbol for which the rank is to be determined
@return The element rank | [
"Gets",
"the",
"element",
"rank",
"for",
"a",
"given",
"element",
"symbol",
"as",
"given",
"in",
"Bremser",
"s",
"publication",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java#L541-L552 |
113,866 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java | HOSECodeGenerator.calculateNodeScores | private void calculateNodeScores(List<TreeNode> sphereNodes) throws CDKException {
TreeNode treeNode = null;
for (int i = 0; i < sphereNodes.size(); i++) {
treeNode = (TreeNode) sphereNodes.get(i);
treeNode.score += getElementRank(treeNode.symbol);
if (treeNode.bondTy... | java | private void calculateNodeScores(List<TreeNode> sphereNodes) throws CDKException {
TreeNode treeNode = null;
for (int i = 0; i < sphereNodes.size(); i++) {
treeNode = (TreeNode) sphereNodes.get(i);
treeNode.score += getElementRank(treeNode.symbol);
if (treeNode.bondTy... | [
"private",
"void",
"calculateNodeScores",
"(",
"List",
"<",
"TreeNode",
">",
"sphereNodes",
")",
"throws",
"CDKException",
"{",
"TreeNode",
"treeNode",
"=",
"null",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"sphereNodes",
".",
"size",
"(",
")... | Determines the ranking score for each node, allowing for a sorting of nodes
within one sphere.
@param sphereNodes The nodes for which the score is to be calculated.
@exception org.openscience.cdk.exception.CDKException Thrown if something goes wrong. | [
"Determines",
"the",
"ranking",
"score",
"for",
"each",
"node",
"allowing",
"for",
"a",
"sorting",
"of",
"nodes",
"within",
"one",
"sphere",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java#L584-L595 |
113,867 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java | HOSECodeGenerator.fillUpSphereDelimiters | private void fillUpSphereDelimiters() {
logger.debug("Sphere: " + sphere);
for (int f = sphere; f < 4; f++) {
HOSECode.append(sphereDelimiters[f]);
}
} | java | private void fillUpSphereDelimiters() {
logger.debug("Sphere: " + sphere);
for (int f = sphere; f < 4; f++) {
HOSECode.append(sphereDelimiters[f]);
}
} | [
"private",
"void",
"fillUpSphereDelimiters",
"(",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Sphere: \"",
"+",
"sphere",
")",
";",
"for",
"(",
"int",
"f",
"=",
"sphere",
";",
"f",
"<",
"4",
";",
"f",
"++",
")",
"{",
"HOSECode",
".",
"append",
"(",
"... | If we use less than four sphere, this fills up the code with the missing
delimiters such that we are compatible with Bremser's HOSE code table. | [
"If",
"we",
"use",
"less",
"than",
"four",
"sphere",
"this",
"fills",
"up",
"the",
"code",
"with",
"the",
"missing",
"delimiters",
"such",
"that",
"we",
"are",
"compatible",
"with",
"Bremser",
"s",
"HOSE",
"code",
"table",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/HOSECodeGenerator.java#L634-L639 |
113,868 | cdk/cdk | tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreAngleBond.java | PharmacophoreAngleBond.getBondLength | public double getBondLength() {
double epsilon = 1e-3;
PharmacophoreAtom atom1 = (PharmacophoreAtom) getAtom(0);
PharmacophoreAtom atom2 = (PharmacophoreAtom) getAtom(1);
PharmacophoreAtom atom3 = (PharmacophoreAtom) getAtom(2);
double a2 = atom3.getPoint3d().distanceSquared(ato... | java | public double getBondLength() {
double epsilon = 1e-3;
PharmacophoreAtom atom1 = (PharmacophoreAtom) getAtom(0);
PharmacophoreAtom atom2 = (PharmacophoreAtom) getAtom(1);
PharmacophoreAtom atom3 = (PharmacophoreAtom) getAtom(2);
double a2 = atom3.getPoint3d().distanceSquared(ato... | [
"public",
"double",
"getBondLength",
"(",
")",
"{",
"double",
"epsilon",
"=",
"1e-3",
";",
"PharmacophoreAtom",
"atom1",
"=",
"(",
"PharmacophoreAtom",
")",
"getAtom",
"(",
"0",
")",
";",
"PharmacophoreAtom",
"atom2",
"=",
"(",
"PharmacophoreAtom",
")",
"getAt... | Get the angle between the three pharmacophore groups that make up the constraint.
@return The angle in degrees between the two groups | [
"Get",
"the",
"angle",
"between",
"the",
"three",
"pharmacophore",
"groups",
"that",
"make",
"up",
"the",
"constraint",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreAngleBond.java#L51-L66 |
113,869 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.getAtomCount | public static int getAtomCount(IChemModel chemModel) {
int count = 0;
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
count += crystal.getAtomCount();
}
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
if (moleculeSet != null) {
... | java | public static int getAtomCount(IChemModel chemModel) {
int count = 0;
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
count += crystal.getAtomCount();
}
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
if (moleculeSet != null) {
... | [
"public",
"static",
"int",
"getAtomCount",
"(",
"IChemModel",
"chemModel",
")",
"{",
"int",
"count",
"=",
"0",
";",
"ICrystal",
"crystal",
"=",
"chemModel",
".",
"getCrystal",
"(",
")",
";",
"if",
"(",
"crystal",
"!=",
"null",
")",
"{",
"count",
"+=",
... | Get the total number of atoms inside an IChemModel.
@param chemModel The IChemModel object.
@return The number of Atom object inside. | [
"Get",
"the",
"total",
"number",
"of",
"atoms",
"inside",
"an",
"IChemModel",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L62-L77 |
113,870 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.removeAtomAndConnectedElectronContainers | public static void removeAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom) {
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
if (crystal.contains(atom)) {
crystal.removeAtom(atom);
}
return;
}
IAtomC... | java | public static void removeAtomAndConnectedElectronContainers(IChemModel chemModel, IAtom atom) {
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
if (crystal.contains(atom)) {
crystal.removeAtom(atom);
}
return;
}
IAtomC... | [
"public",
"static",
"void",
"removeAtomAndConnectedElectronContainers",
"(",
"IChemModel",
"chemModel",
",",
"IAtom",
"atom",
")",
"{",
"ICrystal",
"crystal",
"=",
"chemModel",
".",
"getCrystal",
"(",
")",
";",
"if",
"(",
"crystal",
"!=",
"null",
")",
"{",
"if... | Remove an Atom and the connected ElectronContainers from all AtomContainers
inside an IChemModel.
@param chemModel The IChemModel object.
@param atom The Atom object to remove. | [
"Remove",
"an",
"Atom",
"and",
"the",
"connected",
"ElectronContainers",
"from",
"all",
"AtomContainers",
"inside",
"an",
"IChemModel",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L110-L126 |
113,871 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.removeElectronContainer | public static void removeElectronContainer(IChemModel chemModel, IElectronContainer electrons) {
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
if (crystal.contains(electrons)) {
crystal.removeElectronContainer(electrons);
}
return;
... | java | public static void removeElectronContainer(IChemModel chemModel, IElectronContainer electrons) {
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
if (crystal.contains(electrons)) {
crystal.removeElectronContainer(electrons);
}
return;
... | [
"public",
"static",
"void",
"removeElectronContainer",
"(",
"IChemModel",
"chemModel",
",",
"IElectronContainer",
"electrons",
")",
"{",
"ICrystal",
"crystal",
"=",
"chemModel",
".",
"getCrystal",
"(",
")",
";",
"if",
"(",
"crystal",
"!=",
"null",
")",
"{",
"i... | Remove an ElectronContainer from all AtomContainers
inside an IChemModel.
@param chemModel The IChemModel object.
@param electrons The ElectronContainer to remove. | [
"Remove",
"an",
"ElectronContainer",
"from",
"all",
"AtomContainers",
"inside",
"an",
"IChemModel",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L135-L151 |
113,872 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.createNewMolecule | public static IAtomContainer createNewMolecule(IChemModel chemModel) {
// Add a new molecule either the set of molecules
IAtomContainer molecule = chemModel.getBuilder().newInstance(IAtomContainer.class);
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemM... | java | public static IAtomContainer createNewMolecule(IChemModel chemModel) {
// Add a new molecule either the set of molecules
IAtomContainer molecule = chemModel.getBuilder().newInstance(IAtomContainer.class);
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemM... | [
"public",
"static",
"IAtomContainer",
"createNewMolecule",
"(",
"IChemModel",
"chemModel",
")",
"{",
"// Add a new molecule either the set of molecules",
"IAtomContainer",
"molecule",
"=",
"chemModel",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IAtomContainer",
... | Adds a new Molecule to the MoleculeSet inside a given ChemModel.
Creates a MoleculeSet if none is contained.
@param chemModel The ChemModel object.
@return The created Molecule object. | [
"Adds",
"a",
"new",
"Molecule",
"to",
"the",
"MoleculeSet",
"inside",
"a",
"given",
"ChemModel",
".",
"Creates",
"a",
"MoleculeSet",
"if",
"none",
"is",
"contained",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L160-L178 |
113,873 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.getRelevantAtomContainer | public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IAtom atom) {
IAtomContainer result = null;
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
result = MoleculeSetManipulator.getRelevantAtomContainer(m... | java | public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IAtom atom) {
IAtomContainer result = null;
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
result = MoleculeSetManipulator.getRelevantAtomContainer(m... | [
"public",
"static",
"IAtomContainer",
"getRelevantAtomContainer",
"(",
"IChemModel",
"chemModel",
",",
"IAtom",
"atom",
")",
"{",
"IAtomContainer",
"result",
"=",
"null",
";",
"if",
"(",
"chemModel",
".",
"getMoleculeSet",
"(",
")",
"!=",
"null",
")",
"{",
"IA... | This badly named methods tries to determine which AtomContainer in the
ChemModel is best suited to contain added Atom's and Bond's. | [
"This",
"badly",
"named",
"methods",
"tries",
"to",
"determine",
"which",
"AtomContainer",
"in",
"the",
"ChemModel",
"is",
"best",
"suited",
"to",
"contain",
"added",
"Atom",
"s",
"and",
"Bond",
"s",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L200-L220 |
113,874 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.getRelevantAtomContainer | public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IBond bond) {
IAtomContainer result = null;
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
result = MoleculeSetManipulator.getRelevantAtomContainer(m... | java | public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IBond bond) {
IAtomContainer result = null;
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
result = MoleculeSetManipulator.getRelevantAtomContainer(m... | [
"public",
"static",
"IAtomContainer",
"getRelevantAtomContainer",
"(",
"IChemModel",
"chemModel",
",",
"IBond",
"bond",
")",
"{",
"IAtomContainer",
"result",
"=",
"null",
";",
"if",
"(",
"chemModel",
".",
"getMoleculeSet",
"(",
")",
"!=",
"null",
")",
"{",
"IA... | Retrieves the first IAtomContainer containing a given IBond from an
IChemModel.
@param chemModel The IChemModel object.
@param bond The IBond object to search.
@return The IAtomContainer object found, null if none is found. | [
"Retrieves",
"the",
"first",
"IAtomContainer",
"containing",
"a",
"given",
"IBond",
"from",
"an",
"IChemModel",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L230-L245 |
113,875 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.getRelevantReaction | public static IReaction getRelevantReaction(IChemModel chemModel, IAtom atom) {
IReaction reaction = null;
if (chemModel.getReactionSet() != null) {
IReactionSet reactionSet = chemModel.getReactionSet();
reaction = ReactionSetManipulator.getRelevantReaction(reactionSet, atom);
... | java | public static IReaction getRelevantReaction(IChemModel chemModel, IAtom atom) {
IReaction reaction = null;
if (chemModel.getReactionSet() != null) {
IReactionSet reactionSet = chemModel.getReactionSet();
reaction = ReactionSetManipulator.getRelevantReaction(reactionSet, atom);
... | [
"public",
"static",
"IReaction",
"getRelevantReaction",
"(",
"IChemModel",
"chemModel",
",",
"IAtom",
"atom",
")",
"{",
"IReaction",
"reaction",
"=",
"null",
";",
"if",
"(",
"chemModel",
".",
"getReactionSet",
"(",
")",
"!=",
"null",
")",
"{",
"IReactionSet",
... | Retrieves the first IReaction containing a given IAtom from an
IChemModel.
@param chemModel The IChemModel object.
@param atom The IAtom object to search.
@return The IAtomContainer object found, null if none is found. | [
"Retrieves",
"the",
"first",
"IReaction",
"containing",
"a",
"given",
"IAtom",
"from",
"an",
"IChemModel",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L255-L262 |
113,876 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.getAllAtomContainers | public static List<IAtomContainer> getAllAtomContainers(IChemModel chemModel) {
IAtomContainerSet moleculeSet = chemModel.getBuilder().newInstance(IAtomContainerSet.class);
if (chemModel.getMoleculeSet() != null) {
moleculeSet.add(chemModel.getMoleculeSet());
}
if (chemModel.... | java | public static List<IAtomContainer> getAllAtomContainers(IChemModel chemModel) {
IAtomContainerSet moleculeSet = chemModel.getBuilder().newInstance(IAtomContainerSet.class);
if (chemModel.getMoleculeSet() != null) {
moleculeSet.add(chemModel.getMoleculeSet());
}
if (chemModel.... | [
"public",
"static",
"List",
"<",
"IAtomContainer",
">",
"getAllAtomContainers",
"(",
"IChemModel",
"chemModel",
")",
"{",
"IAtomContainerSet",
"moleculeSet",
"=",
"chemModel",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IAtomContainerSet",
".",
"class",
... | Returns all the AtomContainer's of a ChemModel. | [
"Returns",
"all",
"the",
"AtomContainer",
"s",
"of",
"a",
"ChemModel",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L267-L276 |
113,877 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.setAtomProperties | public static void setAtomProperties(IChemModel chemModel, Object propKey, Object propVal) {
if (chemModel.getMoleculeSet() != null) {
MoleculeSetManipulator.setAtomProperties(chemModel.getMoleculeSet(), propKey, propVal);
}
if (chemModel.getReactionSet() != null) {
React... | java | public static void setAtomProperties(IChemModel chemModel, Object propKey, Object propVal) {
if (chemModel.getMoleculeSet() != null) {
MoleculeSetManipulator.setAtomProperties(chemModel.getMoleculeSet(), propKey, propVal);
}
if (chemModel.getReactionSet() != null) {
React... | [
"public",
"static",
"void",
"setAtomProperties",
"(",
"IChemModel",
"chemModel",
",",
"Object",
"propKey",
",",
"Object",
"propVal",
")",
"{",
"if",
"(",
"chemModel",
".",
"getMoleculeSet",
"(",
")",
"!=",
"null",
")",
"{",
"MoleculeSetManipulator",
".",
"setA... | Sets the AtomProperties of all Atoms inside an IChemModel.
@param chemModel The IChemModel object.
@param propKey The key of the property.
@param propVal The value of the property. | [
"Sets",
"the",
"AtomProperties",
"of",
"all",
"Atoms",
"inside",
"an",
"IChemModel",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L285-L295 |
113,878 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.getAllChemObjects | public static List<IChemObject> getAllChemObjects(IChemModel chemModel) {
List<IChemObject> list = new ArrayList<IChemObject>();
// list.add(chemModel); // only add ChemObjects contained within
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
list.add(crystal... | java | public static List<IChemObject> getAllChemObjects(IChemModel chemModel) {
List<IChemObject> list = new ArrayList<IChemObject>();
// list.add(chemModel); // only add ChemObjects contained within
ICrystal crystal = chemModel.getCrystal();
if (crystal != null) {
list.add(crystal... | [
"public",
"static",
"List",
"<",
"IChemObject",
">",
"getAllChemObjects",
"(",
"IChemModel",
"chemModel",
")",
"{",
"List",
"<",
"IChemObject",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"IChemObject",
">",
"(",
")",
";",
"// list.add(chemModel); // only add ChemO... | Retrieve a List of all ChemObject objects within an IChemModel.
@param chemModel The IChemModel object.
@return A List of all ChemObjects inside. | [
"Retrieve",
"a",
"List",
"of",
"all",
"ChemObject",
"objects",
"within",
"an",
"IChemModel",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L303-L327 |
113,879 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AverageBondLengthCalculator.java | AverageBondLengthCalculator.calculateAverageBondLength | public static double calculateAverageBondLength(IReaction reaction) {
IAtomContainerSet reactants = reaction.getReactants();
double reactantAverage = 0.0;
if (reactants != null) {
reactantAverage = calculateAverageBondLength(reactants) / reactants.getAtomContainerCount();
}
... | java | public static double calculateAverageBondLength(IReaction reaction) {
IAtomContainerSet reactants = reaction.getReactants();
double reactantAverage = 0.0;
if (reactants != null) {
reactantAverage = calculateAverageBondLength(reactants) / reactants.getAtomContainerCount();
}
... | [
"public",
"static",
"double",
"calculateAverageBondLength",
"(",
"IReaction",
"reaction",
")",
"{",
"IAtomContainerSet",
"reactants",
"=",
"reaction",
".",
"getReactants",
"(",
")",
";",
"double",
"reactantAverage",
"=",
"0.0",
";",
"if",
"(",
"reactants",
"!=",
... | Calculate the average bond length for the bonds in a reaction.
@param reaction the reaction to use
@return the average bond length | [
"Calculate",
"the",
"average",
"bond",
"length",
"for",
"the",
"bonds",
"in",
"a",
"reaction",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AverageBondLengthCalculator.java#L47-L66 |
113,880 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AverageBondLengthCalculator.java | AverageBondLengthCalculator.calculateAverageBondLength | public static double calculateAverageBondLength(IAtomContainerSet moleculeSet) {
double averageBondModelLength = 0.0;
for (IAtomContainer atomContainer : moleculeSet.atomContainers()) {
averageBondModelLength += GeometryUtil.getBondLengthAverage(atomContainer);
}
return avera... | java | public static double calculateAverageBondLength(IAtomContainerSet moleculeSet) {
double averageBondModelLength = 0.0;
for (IAtomContainer atomContainer : moleculeSet.atomContainers()) {
averageBondModelLength += GeometryUtil.getBondLengthAverage(atomContainer);
}
return avera... | [
"public",
"static",
"double",
"calculateAverageBondLength",
"(",
"IAtomContainerSet",
"moleculeSet",
")",
"{",
"double",
"averageBondModelLength",
"=",
"0.0",
";",
"for",
"(",
"IAtomContainer",
"atomContainer",
":",
"moleculeSet",
".",
"atomContainers",
"(",
")",
")",... | Calculate the average bond length for the bonds in a molecule set.
@param moleculeSet the molecule set to use
@return the average bond length | [
"Calculate",
"the",
"average",
"bond",
"length",
"for",
"the",
"bonds",
"in",
"a",
"molecule",
"set",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AverageBondLengthCalculator.java#L74-L80 |
113,881 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AverageBondLengthCalculator.java | AverageBondLengthCalculator.calculateAverageBondLength | public static double calculateAverageBondLength(IChemModel model) {
// empty models have to have a scale
IAtomContainerSet moleculeSet = model.getMoleculeSet();
if (moleculeSet == null) {
IReactionSet reactionSet = model.getReactionSet();
if (reactionSet != null) {
... | java | public static double calculateAverageBondLength(IChemModel model) {
// empty models have to have a scale
IAtomContainerSet moleculeSet = model.getMoleculeSet();
if (moleculeSet == null) {
IReactionSet reactionSet = model.getReactionSet();
if (reactionSet != null) {
... | [
"public",
"static",
"double",
"calculateAverageBondLength",
"(",
"IChemModel",
"model",
")",
"{",
"// empty models have to have a scale",
"IAtomContainerSet",
"moleculeSet",
"=",
"model",
".",
"getMoleculeSet",
"(",
")",
";",
"if",
"(",
"moleculeSet",
"==",
"null",
")... | Calculate the average bond length for the bonds in a chem model.
@param model the model for which to calculate the average bond length
@return the average bond length | [
"Calculate",
"the",
"average",
"bond",
"length",
"for",
"the",
"bonds",
"in",
"a",
"chem",
"model",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AverageBondLengthCalculator.java#L88-L101 |
113,882 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/AverageBondLengthCalculator.java | AverageBondLengthCalculator.calculateAverageBondLength | public static double calculateAverageBondLength(IReactionSet reactionSet) {
double averageBondModelLength = 0.0;
for (IReaction reaction : reactionSet.reactions()) {
averageBondModelLength += calculateAverageBondLength(reaction);
}
return averageBondModelLength / reactionSet.... | java | public static double calculateAverageBondLength(IReactionSet reactionSet) {
double averageBondModelLength = 0.0;
for (IReaction reaction : reactionSet.reactions()) {
averageBondModelLength += calculateAverageBondLength(reaction);
}
return averageBondModelLength / reactionSet.... | [
"public",
"static",
"double",
"calculateAverageBondLength",
"(",
"IReactionSet",
"reactionSet",
")",
"{",
"double",
"averageBondModelLength",
"=",
"0.0",
";",
"for",
"(",
"IReaction",
"reaction",
":",
"reactionSet",
".",
"reactions",
"(",
")",
")",
"{",
"averageBo... | Calculate the average bond length for the bonds in a reaction set.
@param reactionSet the reaction set to use
@return the average bond length | [
"Calculate",
"the",
"average",
"bond",
"length",
"for",
"the",
"bonds",
"in",
"a",
"reaction",
"set",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/AverageBondLengthCalculator.java#L108-L114 |
113,883 | cdk/cdk | display/render/src/main/java/org/openscience/cdk/renderer/color/CPKAtomColors.java | CPKAtomColors.getAtomColor | @Override
public Color getAtomColor(IAtom atom, Color defaultColor) {
Color color = defaultColor;
String symbol = atom.getSymbol().toUpperCase();
if (atom.getAtomicNumber() != null && ATOM_COLORS_MASSNUM.containsKey(atom.getAtomicNumber())) {
color = ATOM_COLORS_MASSNUM.get(atom.... | java | @Override
public Color getAtomColor(IAtom atom, Color defaultColor) {
Color color = defaultColor;
String symbol = atom.getSymbol().toUpperCase();
if (atom.getAtomicNumber() != null && ATOM_COLORS_MASSNUM.containsKey(atom.getAtomicNumber())) {
color = ATOM_COLORS_MASSNUM.get(atom.... | [
"@",
"Override",
"public",
"Color",
"getAtomColor",
"(",
"IAtom",
"atom",
",",
"Color",
"defaultColor",
")",
"{",
"Color",
"color",
"=",
"defaultColor",
";",
"String",
"symbol",
"=",
"atom",
".",
"getSymbol",
"(",
")",
".",
"toUpperCase",
"(",
")",
";",
... | Returns the font color for atom given atom.
@param atom the atom.
@param defaultColor atom default color.
@return A color for the atom. The default colour is used if none is
found for the atom. | [
"Returns",
"the",
"font",
"color",
"for",
"atom",
"given",
"atom",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/render/src/main/java/org/openscience/cdk/renderer/color/CPKAtomColors.java#L152-L163 |
113,884 | cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java | Depiction.toSvgStr | public final String toSvgStr(String units) {
if (!units.equals(UNITS_MM) && !units.equals(UNITS_PX))
throw new IllegalArgumentException("Units must be 'px' or 'mm'!");
return toVecStr(SVG_FMT, units);
} | java | public final String toSvgStr(String units) {
if (!units.equals(UNITS_MM) && !units.equals(UNITS_PX))
throw new IllegalArgumentException("Units must be 'px' or 'mm'!");
return toVecStr(SVG_FMT, units);
} | [
"public",
"final",
"String",
"toSvgStr",
"(",
"String",
"units",
")",
"{",
"if",
"(",
"!",
"units",
".",
"equals",
"(",
"UNITS_MM",
")",
"&&",
"!",
"units",
".",
"equals",
"(",
"UNITS_PX",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Uni... | Render the image to an SVG image.
@param units the units for SVG - 'px' or 'mm'
@return svg XML content | [
"Render",
"the",
"image",
"to",
"an",
"SVG",
"image",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java#L147-L151 |
113,885 | cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java | Depiction.getPaddingValue | double getPaddingValue(double defaultPadding) {
double padding = model.get(RendererModel.Padding.class);
if (padding == AUTOMATIC)
padding = defaultPadding;
return padding;
} | java | double getPaddingValue(double defaultPadding) {
double padding = model.get(RendererModel.Padding.class);
if (padding == AUTOMATIC)
padding = defaultPadding;
return padding;
} | [
"double",
"getPaddingValue",
"(",
"double",
"defaultPadding",
")",
"{",
"double",
"padding",
"=",
"model",
".",
"get",
"(",
"RendererModel",
".",
"Padding",
".",
"class",
")",
";",
"if",
"(",
"padding",
"==",
"AUTOMATIC",
")",
"padding",
"=",
"defaultPadding... | Access the specified padding value or fallback to a provided
default.
@param defaultPadding default value if the parameter is 'automatic'
@return padding | [
"Access",
"the",
"specified",
"padding",
"value",
"or",
"fallback",
"to",
"a",
"provided",
"default",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java#L188-L193 |
113,886 | cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java | Depiction.getMarginValue | double getMarginValue(final double defaultMargin) {
double margin = model.get(BasicSceneGenerator.Margin.class);
if (margin == AUTOMATIC)
margin = defaultMargin;
return margin;
} | java | double getMarginValue(final double defaultMargin) {
double margin = model.get(BasicSceneGenerator.Margin.class);
if (margin == AUTOMATIC)
margin = defaultMargin;
return margin;
} | [
"double",
"getMarginValue",
"(",
"final",
"double",
"defaultMargin",
")",
"{",
"double",
"margin",
"=",
"model",
".",
"get",
"(",
"BasicSceneGenerator",
".",
"Margin",
".",
"class",
")",
";",
"if",
"(",
"margin",
"==",
"AUTOMATIC",
")",
"margin",
"=",
"def... | Access the specified margin value or fallback to a provided
default.
@param defaultMargin default value if the parameter is 'automatic'
@return margin | [
"Access",
"the",
"specified",
"margin",
"value",
"or",
"fallback",
"to",
"a",
"provided",
"default",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java#L202-L207 |
113,887 | cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java | Depiction.listFormats | public final List<String> listFormats() {
final List<String> formats = new ArrayList<>();
formats.add(SVG_FMT);
formats.add(SVG_FMT.toUpperCase(Locale.ROOT));
formats.add(PS_FMT);
formats.add(PS_FMT.toUpperCase(Locale.ROOT));
formats.add(EPS_FMT);
formats.add(EPS_... | java | public final List<String> listFormats() {
final List<String> formats = new ArrayList<>();
formats.add(SVG_FMT);
formats.add(SVG_FMT.toUpperCase(Locale.ROOT));
formats.add(PS_FMT);
formats.add(PS_FMT.toUpperCase(Locale.ROOT));
formats.add(EPS_FMT);
formats.add(EPS_... | [
"public",
"final",
"List",
"<",
"String",
">",
"listFormats",
"(",
")",
"{",
"final",
"List",
"<",
"String",
">",
"formats",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"formats",
".",
"add",
"(",
"SVG_FMT",
")",
";",
"formats",
".",
"add",
"(",
... | List the available formats that can be rendered.
@return supported formats | [
"List",
"the",
"available",
"formats",
"that",
"can",
"be",
"rendered",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java#L224-L236 |
113,888 | cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java | Depiction.writeTo | public final void writeTo(String fmt, String path) throws IOException {
writeTo(fmt, new File(replaceTildeWithHomeDir(ensureSuffix(path, fmt))));
} | java | public final void writeTo(String fmt, String path) throws IOException {
writeTo(fmt, new File(replaceTildeWithHomeDir(ensureSuffix(path, fmt))));
} | [
"public",
"final",
"void",
"writeTo",
"(",
"String",
"fmt",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"writeTo",
"(",
"fmt",
",",
"new",
"File",
"(",
"replaceTildeWithHomeDir",
"(",
"ensureSuffix",
"(",
"path",
",",
"fmt",
")",
")",
")",
... | Write the depiction to the provided file path.
@param fmt format
@param path output destination path
@throws IOException depiction could not be written, low level IO problem
@see #listFormats() | [
"Write",
"the",
"depiction",
"to",
"the",
"provided",
"file",
"path",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java#L280-L282 |
113,889 | cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java | Depiction.writeTo | public final void writeTo(String path) throws IOException {
final int i = path.lastIndexOf(DOT);
if (i < 0 || i + 1 == path.length())
throw new IOException("Cannot find suffix in provided path: " + path);
final String fmt = path.substring(i + 1);
writeTo(fmt, path);
} | java | public final void writeTo(String path) throws IOException {
final int i = path.lastIndexOf(DOT);
if (i < 0 || i + 1 == path.length())
throw new IOException("Cannot find suffix in provided path: " + path);
final String fmt = path.substring(i + 1);
writeTo(fmt, path);
} | [
"public",
"final",
"void",
"writeTo",
"(",
"String",
"path",
")",
"throws",
"IOException",
"{",
"final",
"int",
"i",
"=",
"path",
".",
"lastIndexOf",
"(",
"DOT",
")",
";",
"if",
"(",
"i",
"<",
"0",
"||",
"i",
"+",
"1",
"==",
"path",
".",
"length",
... | Write the depiction to the provided file path, the format is determined
by the path suffix.
@param path output destination path
@throws IOException depiction could not be written, low level IO problem
@see #listFormats() | [
"Write",
"the",
"depiction",
"to",
"the",
"provided",
"file",
"path",
"the",
"format",
"is",
"determined",
"by",
"the",
"path",
"suffix",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java#L292-L298 |
113,890 | cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java | Depiction.replaceTildeWithHomeDir | private static String replaceTildeWithHomeDir(String path) {
if (path.startsWith("~/"))
return System.getProperty("user.home") + path.substring(1);
return path;
} | java | private static String replaceTildeWithHomeDir(String path) {
if (path.startsWith("~/"))
return System.getProperty("user.home") + path.substring(1);
return path;
} | [
"private",
"static",
"String",
"replaceTildeWithHomeDir",
"(",
"String",
"path",
")",
"{",
"if",
"(",
"path",
".",
"startsWith",
"(",
"\"~/\"",
")",
")",
"return",
"System",
".",
"getProperty",
"(",
"\"user.home\"",
")",
"+",
"path",
".",
"substring",
"(",
... | Utility for resolving paths on unix systems that contain tilda for
the home directory.
@param path the file system path
@return normalised path | [
"Utility",
"for",
"resolving",
"paths",
"on",
"unix",
"systems",
"that",
"contain",
"tilda",
"for",
"the",
"home",
"directory",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java#L307-L311 |
113,891 | cdk/cdk | app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java | Depiction.draw | protected final void draw(IDrawVisitor visitor, double zoom, Bounds bounds, Rectangle2D viewBounds) {
double modelScale = zoom * model.get(BasicSceneGenerator.Scale.class);
double zoomToFit = Math.min(viewBounds.getWidth() / (bounds.width() * modelScale),
viewBounds.... | java | protected final void draw(IDrawVisitor visitor, double zoom, Bounds bounds, Rectangle2D viewBounds) {
double modelScale = zoom * model.get(BasicSceneGenerator.Scale.class);
double zoomToFit = Math.min(viewBounds.getWidth() / (bounds.width() * modelScale),
viewBounds.... | [
"protected",
"final",
"void",
"draw",
"(",
"IDrawVisitor",
"visitor",
",",
"double",
"zoom",
",",
"Bounds",
"bounds",
",",
"Rectangle2D",
"viewBounds",
")",
"{",
"double",
"modelScale",
"=",
"zoom",
"*",
"model",
".",
"get",
"(",
"BasicSceneGenerator",
".",
... | Low-level draw method used by other rendering methods.
@param visitor the draw visitor
@param bounds a bound rendering element
@param zoom if the diagram is zoomed at all
@param viewBounds the view bounds - the root will be centered in the bounds | [
"Low",
"-",
"level",
"draw",
"method",
"used",
"by",
"other",
"rendering",
"methods",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/app/depict/src/main/java/org/openscience/cdk/depict/Depiction.java#L337-L364 |
113,892 | cdk/cdk | base/core/src/main/java/org/openscience/cdk/config/CDKBasedAtomTypeConfigurator.java | CDKBasedAtomTypeConfigurator.readAtomTypes | @Override
public List<IAtomType> readAtomTypes(IChemObjectBuilder builder) throws IOException {
List<IAtomType> atomTypes;
if (ins == null) {
try {
ins = this.getClass().getClassLoader().getResourceAsStream(configFile);
} catch (Exception exc) {
... | java | @Override
public List<IAtomType> readAtomTypes(IChemObjectBuilder builder) throws IOException {
List<IAtomType> atomTypes;
if (ins == null) {
try {
ins = this.getClass().getClassLoader().getResourceAsStream(configFile);
} catch (Exception exc) {
... | [
"@",
"Override",
"public",
"List",
"<",
"IAtomType",
">",
"readAtomTypes",
"(",
"IChemObjectBuilder",
"builder",
")",
"throws",
"IOException",
"{",
"List",
"<",
"IAtomType",
">",
"atomTypes",
";",
"if",
"(",
"ins",
"==",
"null",
")",
"{",
"try",
"{",
"ins"... | Reads the atom types from the CDK based atom type list.
@param builder IChemObjectBuilder used to construct the IAtomType's.
@throws IOException when a problem occurred with reading from the InputStream
@return A List with read IAtomType's. | [
"Reads",
"the",
"atom",
"types",
"from",
"the",
"CDK",
"based",
"atom",
"type",
"list",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/config/CDKBasedAtomTypeConfigurator.java#L62-L94 |
113,893 | cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/ElementGroup.java | ElementGroup.add | public void add(IRenderingElement element) {
if (element != null) {
if (element.getClass().equals(ElementGroup.class))
elements.addAll(((ElementGroup) element).elements);
else
elements.add(element);
}
} | java | public void add(IRenderingElement element) {
if (element != null) {
if (element.getClass().equals(ElementGroup.class))
elements.addAll(((ElementGroup) element).elements);
else
elements.add(element);
}
} | [
"public",
"void",
"add",
"(",
"IRenderingElement",
"element",
")",
"{",
"if",
"(",
"element",
"!=",
"null",
")",
"{",
"if",
"(",
"element",
".",
"getClass",
"(",
")",
".",
"equals",
"(",
"ElementGroup",
".",
"class",
")",
")",
"elements",
".",
"addAll"... | Add a new element to the group.
@param element the element to add to the group | [
"Add",
"a",
"new",
"element",
"to",
"the",
"group",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/elements/ElementGroup.java#L57-L64 |
113,894 | cdk/cdk | base/data/src/main/java/org/openscience/cdk/Ring.java | Ring.getBondOrderSum | @Override
public int getBondOrderSum() {
int sum = 0;
for (int i = 0; i < getBondCount(); i++) {
IBond.Order order = getBond(i).getOrder();
if (order != null) {
sum += order.numeric();
}
}
return sum;
} | java | @Override
public int getBondOrderSum() {
int sum = 0;
for (int i = 0; i < getBondCount(); i++) {
IBond.Order order = getBond(i).getOrder();
if (order != null) {
sum += order.numeric();
}
}
return sum;
} | [
"@",
"Override",
"public",
"int",
"getBondOrderSum",
"(",
")",
"{",
"int",
"sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getBondCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"IBond",
".",
"Order",
"order",
"=",
"getBond",
... | Returns the sum of all bond orders in the ring.
@return the sum of all bond orders in the ring | [
"Returns",
"the",
"sum",
"of",
"all",
"bond",
"orders",
"in",
"the",
"ring",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/data/src/main/java/org/openscience/cdk/Ring.java#L129-L139 |
113,895 | cdk/cdk | doc/javadoc/source/XMIDoclet.java | XMIDoclet.process | public void process(RootDoc root) throws IOException {
// out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
out.println("<XMI xmi.version=\"1.1\" >");
out.println(" <XMI.header>");
out.println(" <XMI.metamodel href=\"/vol/acfiles7/egonw/SourceForge/CDK/cdk/reports/javadoc/test... | java | public void process(RootDoc root) throws IOException {
// out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
out.println("<XMI xmi.version=\"1.1\" >");
out.println(" <XMI.header>");
out.println(" <XMI.metamodel href=\"/vol/acfiles7/egonw/SourceForge/CDK/cdk/reports/javadoc/test... | [
"public",
"void",
"process",
"(",
"RootDoc",
"root",
")",
"throws",
"IOException",
"{",
"// out.println(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\");",
"out",
".",
"println",
"(",
"\"<XMI xmi.version=\\\"1.1\\\" >\"",
")",
";",
"out",
".",
"println",
"(",
"\" <... | Method that serializes RootDoc objects containing the
information from the Java source code.
@param root a RootDoc | [
"Method",
"that",
"serializes",
"RootDoc",
"objects",
"containing",
"the",
"information",
"from",
"the",
"Java",
"source",
"code",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/doc/javadoc/source/XMIDoclet.java#L49-L72 |
113,896 | cdk/cdk | doc/javadoc/source/XMIDoclet.java | XMIDoclet.start | public static boolean start(RootDoc root) {
try {
String filename = "classes.xmi";
PrintWriter out = new PrintWriter((Writer)new FileWriter(filename));
XMIDoclet doclet = new XMIDoclet(out);
doclet.process(root);
out.flush();
return true;
... | java | public static boolean start(RootDoc root) {
try {
String filename = "classes.xmi";
PrintWriter out = new PrintWriter((Writer)new FileWriter(filename));
XMIDoclet doclet = new XMIDoclet(out);
doclet.process(root);
out.flush();
return true;
... | [
"public",
"static",
"boolean",
"start",
"(",
"RootDoc",
"root",
")",
"{",
"try",
"{",
"String",
"filename",
"=",
"\"classes.xmi\"",
";",
"PrintWriter",
"out",
"=",
"new",
"PrintWriter",
"(",
"(",
"Writer",
")",
"new",
"FileWriter",
"(",
"filename",
")",
")... | Method that must be implemented by JavaDoc Doclets.
@param root the RootDoc element determined by JavaDoc | [
"Method",
"that",
"must",
"be",
"implemented",
"by",
"JavaDoc",
"Doclets",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/doc/javadoc/source/XMIDoclet.java#L157-L169 |
113,897 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java | RingPartitioner.partitionRings | public static List<IRingSet> partitionRings(IRingSet ringSet) {
List<IRingSet> ringSets = new ArrayList<IRingSet>();
if (ringSet.getAtomContainerCount() == 0) return ringSets;
IRing ring = (IRing) ringSet.getAtomContainer(0);
if (ring == null) return ringSets;
IRingSet rs = ring.... | java | public static List<IRingSet> partitionRings(IRingSet ringSet) {
List<IRingSet> ringSets = new ArrayList<IRingSet>();
if (ringSet.getAtomContainerCount() == 0) return ringSets;
IRing ring = (IRing) ringSet.getAtomContainer(0);
if (ring == null) return ringSets;
IRingSet rs = ring.... | [
"public",
"static",
"List",
"<",
"IRingSet",
">",
"partitionRings",
"(",
"IRingSet",
"ringSet",
")",
"{",
"List",
"<",
"IRingSet",
">",
"ringSets",
"=",
"new",
"ArrayList",
"<",
"IRingSet",
">",
"(",
")",
";",
"if",
"(",
"ringSet",
".",
"getAtomContainerCo... | Partitions a RingSet into RingSets of connected rings. Rings which share
an Atom, a Bond or three or more atoms with at least on other ring in
the RingSet are considered connected. Thus molecules such as azulene and
indole will return a List with 1 element.
<p>Note that an isolated ring is considered to be <i>self-con... | [
"Partitions",
"a",
"RingSet",
"into",
"RingSets",
"of",
"connected",
"rings",
".",
"Rings",
"which",
"share",
"an",
"Atom",
"a",
"Bond",
"or",
"three",
"or",
"more",
"atoms",
"with",
"at",
"least",
"on",
"other",
"ring",
"in",
"the",
"RingSet",
"are",
"c... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java#L64-L82 |
113,898 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java | RingPartitioner.convertToAtomContainer | public static IAtomContainer convertToAtomContainer(IRingSet ringSet) {
IRing ring = (IRing) ringSet.getAtomContainer(0);
if (ring == null) return null;
IAtomContainer ac = ring.getBuilder().newInstance(IAtomContainer.class);
for (int i = 0; i < ringSet.getAtomContainerCount(); i++) {
... | java | public static IAtomContainer convertToAtomContainer(IRingSet ringSet) {
IRing ring = (IRing) ringSet.getAtomContainer(0);
if (ring == null) return null;
IAtomContainer ac = ring.getBuilder().newInstance(IAtomContainer.class);
for (int i = 0; i < ringSet.getAtomContainerCount(); i++) {
... | [
"public",
"static",
"IAtomContainer",
"convertToAtomContainer",
"(",
"IRingSet",
"ringSet",
")",
"{",
"IRing",
"ring",
"=",
"(",
"IRing",
")",
"ringSet",
".",
"getAtomContainer",
"(",
"0",
")",
";",
"if",
"(",
"ring",
"==",
"null",
")",
"return",
"null",
"... | Converts a RingSet to an AtomContainer.
@param ringSet The RingSet to be converted.
@return The AtomContainer containing the bonds and atoms of the ringSet. | [
"Converts",
"a",
"RingSet",
"to",
"an",
"AtomContainer",
"."
] | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java#L90-L107 |
113,899 | cdk/cdk | base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java | RingPartitioner.walkRingSystem | private static IRingSet walkRingSystem(IRingSet rs, IRing ring, IRingSet newRs) {
IRing tempRing;
IRingSet tempRings = rs.getConnectedRings(ring);
// logger.debug("walkRingSystem -> tempRings.size(): " + tempRings.size());
rs.removeAtomContainer(ring);
for (IAtomContainer ... | java | private static IRingSet walkRingSystem(IRingSet rs, IRing ring, IRingSet newRs) {
IRing tempRing;
IRingSet tempRings = rs.getConnectedRings(ring);
// logger.debug("walkRingSystem -> tempRings.size(): " + tempRings.size());
rs.removeAtomContainer(ring);
for (IAtomContainer ... | [
"private",
"static",
"IRingSet",
"walkRingSystem",
"(",
"IRingSet",
"rs",
",",
"IRing",
"ring",
",",
"IRingSet",
"newRs",
")",
"{",
"IRing",
"tempRing",
";",
"IRingSet",
"tempRings",
"=",
"rs",
".",
"getConnectedRings",
"(",
"ring",
")",
";",
"// logger... | Perform a walk in the given RingSet, starting at a given Ring and
recursively searching for other Rings connected to this ring. By doing
this it finds all rings in the RingSet connected to the start ring,
putting them in newRs, and removing them from rs.
@param rs The RingSet to be searched
@param ring The rin... | [
"Perform",
"a",
"walk",
"in",
"the",
"given",
"RingSet",
"starting",
"at",
"a",
"given",
"Ring",
"and",
"recursively",
"searching",
"for",
"other",
"Rings",
"connected",
"to",
"this",
"ring",
".",
"By",
"doing",
"this",
"it",
"finds",
"all",
"rings",
"in",... | c3d0f16502bf08df50365fee392e11d7c9856657 | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/ringsearch/RingPartitioner.java#L120-L133 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.