11Introduction
22============
33
4- ` Reaction Decoder Tool (RDT) v3.1 .0 `
4+ ` Reaction Decoder Tool (RDT) v3.2 .0 `
55--------------------------------------
66
7+ ** Toolkit-agnostic reaction mapping engine** with CDK adapter. Deterministic, no training data required.
8+
79` 1. Atom Atom Mapping (AAM) Tool `
810
911` 2. Reaction Annotator (Extract Bond Changes, Identify & Mark Reaction Centres) `
@@ -32,50 +34,69 @@ use pom.xml and mvn commands to build your project
32346) mvn -P local clean install (fat jar with tests)
3335```
3436
35- Atom Atom Mapping using Java API
36- =================================
37+ Simple Java API (Recommended)
38+ ==============================
39+
40+ ``` java
41+ import com.bioinceptionlabs.reactionblast.api.RDT ;
42+ import com.bioinceptionlabs.reactionblast.api.ReactionResult ;
43+
44+ public class Example {
45+ public static void main (String [] args ) {
46+ // One-line reaction mapping — no CDK knowledge needed
47+ ReactionResult result = RDT . map(" CC(=O)O.OCC>>CC(=O)OCC.O" );
48+
49+ System . out. println(" Mapped: " + result. getMappedSmiles());
50+ System . out. println(" Bond changes: " + result. getTotalBondChanges());
51+ System . out. println(" Formed/cleaved: " + result. getFormedCleavedBonds());
52+ System . out. println(" Order changes: " + result. getOrderChangedBonds());
53+ }
54+ }
55+ ```
56+
57+ Advanced Java API (CDK)
58+ ========================
59+
60+ For users who need CDK-level control:
3761
3862``` java
3963import org.openscience.cdk.interfaces.IReaction ;
4064import org.openscience.cdk.silent.SilentChemObjectBuilder ;
41- import org.openscience.cdk.smiles.SmiFlavor ;
42- import org.openscience.cdk.smiles.SmilesGenerator ;
4365import org.openscience.cdk.smiles.SmilesParser ;
44- import com.bioinceptionlabs.reactionblast.mechanism.MappingSolution ;
4566import com.bioinceptionlabs.reactionblast.mechanism.ReactionMechanismTool ;
4667import com.bioinceptionlabs.reactionblast.tools.StandardizeReaction ;
4768
48- public class Example {
69+ public class AdvancedExample {
4970 public static void main (String [] args ) throws Exception {
50- final SmilesGenerator sg = new SmilesGenerator (SmiFlavor . AtomAtomMap );
51- final SmilesParser smilesParser = new SmilesParser (SilentChemObjectBuilder . getInstance());
52-
53- String reactionSM = " CC(=O)C=C.CC=CC=C>>CC1CC(CC=C1)C(C)=O" ;
54- String reactionName = " DielsAlder" ;
71+ SmilesParser sp = new SmilesParser (SilentChemObjectBuilder . getInstance());
72+ IReaction rxn = sp. parseReactionSmiles(" CC(=O)C=C.CC=CC=C>>CC1CC(CC=C1)C(C)=O" );
73+ rxn. setID(" DielsAlder" );
5574
56- IReaction cdkReaction = smilesParser. parseReactionSmiles(reactionSM);
57-
58- IReaction performAtomAtomMapping = performAtomAtomMapping(cdkReaction, reactionName);
59- System . out. println(" AAM sm: " + sg. create(performAtomAtomMapping));
60- }
61-
62- public static IReaction performAtomAtomMapping (IReaction cdkReaction , String reactionName ) throws Exception {
63- cdkReaction. setID(reactionName);
64- boolean forceMapping = true ;
65- boolean generate2D = true ;
66- boolean generate3D = false ;
67- boolean complexMapping = true ;
68- boolean acceptNoChange = false ;
69- StandardizeReaction standardizeReaction = new StandardizeReaction ();
7075 ReactionMechanismTool rmt = new ReactionMechanismTool (
71- cdkReaction, forceMapping, generate2D, generate3D,
72- complexMapping, acceptNoChange, standardizeReaction);
73- MappingSolution s = rmt. getSelectedSolution();
74- return s. getReaction();
76+ rxn, true , true , false , true , false , new StandardizeReaction ());
77+
78+ System . out. println(" Algorithm: " + rmt. getSelectedSolution(). getAlgorithmID());
7579 }
7680}
7781```
7882
83+ Toolkit-Agnostic Graph Model API
84+ ==================================
85+
86+ For users who want to swap CDK with RDKit/OpenBabel:
87+
88+ ``` java
89+ import com.bioinceptionlabs.reactionblast.model.* ;
90+ import com.bioinceptionlabs.reactionblast.cdk.CDKToolkit ;
91+
92+ // Register toolkit once at startup
93+ ChemToolkit . register(new CDKToolkit ());
94+
95+ // Parse and map using toolkit-agnostic types
96+ ReactionGraph rxn = ChemToolkit . get(). parseReactionSmiles(" CC>>CC" );
97+ // ... pass to ReactionMechanismTool(rxn, true, true)
98+ ```
99+
79100
80101Migrating from v2.x
81102====================
@@ -88,7 +109,7 @@ The package namespace has changed from `uk.ac.ebi` to `com.bioinceptionlabs` in
88109<!-- Old (v2.x) -->
89110<groupId >uk.ac.ebi.rdt</groupId >
90111
91- <!-- New (v3.1 .0+) -->
112+ <!-- New (v3.2 .0+) -->
92113<groupId >com.bioinceptionlabs</groupId >
93114```
94115
@@ -137,7 +158,7 @@ Sub-commands
137158` AAM using SMILES `
138159
139160 ```
140- java -jar rdt-3.1 .0-jar-with-dependencies.jar -Q SMI -q "CC(O)CC(=O)OC(C)CC(O)=O.O[H]>>[H]OC(=O)CC(C)O.CC(O)CC(O)=O" -g -c -j AAM -f TEXT
161+ java -jar rdt-3.2 .0-jar-with-dependencies.jar -Q SMI -q "CC(O)CC(=O)OC(C)CC(O)=O.O[H]>>[H]OC(=O)CC(C)O.CC(O)CC(O)=O" -g -c -j AAM -f TEXT
141162 ```
142163
143164` Perform AAM ` for Transporters
@@ -146,14 +167,14 @@ Sub-commands
146167` AAM using SMILES ` (accept mapping with no bond changes -b)
147168
148169 ```
149- java -jar rdt-3.1 .0-jar-with-dependencies.jar -Q SMI -q "O=C(O)C(N)CC(=O)N.O=C(O)C(N)CS>>C(N)(CC(=O)N)C(=O)O.O=C(O)C(N)CS" -b -g -c -j AAM -f TEXT
170+ java -jar rdt-3.2 .0-jar-with-dependencies.jar -Q SMI -q "O=C(O)C(N)CC(=O)N.O=C(O)C(N)CS>>C(N)(CC(=O)N)C(=O)O.O=C(O)C(N)CS" -b -g -c -j AAM -f TEXT
150171 ```
151172
152173` Annotate Reaction using SMILES `
153174---------------------------------
154175
155176 ```
156- java -jar rdt-3.1 .0-jar-with-dependencies.jar -Q SMI -q "CC(O)CC(=O)OC(C)CC(O)=O.O[H]>>[H]OC(=O)CC(C)O.CC(O)CC(O)=O" -g -c -j ANNOTATE -f XML
177+ java -jar rdt-3.2 .0-jar-with-dependencies.jar -Q SMI -q "CC(O)CC(=O)OC(C)CC(O)=O.O[H]>>[H]OC(=O)CC(C)O.CC(O)CC(O)=O" -g -c -j ANNOTATE -f XML
157178 ```
158179
159180
@@ -163,12 +184,12 @@ Sub-commands
163184` Compare Reactions using SMILES with precomputed AAM mappings `
164185
165186 ```
166- java -jar rdt-3.1 .0-jar-with-dependencies.jar -Q RXN -q example/ReactionDecoder_mapped.rxn -T RXN -t example/ReactionDecoder_mapped.rxn -j COMPARE -f BOTH -u
187+ java -jar rdt-3.2 .0-jar-with-dependencies.jar -Q RXN -q example/ReactionDecoder_mapped.rxn -T RXN -t example/ReactionDecoder_mapped.rxn -j COMPARE -f BOTH -u
167188 ```
168189
169190
170191` Compare Reactions using RXN files `
171192
172193 ```
173- java -jar rdt-3.1 .0-jar-with-dependencies.jar -Q RXN -q example/ReactionDecoder_mapped.rxn -T RXN -t example/ReactionDecoder_mapped.rxn -j COMPARE -f BOTH
194+ java -jar rdt-3.2 .0-jar-with-dependencies.jar -Q RXN -q example/ReactionDecoder_mapped.rxn -T RXN -t example/ReactionDecoder_mapped.rxn -j COMPARE -f BOTH
174195 ```
0 commit comments