use of algorithms.isomorphism.chains.Extension.BondMapping in project Smiles2Monomers by yoann-dufresne.
the class ChainLearning method initLearn.
// -------------------------------- Initialization ----------------------------------
private void initLearn(List<Residue> roots, ResidueMappings mappings) {
for (Residue res : roots) {
List<MappedChain> resMappings = new ArrayList<>();
for (IBond bond : res.getMolecule().bonds()) {
Extension ext = new Extension(bond);
Chain bloc = new Chain(ext);
String smiles = bloc.getMySmiles();
this.chains.put(smiles, bloc);
this.frequence.put(smiles, 0);
// Creation of residue matchings (sequences of size 1)
for (BondMapping bm : ext.match(bond, MatchingType.EXACT)) {
MappedChain resMap = this.createMappingFromMatch(res, bond, bloc, bm);
resMappings.add(resMap);
}
}
mappings.put(res, resMappings);
}
this.frequencesInit();
}
Aggregations