_id stringlengths 2 7 | title stringlengths 3 140 | partition stringclasses 3
values | text stringlengths 73 34.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q157300 | QueryAtomContainer.getConnectedSingleElectronsCount | train | @Override
public int getConnectedSingleElectronsCount(IAtom atom) {
int count = 0;
for (int i = 0; i < singleElectronCount; i++) {
if (singleElectrons[i].contains(atom)) ++count;
}
return count;
} | java | {
"resource": ""
} |
q157301 | QueryAtomContainer.getBondOrderSum | train | @Override
public double getBondOrderSum(IAtom atom) {
double count = 0;
for (int i = 0; i < bondCount; i++) {
if (bonds[i].contains(atom)) {
if (bonds[i].getOrder() == IBond.Order.SINGLE) {
count += 1;
} else if (bonds[i].getOrder() == ... | java | {
"resource": ""
} |
q157302 | QueryAtomContainer.getMaximumBondOrder | train | @Override
public Order getMaximumBondOrder(IAtom atom) {
IBond.Order max = IBond.Order.SINGLE;
for (int i = 0; i < bondCount; i++) {
if (bonds[i].contains(atom) && bonds[i].getOrder().ordinal() > max.ordinal()) {
max = bonds[i].getOrder();
}
}
... | java | {
"resource": ""
} |
q157303 | QueryAtomContainer.getMinimumBondOrder | train | @Override
public Order getMinimumBondOrder(IAtom atom) {
IBond.Order min = IBond.Order.QUADRUPLE;
for (int i = 0; i < bondCount; i++) {
if (bonds[i].contains(atom) && bonds[i].getOrder().ordinal() < min.ordinal()) {
min = bonds[i].getOrder();
}
}
... | java | {
"resource": ""
} |
q157304 | QueryAtomContainer.add | train | @Override
public void add(IAtomContainer atomContainer) {
if (atomContainer instanceof QueryAtomContainer) {
for (int f = 0; f < atomContainer.getAtomCount(); f++) {
if (!contains(atomContainer.getAtom(f))) {
addAtom(atomContainer.getAtom(f));
... | java | {
"resource": ""
} |
q157305 | QueryAtomContainer.addAtom | train | @Override
public void addAtom(IAtom atom) {
if (contains(atom)) {
return;
}
if (atomCount + 1 >= atoms.length) {
growAtomArray();
}
atom.addListener(this);
atoms[atomCount] = atom;
atomCount++;
notifyChanged();
} | java | {
"resource": ""
} |
q157306 | QueryAtomContainer.addBond | train | @Override
public void addBond(IBond bond) {
if (bondCount >= bonds.length) growBondArray();
bonds[bondCount] = bond;
++bondCount;
notifyChanged();
} | java | {
"resource": ""
} |
q157307 | QueryAtomContainer.addLonePair | train | @Override
public void addLonePair(ILonePair lonePair) {
if (lonePairCount >= lonePairs.length) growLonePairArray();
lonePairs[lonePairCount] = lonePair;
++lonePairCount;
notifyChanged();
} | java | {
"resource": ""
} |
q157308 | QueryAtomContainer.addSingleElectron | train | @Override
public void addSingleElectron(ISingleElectron singleElectron) {
if (singleElectronCount >= singleElectrons.length) growSingleElectronArray();
singleElectrons[singleElectronCount] = singleElectron;
++singleElectronCount;
notifyChanged();
} | java | {
"resource": ""
} |
q157309 | QueryAtomContainer.removeAtom | train | @Override
public void removeAtom(IAtom atom) {
int position = getAtomNumber(atom);
if (position != -1) {
for (int i = 0; i < bondCount; i++) {
if (bonds[i].contains(atom)) {
removeBond(i);
--i;
}
}
... | java | {
"resource": ""
} |
q157310 | QueryAtomContainer.addBond | train | @Override
public void addBond(int atom1, int atom2, IBond.Order order, IBond.Stereo stereo) {
IBond bond = getBuilder().newInstance(IBond.class, getAtom(atom1), getAtom(atom2), order, stereo);
if (contains(bond)) {
return;
}
if (bondCount >= bonds.length) {
... | java | {
"resource": ""
} |
q157311 | QueryAtomContainer.contains | train | @Override
public boolean contains(IElectronContainer electronContainer) {
if (electronContainer instanceof IBond) return contains((IBond) electronContainer);
if (electronContainer instanceof ILonePair) return contains((ILonePair) electronContainer);
if (electronContainer instanceof ISingleEl... | java | {
"resource": ""
} |
q157312 | QueryAtomContainer.growAtomArray | train | private void growAtomArray() {
growArraySize = (atoms.length < growArraySize) ? growArraySize : atoms.length;
IAtom[] newatoms = new IAtom[atoms.length + growArraySize];
System.arraycopy(atoms, 0, newatoms, 0, atoms.length);
atoms = newatoms;
} | java | {
"resource": ""
} |
q157313 | QueryAtomContainer.growBondArray | train | private void growBondArray() {
growArraySize = (bonds.length < growArraySize) ? growArraySize : bonds.length;
IBond[] newBonds = new IBond[bonds.length + growArraySize];
System.arraycopy(bonds, 0, newBonds, 0, bonds.length);
bonds = newBonds;
} | java | {
"resource": ""
} |
q157314 | QueryAtomContainer.growLonePairArray | train | private void growLonePairArray() {
growArraySize = (lonePairs.length < growArraySize) ? growArraySize : lonePairs.length;
ILonePair[] newLonePairs = new ILonePair[lonePairs.length + growArraySize];
System.arraycopy(lonePairs, 0, newLonePairs, 0, lonePairs.length);
lonePairs = newLonePair... | java | {
"resource": ""
} |
q157315 | QueryAtomContainer.growSingleElectronArray | train | private void growSingleElectronArray() {
growArraySize = (singleElectrons.length < growArraySize) ? growArraySize : singleElectrons.length;
ISingleElectron[] newSingleElectrons = new ISingleElectron[singleElectrons.length + growArraySize];
System.arraycopy(singleElectrons, 0, newSingleElectrons,... | java | {
"resource": ""
} |
q157316 | AdjacencyMatrix.getMatrix | train | public static int[][] getMatrix(IAtomContainer container) {
IBond bond;
int indexAtom1;
int indexAtom2;
int[][] conMat = new int[container.getAtomCount()][container.getAtomCount()];
for (int f = 0; f < container.getBondCount(); f++) {
bond = container.getBond(f);
... | java | {
"resource": ""
} |
q157317 | CovalentRadiusDescriptor.calculate | train | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer container) {
if (factory == null)
try {
factory = AtomTypeFactory.getInstance("org/openscience/cdk/config/data/jmol_atomtypes.txt",
container.getBuilder());
} catch (Exceptio... | java | {
"resource": ""
} |
q157318 | ChemModel.setMoleculeSet | train | @Override
public void setMoleculeSet(IAtomContainerSet setOfMolecules) {
if (this.setOfMolecules != null) this.setOfMolecules.removeListener(this);
this.setOfMolecules = setOfMolecules;
if (this.setOfMolecules != null) this.setOfMolecules.addListener(this);
notifyChanged();
} | java | {
"resource": ""
} |
q157319 | ChemModel.setRingSet | train | @Override
public void setRingSet(IRingSet ringSet) {
if (this.ringSet != null) this.ringSet.removeListener(this);
this.ringSet = ringSet;
if (this.ringSet != null) this.ringSet.addListener(this);
notifyChanged();
} | java | {
"resource": ""
} |
q157320 | ChemModel.setCrystal | train | @Override
public void setCrystal(ICrystal crystal) {
if (this.crystal != null) this.crystal.removeListener(this);
this.crystal = crystal;
if (this.crystal != null) this.crystal.addListener(this);
notifyChanged();
} | java | {
"resource": ""
} |
q157321 | ChemModel.setReactionSet | train | @Override
public void setReactionSet(IReactionSet sor) {
if (this.setOfReactions != null) this.setOfReactions.removeListener(this);
this.setOfReactions = sor;
if (this.setOfReactions != null) this.setOfReactions.addListener(this);
notifyChanged();
} | java | {
"resource": ""
} |
q157322 | SMSDNormalizer.makeDeepCopy | train | public static IAtomContainer makeDeepCopy(IAtomContainer container) {
IAtomContainer newAtomContainer = DefaultChemObjectBuilder.getInstance().newInstance(IAtomContainer.class);
int lonePairCount = container.getLonePairCount();
int singleElectronCount = container.getSingleElectronCount();
... | java | {
"resource": ""
} |
q157323 | SMSDNormalizer.aromatizeMolecule | train | public static void aromatizeMolecule(IAtomContainer mol) {
// need to find rings and aromaticity again since added H's
IRingSet ringSet = null;
try {
AllRingsFinder arf = new AllRingsFinder();
ringSet = arf.findAllRings(mol);
// SSSRFinder s = new SSSRFinde... | java | {
"resource": ""
} |
q157324 | SMSDNormalizer.getImplicitHydrogenCount | train | public static int getImplicitHydrogenCount(IAtomContainer atomContainer, IAtom atom) {
return atom.getImplicitHydrogenCount() == CDKConstants.UNSET ? 0 : atom.getImplicitHydrogenCount();
} | java | {
"resource": ""
} |
q157325 | DefaultEventChemObjectReader.fireFrameRead | train | protected void fireFrameRead() {
for (IChemObjectIOListener chemListener : getListeners()) {
IReaderListener listener = (IReaderListener) chemListener;
// Lazily create the event:
if (frameReadEvent == null) {
frameReadEvent = new ReaderEvent(this);
... | java | {
"resource": ""
} |
q157326 | BPolDescriptor.calculate | train | @Override
public DescriptorValue calculate(IAtomContainer container) {
double bpol = 0;
int atomicNumber0;
int atomicNumber1;
double difference;
try {
IsotopeFactory ifac = Isotopes.getInstance();
IElement element0;
IElement element1;
... | java | {
"resource": ""
} |
q157327 | HuLuIndexTool.displayMatrix | train | public static void displayMatrix(double[][] matrix) {
String line;
for (int f = 0; f < matrix.length; f++) {
line = "";
for (int g = 0; g < matrix.length; g++) {
line += matrix[g][f] + " | ";
}
logger.debug(line);
}
} | java | {
"resource": ""
} |
q157328 | HuLuIndexTool.displayArray | train | public static void displayArray(int[] array) {
String line = "";
for (int f = 0; f < array.length; f++) {
line += array[f] + " | ";
}
logger.debug(line);
} | java | {
"resource": ""
} |
q157329 | ShelXWriter.write | train | @Override
public void write(IChemObject object) throws CDKException {
if (object instanceof ICrystal) {
writeCrystal((ICrystal) object);
} else {
throw new CDKException("Only Crystal objects can be read.");
}
} | java | {
"resource": ""
} |
q157330 | ElectronImpactNBEReaction.setActiveCenters | train | private void setActiveCenters(IAtomContainer reactant) throws CDKException {
Iterator<IAtom> atoms = reactant.atoms().iterator();
while (atoms.hasNext()) {
IAtom atom = atoms.next();
if (reactant.getConnectedLonePairsCount(atom) > 0 && reactant.getConnectedSingleElectronsCount(at... | java | {
"resource": ""
} |
q157331 | AtomTools.add3DCoordinates1 | train | public static void add3DCoordinates1(IAtomContainer atomContainer) {
// atoms without coordinates
IAtomContainer noCoords = atomContainer.getBuilder().newInstance(IAtomContainer.class);
// get vector of possible referenceAtoms?
IAtomContainer refAtoms = atomContainer.getBuilder().newInst... | java | {
"resource": ""
} |
q157332 | AtomTools.rescaleBondLength | train | public static Point3d rescaleBondLength(IAtom atom1, IAtom atom2, Point3d point2) {
Point3d point1 = atom1.getPoint3d();
double d1 = atom1.getCovalentRadius();
double d2 = atom2.getCovalentRadius();
// in case we have no covalent radii, set to 1.0
double distance = (d1 < 0.1 || d... | java | {
"resource": ""
} |
q157333 | CMLCoreModule.newAtomData | train | protected void newAtomData() {
atomCounter = 0;
elsym = new ArrayList<String>();
elid = new ArrayList<String>();
eltitles = new ArrayList<String>();
formalCharges = new ArrayList<String>();
partialCharges = new ArrayList<String>();
isotope = new ArrayList<String>(... | java | {
"resource": ""
} |
q157334 | CMLCoreModule.newBondData | train | protected void newBondData() {
bondCounter = 0;
bondid = new ArrayList<String>();
bondARef1 = new ArrayList<String>();
bondARef2 = new ArrayList<String>();
order = new ArrayList<String>();
bondStereo = new ArrayList<String>();
bondCustomProperty = new Hashtable<St... | java | {
"resource": ""
} |
q157335 | FortranFormat.atof | train | public static double atof(String s) {
int i = 0;
int sign = 1;
double r = 0; // integer part
double p = 1; // exponent of fractional part
int state = 0; // 0 = int part, 1 = frac part
while (i < s.length() && Character.isWhitespace(s.charAt(i)))
i++;
... | java | {
"resource": ""
} |
q157336 | FractionalPSADescriptor.calculate | train | @Override
public DescriptorValue calculate(IAtomContainer mol) {
try {
mol = mol.clone();
} catch (CloneNotSupportedException ex) {
}
double polar = 0, weight = 0;
try {
// type & assign implicit hydrogens
IChemObjectBuilder builder = mol.g... | java | {
"resource": ""
} |
q157337 | ConnectivityChecker.partitionIntoMolecules | train | public static IAtomContainerSet partitionIntoMolecules(IAtomContainer container) {
ConnectedComponents cc = new ConnectedComponents(GraphUtil.toAdjList(container));
return partitionIntoMolecules(container, cc.components());
} | java | {
"resource": ""
} |
q157338 | ConnectionMatrix.getMatrix | train | public static double[][] getMatrix(IAtomContainer container) {
IBond bond = null;
int indexAtom1;
int indexAtom2;
double[][] conMat = new double[container.getAtomCount()][container.getAtomCount()];
for (int f = 0; f < container.getBondCount(); f++) {
bond = container.... | java | {
"resource": ""
} |
q157339 | Permutation.isIdentity | train | public boolean isIdentity() {
for (int i = 0; i < this.values.length; i++) {
if (this.values[i] != i) {
return false;
}
}
return true;
} | java | {
"resource": ""
} |
q157340 | Permutation.setTo | train | public void setTo(Permutation other) {
if (this.values.length != other.values.length)
throw new IllegalArgumentException("permutations are different size");
for (int i = 0; i < this.values.length; i++) {
this.values[i] = other.values[i];
}
} | java | {
"resource": ""
} |
q157341 | Permutation.toCycleString | train | public String toCycleString() {
int n = this.values.length;
boolean[] p = new boolean[n];
Arrays.fill(p, true);
StringBuilder sb = new StringBuilder();
int j = 0;
for (int i = 0; i < n; i++) {
if (p[i]) {
sb.append('(');
sb.app... | java | {
"resource": ""
} |
q157342 | SelectionVisibility.isSelected | train | static boolean isSelected(IChemObject object, RendererModel model) {
if (object.getProperty(StandardGenerator.HIGHLIGHT_COLOR) != null) return true;
if (model.getSelection() != null) return model.getSelection().contains(object);
return false;
} | java | {
"resource": ""
} |
q157343 | SelectionVisibility.hasSelectedBond | train | static boolean hasSelectedBond(List<IBond> bonds, RendererModel model) {
for (IBond bond : bonds) {
if (isSelected(bond, model)) return true;
}
return false;
} | java | {
"resource": ""
} |
q157344 | Bounds.add | train | public void add(double x, double y) {
if (x < minX) minX = x;
if (y < minY) minY = y;
if (x > maxX) maxX = x;
if (y > maxY) maxY = y;
} | java | {
"resource": ""
} |
q157345 | Bounds.add | train | public void add(Bounds bounds) {
if (bounds.minX < minX) minX = bounds.minX;
if (bounds.minY < minY) minY = bounds.minY;
if (bounds.maxX > maxX) maxX = bounds.maxX;
if (bounds.maxY > maxY) maxY = bounds.maxY;
} | java | {
"resource": ""
} |
q157346 | Bounds.add | train | private void add(GeneralPath path) {
double[] points = new double[6];
for (org.openscience.cdk.renderer.elements.path.PathElement element : path.elements) {
element.points(points);
switch (element.type()) {
case MoveTo:
case LineTo:
... | java | {
"resource": ""
} |
q157347 | InductiveAtomicSoftnessDescriptor.calculate | train | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer ac) {
if (factory == null)
try {
factory = AtomTypeFactory.getInstance("org/openscience/cdk/config/data/jmol_atomtypes.txt",
ac.getBuilder());
} catch (Exception exception) {... | java | {
"resource": ""
} |
q157348 | ReactionPlusGenerator.makePlus | train | private TextElement makePlus(Rectangle2D moleculeBox1, Rectangle2D moleculeBox2, double axis, Color color) {
double arrowCenter = (moleculeBox1.getCenterX() + moleculeBox2.getCenterX()) / 2;
return new TextElement(arrowCenter, axis, "+", color);
} | java | {
"resource": ""
} |
q157349 | CMLErrorHandler.print | train | private void print(String level, SAXParseException exception) {
if (level.equals("warning")) {
logger.warn("** " + level + ": " + exception.getMessage());
logger.warn(" URI = " + exception.getSystemId());
logger.warn(" line = " + exception.getLineNumber());
} els... | java | {
"resource": ""
} |
q157350 | CMLErrorHandler.error | train | @Override
public void error(SAXParseException exception) throws SAXException {
if (reportErrors) print("error", exception);
if (abortOnErrors) throw exception;
} | java | {
"resource": ""
} |
q157351 | CMLErrorHandler.fatalError | train | @Override
public void fatalError(SAXParseException exception) throws SAXException {
if (reportErrors) print("fatal", exception);
if (abortOnErrors) throw exception;
} | java | {
"resource": ""
} |
q157352 | SymbolVisibility.all | train | public static SymbolVisibility all() {
return new SymbolVisibility() {
@Override
public boolean visible(IAtom atom, List<IBond> neighbors, RendererModel model) {
return true;
}
};
} | java | {
"resource": ""
} |
q157353 | ChemicalFilters.sortResultsByStereoAndBondMatch | train | public synchronized void sortResultsByStereoAndBondMatch() throws CDKException {
// System.out.println("\n\n\n\nSort By ResultsByStereoAndBondMatch");
Map<Integer, Map<Integer, Integer>> allStereoMCS = new HashMap<Integer, Map<Integer, Integer>>();
Map<Integer, Map<IAtom, IAtom>> allSte... | java | {
"resource": ""
} |
q157354 | ChemicalFilters.sortResultsByFragments | train | public synchronized void sortResultsByFragments() {
// System.out.println("\nSort By Fragment");
Map<Integer, Map<Integer, Integer>> allFragmentMCS = new TreeMap<Integer, Map<Integer, Integer>>();
Map<Integer, Map<IAtom, IAtom>> allFragmentAtomMCS = new TreeMap<Integer, Map<IAtom, IAtom>... | java | {
"resource": ""
} |
q157355 | ChemicalFilters.sortResultsByEnergies | train | public synchronized void sortResultsByEnergies() throws CDKException {
// System.out.println("\nSort By Energies");
Map<Integer, Map<Integer, Integer>> allEnergyMCS = new TreeMap<Integer, Map<Integer, Integer>>();
Map<Integer, Map<IAtom, IAtom>> allEnergyAtomMCS = new TreeMap<Integer, Ma... | java | {
"resource": ""
} |
q157356 | ChemicalFilters.convertBondStereo | train | public static int convertBondStereo(IBond bond) {
int value = 0;
switch (bond.getStereo()) {
case UP:
value = 1;
break;
case UP_INVERTED:
value = 1;
break;
case DOWN:
value = 6;
... | java | {
"resource": ""
} |
q157357 | ChemicalFilters.convertStereo | train | public static IBond.Stereo convertStereo(int stereoValue) {
IBond.Stereo stereo = IBond.Stereo.NONE;
if (stereoValue == 1) {
// up bond
stereo = IBond.Stereo.UP;
} else if (stereoValue == 6) {
// down bond
stereo = IBond.Stereo.DOWN;
} else... | java | {
"resource": ""
} |
q157358 | FischerRecognition.recognise | train | List<IStereoElement> recognise(Set<Projection> projections) {
if (!projections.contains(Projection.Fischer))
return Collections.emptyList();
// build atom index and only recognize 2D depictions
Map<IAtom,Integer> atomToIndex = new HashMap<IAtom, Integer>();
for (IAt... | java | {
"resource": ""
} |
q157359 | FischerRecognition.newTetrahedralCenter | train | static ITetrahedralChirality newTetrahedralCenter(IAtom focus, IBond[] bonds) {
// obtain the bonds of a centre arranged by cardinal direction
IBond[] cardinalBonds = cardinalBonds(focus, bonds);
if (cardinalBonds == null)
return null;
// vertical bonds mu... | java | {
"resource": ""
} |
q157360 | FischerRecognition.isTerminal | train | private boolean isTerminal(IAtom atom, Map<IAtom, Integer> atomToIndex) {
return graph[atomToIndex.get(atom)].length == 1;
} | java | {
"resource": ""
} |
q157361 | FischerRecognition.neighbors | train | private static IBond[] neighbors(int v, int[][] g, EdgeToBondMap bondMap) {
int[] ws = g[v];
IBond[] bonds = new IBond[ws.length];
for (int i = 0; i < ws.length; i++) {
bonds[i] = bondMap.get(v, ws[i]);
}
return bonds;
} | java | {
"resource": ""
} |
q157362 | RGroupList.match | train | private static boolean match(String regExp, String userInput) {
Pattern pattern = Pattern.compile(regExp);
Matcher matcher = pattern.matcher(userInput);
if (matcher.find())
return true;
else
return false;
} | java | {
"resource": ""
} |
q157363 | AtomSymbol.addAnnotation | train | AtomSymbol addAnnotation(TextOutline annotation) {
List<TextOutline> newAnnotations = new ArrayList<TextOutline>(annotationAdjuncts);
newAnnotations.add(annotation);
return new AtomSymbol(element, adjuncts, newAnnotations, alignment, hull);
} | java | {
"resource": ""
} |
q157364 | AtomSymbol.getAlignmentCenter | train | Point2D getAlignmentCenter() {
if (alignment == SymbolAlignment.Left) {
return element.getFirstGlyphCenter();
} else if (alignment == SymbolAlignment.Right) {
return element.getLastGlyphCenter();
} else {
return element.getCenter();
}
} | java | {
"resource": ""
} |
q157365 | AtomSymbol.getOutlines | train | List<Shape> getOutlines() {
List<Shape> shapes = new ArrayList<Shape>();
shapes.add(element.getOutline());
for (TextOutline adjunct : adjuncts)
shapes.add(adjunct.getOutline());
return shapes;
} | java | {
"resource": ""
} |
q157366 | AtomSymbol.getAnnotationOutlines | train | List<Shape> getAnnotationOutlines() {
List<Shape> shapes = new ArrayList<Shape>();
for (TextOutline adjunct : annotationAdjuncts)
shapes.add(adjunct.getOutline());
return shapes;
} | java | {
"resource": ""
} |
q157367 | AtomSymbol.transform | train | AtomSymbol transform(AffineTransform transform) {
List<TextOutline> transformedAdjuncts = new ArrayList<TextOutline>(adjuncts.size());
for (TextOutline adjunct : adjuncts)
transformedAdjuncts.add(adjunct.transform(transform));
List<TextOutline> transformedAnnAdjuncts = new ArrayList<... | java | {
"resource": ""
} |
q157368 | AtomSymbol.resize | train | AtomSymbol resize(double scaleX, double scaleY) {
Point2D center = element.getCenter();
AffineTransform transform = new AffineTransform();
transform.translate(center.getX(), center.getY());
transform.scale(scaleX, scaleY);
transform.translate(-center.getX(), -center.getY());
... | java | {
"resource": ""
} |
q157369 | AtomSymbol.center | train | AtomSymbol center(double x, double y) {
Point2D center = getAlignmentCenter();
return translate(x - center.getX(), y - center.getY());
} | java | {
"resource": ""
} |
q157370 | StereoElementFactory.interpretProjections | train | public StereoElementFactory interpretProjections(Projection ... projections) {
Collections.addAll(this.projections, projections);
this.check = true;
return this;
} | java | {
"resource": ""
} |
q157371 | OverlapResolver.resolveOverlap | train | public double resolveOverlap(IAtomContainer ac, IRingSet sssr) {
Vector overlappingAtoms = new Vector();
Vector overlappingBonds = new Vector();
logger.debug("Start of resolveOverlap");
double overlapScore = getOverlapScore(ac, overlappingAtoms, overlappingBonds);
if (overlapSco... | java | {
"resource": ""
} |
q157372 | OverlapResolver.displace | train | public double displace(IAtomContainer ac, Vector overlappingAtoms, Vector overlappingBonds) {
double bondLength = GeometryUtil.getBondLengthAverage(ac);
OverlapPair op = null;
IAtom a1 = null, a2 = null;
Vector2d v1 = null, v2 = null;
int steps = 0;
int p = 0;
do... | java | {
"resource": ""
} |
q157373 | OverlapResolver.getOverlapScore | train | public double getOverlapScore(IAtomContainer ac, Vector overlappingAtoms, Vector overlappingBonds) {
double overlapScore = 0;
overlapScore = getAtomOverlapScore(ac, overlappingAtoms);
//overlapScore += getBondOverlapScore(ac, overlappingBonds);
return overlapScore;
} | java | {
"resource": ""
} |
q157374 | OverlapResolver.getAtomOverlapScore | train | public double getAtomOverlapScore(IAtomContainer ac, Vector overlappingAtoms) {
overlappingAtoms.removeAllElements();
IAtom atom1 = null;
IAtom atom2 = null;
Point2d p1 = null;
Point2d p2 = null;
double distance = 0;
double overlapScore = 0;
double bondLen... | java | {
"resource": ""
} |
q157375 | OverlapResolver.getBondOverlapScore | train | public double getBondOverlapScore(IAtomContainer ac, Vector overlappingBonds) {
overlappingBonds.removeAllElements();
double overlapScore = 0;
IBond bond1 = null;
IBond bond2 = null;
double bondLength = GeometryUtil.getBondLengthAverage(ac);;
double overlapCutoff = bondLe... | java | {
"resource": ""
} |
q157376 | OverlapResolver.areIntersected | train | public boolean areIntersected(IBond bond1, IBond bond2) {
double x1 = 0, x2 = 0, x3 = 0, x4 = 0;
double y1 = 0, y2 = 0, y3 = 0, y4 = 0;
//Point2D.Double p1 = null, p2 = null, p3 = null, p4 = null;
x1 = bond1.getBegin().getPoint2d().x;
x2 = bond1.getEnd().getPoint2d().x;
... | java | {
"resource": ""
} |
q157377 | AdductionProtonPBReaction.setActiveCenters | train | private void setActiveCenters(IAtomContainer reactant) throws CDKException {
if (AtomContainerManipulator.getTotalCharge(reactant) != 0) return;
Iterator<IBond> bondis = reactant.bonds().iterator();
while (bondis.hasNext()) {
IBond bondi = bondis.next();
if (((bondi.get... | java | {
"resource": ""
} |
q157378 | ProtonAffinityHOSEDescriptor.calculate | train | @Override
public DescriptorValue calculate(IAtom atom, IAtomContainer container) {
double value;
try {
int i = container.indexOf(atom);
if (i < 0) throw new CDKException("atom was not a memeber of the provided container");
// don't modify the original
... | java | {
"resource": ""
} |
q157379 | AtomContainerSet.getMultipliers | train | @Override
public Double[] getMultipliers() {
Double[] returnArray = new Double[this.atomContainerCount];
System.arraycopy(this.multipliers, 0, returnArray, 0, this.atomContainerCount);
return returnArray;
} | java | {
"resource": ""
} |
q157380 | AtomContainerSet.setMultipliers | train | @Override
public boolean setMultipliers(Double[] newMultipliers) {
if (newMultipliers.length == atomContainerCount) {
if (multipliers == null) {
multipliers = new Double[atomContainerCount];
}
System.arraycopy(newMultipliers, 0, multipliers, 0, atomContain... | java | {
"resource": ""
} |
q157381 | AtomContainerSet.addAtomContainer | train | @Override
public void addAtomContainer(IAtomContainer atomContainer, double multiplier) {
if (atomContainerCount + 1 >= atomContainers.length) {
growAtomContainerArray();
}
atomContainer.addListener(this);
atomContainers[atomContainerCount] = atomContainer;
multip... | java | {
"resource": ""
} |
q157382 | AtomContainerSet.add | train | @Override
public void add(IAtomContainerSet atomContainerSet) {
for (IAtomContainer iter : atomContainerSet.atomContainers()) {
addAtomContainer(iter);
}
/*
* notifyChanged() is called by addAtomContainer()
*/
} | java | {
"resource": ""
} |
q157383 | AtomContainerSet.atomContainers | train | @Override
public Iterable<IAtomContainer> atomContainers() {
return new Iterable<IAtomContainer>() {
@Override
public Iterator<IAtomContainer> iterator() {
return new AtomContainerIterator();
}
};
} | java | {
"resource": ""
} |
q157384 | AtomContainerSet.getMultiplier | train | @Override
public Double getMultiplier(IAtomContainer container) {
for (int i = 0; i < atomContainerCount; i++) {
if (atomContainers[i].equals(container)) {
return multipliers[i];
}
}
return -1.0;
} | java | {
"resource": ""
} |
q157385 | AtomContainerSet.growAtomContainerArray | train | protected void growAtomContainerArray() {
growArraySize = atomContainers.length;
IAtomContainer[] newatomContainers = new IAtomContainer[atomContainers.length + growArraySize];
System.arraycopy(atomContainers, 0, newatomContainers, 0, atomContainers.length);
atomContainers = newatomConta... | java | {
"resource": ""
} |
q157386 | AtomContainerSet.sortAtomContainers | train | @Override
public void sortAtomContainers(final Comparator<IAtomContainer> comparator) {
// need to use boxed primitives as we can't customise sorting of int primitives
Integer[] indexes = new Integer[atomContainerCount];
for (int i = 0; i < indexes.length; i++)
indexes[i] = i;
... | java | {
"resource": ""
} |
q157387 | CycleBasis.essentialCycles | train | public Collection essentialCycles() {
Collection result = new HashSet();
//minimize();
for (Object subgraphBase : subgraphBases) {
SimpleCycleBasis cycleBasis = (SimpleCycleBasis) subgraphBase;
result.addAll(cycleBasis.essentialCycles());
}
return result... | java | {
"resource": ""
} |
q157388 | CycleBasis.relevantCycles | train | public Map relevantCycles() {
Map result = new HashMap();
//minimize();
for (SimpleCycleBasis subgraphBase : subgraphBases) {
SimpleCycleBasis cycleBasis = subgraphBase;
result.putAll(cycleBasis.relevantCycles());
}
return result;
} | java | {
"resource": ""
} |
q157389 | ReactionRenderer.setup | train | @Override
public void setup(IReaction reaction, Rectangle screen) {
this.setScale(reaction);
Rectangle2D bounds = BoundsCalculator.calculateBounds(reaction);
this.modelCenter = new Point2d(bounds.getCenterX(), bounds.getCenterY());
this.drawCenter = new Point2d(screen.getCenterX(), s... | java | {
"resource": ""
} |
q157390 | ReactionRenderer.setScale | train | @Override
public void setScale(IReaction reaction) {
double bondLength = AverageBondLengthCalculator.calculateAverageBondLength(reaction);
double scale = this.calculateScaleForBondLength(bondLength);
// store the scale so that other components can access it
this.rendererModel.getPar... | java | {
"resource": ""
} |
q157391 | ReactionRenderer.paint | train | @Override
public void paint(IReaction reaction, IDrawVisitor drawVisitor, Rectangle2D bounds, boolean resetCenter) {
// calculate the bounds
Rectangle2D modelBounds = BoundsCalculator.calculateBounds(reaction);
this.setupTransformToFit(bounds, modelBounds, AverageBondLengthCalculator.calcu... | java | {
"resource": ""
} |
q157392 | DaylightModel.normal | train | private static boolean normal(int element, int charge, int valence) {
switch (element) {
case CARBON:
if (charge == -1 || charge == +1) return valence == 3;
return charge == 0 && valence == 4;
case NITROGEN:
case PHOSPHORUS:
case AR... | java | {
"resource": ""
} |
q157393 | SMARTSQueryTool.matches | train | public boolean matches(IAtomContainer atomContainer, boolean forceInitialization) throws CDKException {
if (this.atomContainer == atomContainer) {
if (forceInitialization) initializeMolecule();
} else {
this.atomContainer = atomContainer;
initializeMolecule();
... | java | {
"resource": ""
} |
q157394 | SMARTSQueryTool.getMatchingAtoms | train | public List<List<Integer>> getMatchingAtoms() {
List<List<Integer>> matched = new ArrayList<List<Integer>>(mappings.size());
for (int[] mapping : mappings)
matched.add(Ints.asList(mapping));
return matched;
} | java | {
"resource": ""
} |
q157395 | SMARTSQueryTool.getUniqueMatchingAtoms | train | public List<List<Integer>> getUniqueMatchingAtoms() {
List<List<Integer>> matched = new ArrayList<List<Integer>>(mappings.size());
Set<BitSet> atomSets = Sets.newHashSetWithExpectedSize(mappings.size());
for (int[] mapping : mappings) {
BitSet atomSet = new BitSet();
for ... | java | {
"resource": ""
} |
q157396 | SMARTSQueryTool.initializeMolecule | train | private void initializeMolecule() throws CDKException {
// initialise required invariants - the query has ISINRING set if
// the query contains ring queries [R?] [r?] [x?] etc.
SmartsMatchers.prepare(atomContainer, true);
// providing skip aromaticity has not be set apply the desired
... | java | {
"resource": ""
} |
q157397 | PharmacophoreQueryAngleBond.matches | train | @Override
public boolean matches(IBond bond) {
bond = BondRef.deref(bond);
if (bond instanceof PharmacophoreAngleBond) {
PharmacophoreAngleBond pbond = (PharmacophoreAngleBond) bond;
double bondLength = round(pbond.getBondLength(), 2);
return bondLength >= lower &... | java | {
"resource": ""
} |
q157398 | RingSetManipulator.getAtomCount | train | public static int getAtomCount(IRingSet set) {
int count = 0;
for (IAtomContainer atomContainer : set.atomContainers()) {
count += atomContainer.getAtomCount();
}
return count;
} | java | {
"resource": ""
} |
q157399 | RingSetManipulator.getBondCount | train | public static int getBondCount(IRingSet set) {
int count = 0;
for (IAtomContainer atomContainer : set.atomContainers()) {
count += atomContainer.getBondCount();
}
return count;
} | java | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.