use of io.loaders.json.ResidueJsonLoader in project Smiles2Monomers by yoann-dufresne.
the class ResidueCreatorTests method linksLoadingTest.
@Test
public void linksLoadingTest() {
ResidueJsonLoader rjl = new ResidueJsonLoader(this.rules, this.monos);
rjl.saveFile(this.families, "tmp.json");
Residue.resetResidues();
FamilyDB loaded = rjl.loadFile("tmp.json");
new File("tmp.json").delete();
Family famTyr = null;
try {
famTyr = loaded.getObject("Tyr");
} catch (NullPointerException e) {
e.printStackTrace();
}
Residue tyrN = null;
for (Residue res : famTyr.getResidues()) if ("Tyr_pepN".equals(res.getName())) {
tyrN = res;
break;
}
Entry<IAtom, Rule> entry = tyrN.getAtomicLinks().entrySet().iterator().next();
IAtom a = entry.getKey();
Assert.assertEquals(a.getSymbol(), "N");
}
use of io.loaders.json.ResidueJsonLoader in project Smiles2Monomers by yoann-dufresne.
the class LoadersTests method setUp.
@Before
public void setUp() throws Exception {
this.jsonMonos = new MonomersJsonLoader().loadFile("data_tests/monos.json");
this.jsonRules = RulesJsonLoader.loader.loadFile("data_tests/rules.json");
ResidueJsonLoader rjl = new ResidueJsonLoader(jsonRules, this.jsonMonos);
this.jsonFamilies = rjl.loadFile("data_tests/res.json");
}
Aggregations