-
Notifications
You must be signed in to change notification settings - Fork 1
5. Scaffold network generation
Construct a scaffold network from multiple input molecules (see article for details).
ScaffoldGenerator tmpScaffoldGen = new ScaffoldGenerator();
SmilesParser tmpSmiPar = new SmilesParser(SilentChemObjectBuilder.getInstance());
SmilesGenerator tmpSmiGen = tmpScaffoldGen.getSmilesGenerator();
IAtomContainer tmpDiazepam = tmpSmiPar.parseSmiles("CN1C(=O)CN=C(C2=C1C=CC(=C2)Cl)C3=CC=CC=C3");
IAtomContainer tmpBromazepam = tmpSmiPar.parseSmiles("C1C(=O)NC2=C(C=C(C=C2)Br)C(=N1)C3=CC=CC=N3");
IAtomContainer tmpZolazepam = tmpSmiPar.parseSmiles("CC1=NN(C2=C1C(=NCC(=O)N2C)C3=CC=CC=C3F)C");
List tmpInputMolecules = Arrays.asList(tmpDiazepam, tmpBromazepam, tmpZolazepam);
ScaffoldNetwork tmpDiazepinonesNetwork = tmpScaffoldGen.generateScaffoldNetwork(tmpInputMolecules);
System.out.println("\nScaffold network:");
//the root scaffolds have level 0 and from there, the level increases.
//scaffolds on level 0 either have only one ring or cannot be dissected further, e.g. complex aromatic systems
System.out.println("Max level: " + tmpDiazepinonesNetwork.getMaxLevel());
//Printing all scaffold and parent scaffolds on each level
for (int i = 0; i <= tmpDiazepinonesNetwork.getMaxLevel(); i++) {
System.out.println("\nLevel " + i + ":");
for (ScaffoldNodeBase tmpNode: tmpDiazepinonesNetwork.getAllNodesOnLevel(i)) {
System.out.println(tmpSmiGen.create((IAtomContainer) tmpNode.getMolecule()));
}
}
//the scaffold network graph can be exported as an adjacency matrix
Integer[][] tmpMatrix = tmpDiazepinonesNetwork.getMatrix();
System.out.println("\nMatrix:");
for (int i = 0; i < tmpMatrix.length; i++) {
String tmpRow = "";
for (int j = 0; j < tmpMatrix[i].length; j++) {
tmpRow += tmpMatrix[i][j] + ", ";
}
System.out.println(tmpRow);
}
//the method getMatrixNodes() returns the scaffolds and parent scaffolds ordered by their positions in the matrix above
System.out.println("\nMatrix nodes:");
for (Integer tmpIndex : tmpDiazepinonesNetwork.getMatrixNodes().keySet()) {
System.out.println(tmpIndex + ": " + tmpSmiGen.create((IAtomContainer) tmpDiazepinonesNetwork.getMatrixNode(tmpIndex).getMolecule()));
System.out.println("Level: " + tmpDiazepinonesNetwork.getMatrixNode(tmpIndex).getLevel());
}
Output:
Scaffold network:
Max level: 2
Level 0:
O=C1NC=CC=NC1
c1ccccc1
n1ccc[nH]1
n1ccccc1
Level 1:
O=C1NC=CC(=NC1)c2ncccc2
O=C1Nc2ccccc2C=NC1
O=C1NC=CC(=NC1)c2ccccc2
O=C1Nc2[nH]ncc2C=NC1
Level 2:
O=C1Nc2[nH]ncc2C(=NC1)c3ccccc3
O=C1Nc2ccccc2C(=NC1)c3ccccc3
O=C1Nc2ccccc2C(=NC1)c3ncccc3
Matrix:
0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0,
1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0,
0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0,
0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0,
0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
Matrix nodes:
0: O=C1Nc2ccccc2C(=NC1)c3ccccc3
Level: 2
1: O=C1Nc2ccccc2C=NC1
Level: 1
2: O=C1NC=CC(=NC1)c2ccccc2
Level: 1
3: O=C1NC=CC=NC1
Level: 0
4: c1ccccc1
Level: 0
5: O=C1Nc2ccccc2C(=NC1)c3ncccc3
Level: 2
6: O=C1NC=CC(=NC1)c2ncccc2
Level: 1
7: n1ccccc1
Level: 0
8: O=C1Nc2[nH]ncc2C(=NC1)c3ccccc3
Level: 2
9: O=C1Nc2[nH]ncc2C=NC1
Level: 1
10: n1ccc[nH]1
Level: 0