Skip to content

Instantly share code, notes, and snippets.

import com.metamolecular.mx.model.Molecule;
import com.metamolecular.mx.io.Molecules;
import com.metamolecular.mx.query.DefaultAtomMatcher;
import junit.framework.TestCase;
public class Test extends TestCase
{
public void testTolueneQuatDoesntMatchNeopentaneQuat()
{
Molecule toluene = Molecules.createToluene();
import com.metamolecular.mx.io.daylight.SMILESReader;
import com.metamolecular.mx.map.Mapper;
import com.metamolecular.mx.map.DefaultMapper;
import com.metamolecular.mx.model.Atom;
import com.metamolecular.mx.query.Node;
import java.util.Map;
import junit.framework.TestCase;
public class Test extends TestCase
import com.metamolecular.mx.io.daylight.SMILESReader;
import com.metamolecular.mx.map.DefaultMapper;
import com.metamolecular.mx.map.Mapper;
import junit.framework.TestCase;
public class Test extends TestCase
{
public void testSaturatedSulfurDoesntMatchUnsaturatedSulfur()
{
Mapper mapper = new DefaultMapper(SMILESReader.read("S-C=O"));
import com.metamolecular.mx.fingerprint.Fingerprinter;
import com.metamolecular.mx.fingerprint.PathFingerprinter;
import com.metamolecular.mx.io.Molecules;
import junit.framework.TestCase;
import java.util.BitSet;
public class Test extends TestCase
{
/**
public void testItStopsBranchingWhenMaximumDepthReached()
{
walker.setMaximumDepth(5);
when(path.size()).thenReturn(0, 1, 2, 3, 4, 5);
when(step.hasNextBond()).thenReturn(true, true, true, true, true, false);
when(step.nextStep(bond)).thenReturn(step);
when(step.nextBond()).thenReturn(bond);
doStep();
verify(step, times(5)).nextStep(bond);
private void doStep()
{
walker.step(step, reporter);
}
public void testItDoesntRequestNextBondWhenMaximumDepthReached()
{
walker.setMaximumDepth(2);
when(path.size()).thenReturn(2);
doStep();
verify(step, never()).nextBond();
}
241
-OEChem-07100913442D
67 72 0 0 1 0 999 V2000
5.3950 -3.1602 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
4.9853 -3.8822 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
5.4045 -4.6006 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
6.2342 -4.5947 0.0000 C 0 0 2 0 0 0 0 0 0 0 0 0
6.6482 -3.8727 0.0000 C 0 0 1 0 0 0 0 0 0 0 0 0
6.2284 -3.1565 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
@rapodaca
rapodaca / gist:1241613
Created September 26, 2011 04:31
Distance from a point to a line or segment.
/**
* See: http://jsfromhell.com/math/dot-line-length
*
* Distance from a point to a line or segment.
*
* @param {number} x point's x coord
* @param {number} y point's y coord
* @param {number} x0 x coord of the line's A point
* @param {number} y0 y coord of the line's A point
* @param {number} x1 x coord of the line's B point
@rapodaca
rapodaca / gist:1245529
Created September 27, 2011 16:22
Test
chemtab.browser.FileView.prototype.wiggle = function() {
goog.dom.classes.add(this.getElement(), 'wiggle');
};