Search in sources :

Example 6 with Extension

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

the class IsomorphismTests method setUp.

@Before
public void setUp() throws Exception {
    // Database
    Monomer[] monos = new Monomer[1];
    Polymer pepTest = new Polymer(0, "malformin A1", "O=C1NC2C(=O)NC(C(=O)NC(C(=O)NC(C(=O)NC1CSSC2)C(C)CC)CC(C)C)C(C)C", monos);
    // Extensions
    IAtom a = new Atom("C");
    IBond b1 = new Bond(new Atom("S"), a, Order.SINGLE);
    this.ext1 = new Extension(b1);
    a = new Atom("C");
    IAtom a2 = new Atom("C");
    IBond b2 = new Bond(a, a2, Order.SINGLE);
    this.ext2 = new Extension(b2);
    // Mapped blocs
    this.mb0 = new MappedChain(pepTest, null, new ArrayList<Integer>(), new ArrayList<Integer>(), new ArrayList<MatchingType>(), new HashMap<Integer, Integer>());
    // For blocs Tests
    this.bloc = new Chain("S,0,c,0,0,-1,-1;c,0,c,0,0,-1,1");
}
Also used : Extension(algorithms.isomorphism.chains.Extension) MappedChain(algorithms.isomorphism.chains.MappedChain) Chain(algorithms.isomorphism.chains.Chain) MappedChain(algorithms.isomorphism.chains.MappedChain) HashMap(java.util.HashMap) IBond(org.openscience.cdk.interfaces.IBond) ArrayList(java.util.ArrayList) Polymer(model.Polymer) Monomer(model.Monomer) Bond(org.openscience.cdk.Bond) IBond(org.openscience.cdk.interfaces.IBond) IAtom(org.openscience.cdk.interfaces.IAtom) Atom(org.openscience.cdk.silent.Atom) IAtom(org.openscience.cdk.interfaces.IAtom) Before(org.junit.Before)

Example 7 with Extension

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

the class BonbMatchingTests method perfectMatching.

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

Example 8 with Extension

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

the class BonbMatchingTests method noPerfectMatching.

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

Example 9 with Extension

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

the class BonbMatchingTests method hydrogenNoMatching.

@Test
public void hydrogenNoMatching() {
    Extension ext = new Extension("c,1,N,1,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)

Example 10 with Extension

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

the class BonbMatchingTests method strongMatching2.

@Test
public void strongMatching2() {
    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)

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