Search in sources :

Example 11 with MonomersDB

use of db.MonomersDB in project Smiles2Monomers by yoann-dufresne.

the class ContractedGraphTests method setUp.

@Before
public void setUp() throws Exception {
    MonomersDB monos = new MonomersJsonLoader().loadFile("data_tests/monos.json");
    PolymersDB peps = new PolymersJsonLoader(monos).loadFile("data_tests/peps.json");
    RulesDB rules = RulesJsonLoader.loader.loadFile("data_tests/rules.json");
    ResidueCreator rc = new ResidueCreator(rules);
    FamilyDB families = rc.createResidues(monos);
    ChainLearning cl = new ChainLearning(peps);
    cl.setMarkovianSize(3);
    cl.learn(families);
    ChainsDB chains = cl.getDb();
    MonomericSpliting ms = new MonomericSpliting(families, chains, 2, 2, 3);
    Polymer pol = peps.getObject("633");
    ms.computeCoverage(pol);
    this.coverage = ms.getCoverage();
    this.coverage.calculateGreedyCoverage();
    this.contractedGraph = new ContractedGraph(coverage);
}
Also used : RulesDB(db.RulesDB) MonomericSpliting(algorithms.MonomericSpliting) MonomersJsonLoader(io.loaders.json.MonomersJsonLoader) PolymersDB(db.PolymersDB) MonomersDB(db.MonomersDB) PolymersJsonLoader(io.loaders.json.PolymersJsonLoader) ChainsDB(algorithms.isomorphism.chains.ChainsDB) Polymer(model.Polymer) ResidueCreator(algorithms.ResidueCreator) FamilyDB(db.FamilyDB) ChainLearning(algorithms.isomorphism.chains.ChainLearning) Before(org.junit.Before)

Example 12 with MonomersDB

use of db.MonomersDB in project Smiles2Monomers by yoann-dufresne.

the class TreeWidthTests method setUp.

@Before
public void setUp() throws Exception {
    String pepDBname = "data_tests/peps.json";
    // Loading databases
    MonomersDB monoDB = new MonomersDB();
    PolymersJsonLoader pcl = new PolymersJsonLoader(monoDB);
    this.pepDB = pcl.loadFile(pepDBname);
}
Also used : MonomersDB(db.MonomersDB) PolymersJsonLoader(io.loaders.json.PolymersJsonLoader) Before(org.junit.Before)

Aggregations

MonomersDB (db.MonomersDB)12 PolymersJsonLoader (io.loaders.json.PolymersJsonLoader)10 PolymersDB (db.PolymersDB)9 MonomersJsonLoader (io.loaders.json.MonomersJsonLoader)7 RulesDB (db.RulesDB)6 FamilyDB (db.FamilyDB)5 ResidueJsonLoader (io.loaders.json.ResidueJsonLoader)5 File (java.io.File)5 Polymer (model.Polymer)5 Before (org.junit.Before)4 ResidueCreator (algorithms.ResidueCreator)3 MonomersSerialization (io.loaders.serialization.MonomersSerialization)3 InvalidSmilesException (org.openscience.cdk.exception.InvalidSmilesException)3 MonomericSpliting (algorithms.MonomericSpliting)2 ChainLearning (algorithms.isomorphism.chains.ChainLearning)2 ChainsDB (algorithms.isomorphism.chains.ChainsDB)2 Coverage (algorithms.utils.Coverage)2 Coverages2HTML (io.html.Coverages2HTML)2 ImagesGeneration (io.imgs.ImagesGeneration)2 ColorsMap (io.imgs.PictureCoverageGenerator.ColorsMap)2