Ways to differentiate [R1] and [R2] in molecule

User 55ffa2f197

14-05-2014 17:43:29

In Marvin API is there a way to find out which atom is [R1] and [R2] if there are defined in the molecule. Thanks. dong

ChemAxon 2c555f5717

15-05-2014 13:20:33

Dear dlee,


I think, this code snippet can help you:


            Molecule m;
for(int i=0; i<m.getAtomCount(); ++i) {
MolAtom a = m.getAtom(i);
if(a.getAtno() == MolAtom.RGROUP && a.getRgroup() == 1) {
System.out.println("This is R1:\t"+a);
}
if(a.getAtno() == MolAtom.RGROUP && a.getRgroup() == 2) {
System.out.println("This is R2:\t"+a);
}
}

Regards:
Balázs 

User 55ffa2f197

15-05-2014 13:58:29

thanks, it does. this is a common thing pepope will do when they parse a template drawing


Dong