User 55ffa2f197
08-06-2016 19:33:55
Hi I am trying to align a collection of a-amino acids which drawn quite differently. To begin with i am adopting the conventional drawing template as attached, and use this as the reference for easyAlign. I notice that in one case where my amino acid is stereo configuration S (attachment before.mrv) . After it gets aligned by easyAlign it turns into R stereo config (attachment after.mrv). Also in my mind the correct alignment should be flipped horizontally, which is identical with the reference orentation.
Hope someone can help me with this. Or is the easyAlign still recommended pairwised alignment method from CXN API.
Here is the my method
private void alignAA(String smiles) {
mss = new MolSearch();
final MolSearchOptions msp = new MolSearchOptions(SearchOptions.SUBSTRUCTURE);
msp.isIgnoreTetrahedralStereo();
mss.setSearchOptions(msp);
mss.setQuery(aaReference);
Molecule targetMol;
try {
targetMol = MolImporter.importMol(smiles);
Cleaner.clean(targetMol,2);
mss.setTarget(targetMol);
System.out.println("before="+targetMol.toFormat("mrv"));
easyAlign = new AlignRigidEasy();
try {
int[][] hits=mss.findAll();
if(hits!=null&&hits.length==1){
easyAlign.setReference(aaReference);
easyAlign.setRotatable(targetMol);
int[][] easyMap = new int[6][2];
easyMap[1]=hits[0];
System.out.println(targetMol.getAtom(hits[0][1]).getSymbol()+":"+smiles);
easyMap[0]=new int[]{0,1,2,3,4,5};
try{
easyAlign.align(easyMap);
System.out.println("after="+easyAlign.getRotatedMolecule().toFormat("mrv"));
}catch(Exception e){
e.printStackTrace();
}
}
} catch (SearchException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
;
} catch (MolFormatException e) {
e.printStackTrace();
}
}
MolImporter molImporter;
try {
molImporter = new MolImporter("alphaAA.mrv");
aaReference = molImporter.read();
} catch (MolFormatException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}