Hi Nicolas,
please use developer mailing list, to avoid answering me questions
multiple times.
A more general way would be to get an 'atom property'-object with the
general descriptor interface !
The problem with your approach is, that you are not automatically
allowed to overwrite partial charges in the molecule.
So the obtained array contains the correct partial charges, but the
molecule contains the loaded ones, e.g. MOPAC, Sybyl, ...
The mol.automaticPartialCharge() checks this flag. You can set it with
mol.setAutomaticPartialCharge(boolean flag).
If not allowed to overwrite molecule is cloned before the partial charge
is calculated.
You've forgotten the initialization
JOEPhModel.instance().assignSeedPartialCharge(useMol);
O.k., now the general way:
String propertyName ="Gasteiger_Marsili";
AtomProperties properties;
if (JOEHelper.hasInterface(tmpPropResult, "AtomProperties"))
{
properties = (AtomProperties) tmpPropResult;
}
else
{
logger.error("Property '" + propertyName +
"' must be an atom type for calculating " + DESC_KEY +
" but it's " + tmpPropResult.getClass().getName() + ".");
return null;
}
then you can access the properties by using:
properties.getDoubleValue(atomIndex)
Kind regards, Joerg
> I'm a JOELib and CDK user and I've tried to use the available
> Gasteiger calculation classes, but I met some difficulties;
> First I have convert my CDK Molecule in a JOEMol molecule:
>
> Convertor conv = new Convertor();
> joelib.molecule.JOEMol joemolecule = conv.convert(molecule);
>
> (Where "molecule" is a valid CDK molecule). Second I have created a
> GasteigerMarsili object using:
>
> GasteigerMarsili gm = new GasteigerMarsili ();
> double[] atomprop = gm.getDoubleAtomProperties(joemolecule);
>
> But when I ask:
>
> System.out.println(joemolecule.getAtom(i).getPartialCharge());
>
> I have only 0.0 results.
>
> I have also try with:
>
> JOEGastChrg jgc = new JOEGastChrg();
> jgc.assignPartialCharges(joemolecule);
>
> But the result is the same. What do you think I forget in my source
> ? could you please comment just a little bit more about these methods ?
>
> Thanks a lot for your response,
>
> Nicolas Job
>
--
Dipl. Chem. Joerg K. Wegner
Center of Bioinformatics Tuebingen (ZBIT)
Department of Computer Architecture
Univ. Tuebingen, Sand 1, D-72076 Tuebingen, Germany
Phone: (+49/0) 7071 29 78970
Fax: (+49/0) 7071 29 5091
E-Mail: mailto:we...@in...
WWW: http://www-ra.informatik.uni-tuebingen.de
--
Never mistake motion for action.
(E. Hemingway)
Never mistake action for meaningful action.
(Hugo Kubinyi,2004)
|