use of algorithms.Planarity in project Smiles2Monomers by yoann-dufresne.
the class PlanarityTest method main.
public static void main(String[] args) {
String pepDBname = "datas/peptides.csv";
// Loading databases
PolymersJsonLoader pcl = new PolymersJsonLoader(new MonomersDB());
PolymersDB pepDB = pcl.loadFile(pepDBname);
// Tools
Planarity pt = new Planarity();
for (Polymer pep : pepDB.getObjects()) {
System.out.println(pep.getName() + " : ");
IMolecule mol = null;
try {
mol = SmilesConverter.conv.transform(pep.getSmiles());
} catch (InvalidSmilesException e) {
System.err.println("Impossible to parse " + pep.getName() + " id:" + pep.getId());
continue;
}
SimpleGraph g = MoleculeGraphs.getMoleculeGraph(mol);
System.out.println("planar : " + pt.isPlanar(g) + "\n");
}
}
Aggregations