Search in sources :

Example 1 with Extension

use of algorithms.isomorphism.chains.Extension in project Smiles2Monomers by yoann-dufresne.

the class BlocsTests method setUp.

@Before
public void setUp() throws Exception {
    this.sc = SmilesConverter.conv;
    // String smiles = "C(C(=O)O)C(=O)N";
    IAtom a1;
    IAtom a2;
    a1 = new Atom("C");
    a1.setFlag(CDKConstants.ISAROMATIC, true);
    a2 = new Atom("N");
    a2.setFlag(CDKConstants.ISAROMATIC, true);
    // NC
    this.ext1 = new Extension(new Bond(a1, a2, Order.SINGLE));
    a2 = new Atom("O");
    // NC=O
    this.ext2 = new Extension(new Bond(a1, a2, Order.DOUBLE));
    a2 = new Atom("C");
    a2.setFlag(CDKConstants.ISAROMATIC, true);
    // NC(C)=O
    this.ext3 = new Extension(new Bond(a1, a2, Order.SINGLE));
    a1 = new Atom("C");
    a1.setFlag(CDKConstants.ISAROMATIC, true);
    // NC(CC)=O
    this.ext4 = new Extension(new Bond(a1, a2, Order.SINGLE));
    a2 = new Atom("C");
    a2.setFlag(CDKConstants.ISAROMATIC, true);
    // NC(CCC)=O
    this.ext5 = new Extension(new Bond(a1, a2, Order.SINGLE));
    a1 = new Atom("C");
    a1.setFlag(CDKConstants.ISAROMATIC, true);
    a2 = new Atom("N");
    a2.setFlag(CDKConstants.ISAROMATIC, true);
    // N1C(CCC1)=O
    this.ext6 = new Extension(new Bond(a1, a2, Order.SINGLE));
    // NC
    this.blc1 = new Chain(null, ext1, -1, -1);
    // NC=O
    this.blc2 = new Chain(blc1, ext2, -1, 0);
    // NC(C)=O
    this.blc3 = new Chain(blc2, ext3, 0, -1);
    // NC(CC)=O
    this.blc4 = new Chain(blc3, ext4, 3, -1);
    // NC(CCC)=O
    this.blc5 = new Chain(blc4, ext5, 4, -1);
    // N1C(CC1)=O
    this.blc6 = new Chain(blc5, ext6, 5, 1);
}
Also used : Extension(algorithms.isomorphism.chains.Extension) Chain(algorithms.isomorphism.chains.Chain) Bond(org.openscience.cdk.Bond) IAtom(org.openscience.cdk.interfaces.IAtom) Atom(org.openscience.cdk.silent.Atom) IAtom(org.openscience.cdk.interfaces.IAtom) Before(org.junit.Before)

Example 2 with Extension

use of algorithms.isomorphism.chains.Extension in project Smiles2Monomers by yoann-dufresne.

the class BonbMatchingTests method lightMatching.

@Test
public void lightMatching() {
    Extension ext = new Extension("C,1,N,0,0");
    List<BondMapping> matchs = ext.match(this.bond1, MatchingType.LIGHT);
    Assert.assertTrue(matchs.size() == 1);
}
Also used : Extension(algorithms.isomorphism.chains.Extension) BondMapping(algorithms.isomorphism.chains.Extension.BondMapping) Test(org.junit.Test)

Example 3 with Extension

use of algorithms.isomorphism.chains.Extension in project Smiles2Monomers by yoann-dufresne.

the class BonbMatchingTests method strongMatching.

@Test
public void strongMatching() {
    Extension ext = new Extension("c,1,N,0,1");
    List<BondMapping> matchs = ext.match(this.bond1, MatchingType.STRONG);
    Assert.assertTrue(matchs.size() == 1);
}
Also used : Extension(algorithms.isomorphism.chains.Extension) BondMapping(algorithms.isomorphism.chains.Extension.BondMapping) Test(org.junit.Test)

Example 4 with Extension

use of algorithms.isomorphism.chains.Extension in project Smiles2Monomers by yoann-dufresne.

the class BonbMatchingTests method noHydrogenMatching.

@Test
public void noHydrogenMatching() {
    Extension ext = new Extension("c,1,N,0,0");
    List<BondMapping> matchs = ext.match(this.bond1, MatchingType.STRONG);
    Assert.assertTrue(matchs.size() == 1);
}
Also used : Extension(algorithms.isomorphism.chains.Extension) BondMapping(algorithms.isomorphism.chains.Extension.BondMapping) Test(org.junit.Test)

Example 5 with Extension

use of algorithms.isomorphism.chains.Extension in project Smiles2Monomers by yoann-dufresne.

the class BonbMatchingTests method aromaticNoMatching.

@Test
public void aromaticNoMatching() {
    Extension ext = new Extension("C,1,N,0,1");
    List<BondMapping> matchs = ext.match(this.bond1, MatchingType.STRONG);
    Assert.assertTrue(matchs.size() == 0);
}
Also used : Extension(algorithms.isomorphism.chains.Extension) BondMapping(algorithms.isomorphism.chains.Extension.BondMapping) Test(org.junit.Test)

Aggregations

Extension (algorithms.isomorphism.chains.Extension)11 BondMapping (algorithms.isomorphism.chains.Extension.BondMapping)8 Test (org.junit.Test)8 Chain (algorithms.isomorphism.chains.Chain)3 Before (org.junit.Before)2 Bond (org.openscience.cdk.Bond)2 IAtom (org.openscience.cdk.interfaces.IAtom)2 Atom (org.openscience.cdk.silent.Atom)2 BondAdd (algorithms.isomorphism.chains.BondAdd)1 ChainAdd (algorithms.isomorphism.chains.ChainAdd)1 FamilyChainsDB (algorithms.isomorphism.chains.FamilyChainsDB)1 HydrogenAdd (algorithms.isomorphism.chains.HydrogenAdd)1 MappedChain (algorithms.isomorphism.chains.MappedChain)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Family (model.Family)1 Monomer (model.Monomer)1 Polymer (model.Polymer)1 Residue (model.Residue)1 JSONArray (org.json.simple.JSONArray)1