Hi Robert,
Thanks for taking the time with this issue.
just need to get this the correct way.(I am NOT a chemist so nitro group transformation/standardization leaves me in the dark :-))
Just wondering what the best way to approach this..
Will I have to change the strucutures in the db, or will a standardization xml perform the transformation when searching..? (leaving the db as is, just altering the search).
UPDATE:
I am creating a method that will read a structure from the DB apply standardization and return the structure..
This leaves me with a method like this:
private void ApplyStandardizer(Structure st) {
Standardizer std = new Standardizer(new java.io.File(@"standardization.xml"));
if (std != null) {
std.setFinalClean();
Molecule m = st.StructureMolecule;
if (m != null) {
std.standardize(m);
// get applied task indexes
int[] inds = std.getAppliedTaskIndexes();
// get applied task IDs
String[] ids = std.getAppliedTaskIDs();
// store applied task indexes and IDs in molecule properties
String indsprop = "";
for (int i = 0; i < inds.Length; ++i) {
indsprop += inds + " ";
}
String idsprop = "";
for (int i = 0; i < ids.Length; ++i) {
idsprop += ids + " ";
}
m.setProperty("TASK_INDEXES", indsprop);
m.setProperty("TASK_IDS", idsprop);
MolHandler mol = new MolHandler(m);
}
}
}
2 questions here:
A.: What does the following do??? and is it neccecary?
-------------------------------------------------
// get applied task indexes
int[] inds = std.getAppliedTaskIndexes();
// get applied task IDs
String[] ids = std.getAppliedTaskIDs();
// store applied task indexes and IDs in molecule properties
String indsprop = "";
for (int i = 0; i < inds.Length; ++i) {
indsprop += inds + " ";
}
String idsprop = "";
for (int i = 0; i < ids.Length; ++i) {
idsprop += ids + " ";
}
m.setProperty("TASK_INDEXES", indsprop);
m.setProperty("TASK_IDS", idsprop);
-------------------------------------------------
B: I Use a home grown Structure object that contains properties from the structure table. one of them being the cd_smiles that I use to create the molecule object.. but how do I go the other way..?
Molecule -> cd_smiles (string)??
Don't seem to find a method in the molhandler class for this.
Dann