User 97986b5d09
20-04-2009 08:07:55
Hi everybody,
I have a little problem with the CFParameters class. When I create the object
(CFParameters params = new CFParameters(new File("cfp.xml"));)
I see wrong datas in the object.
The "length" field has value 1024, but the "data" field is a 129 length byte array. It should be a 128 length byte array.
I use the latest version of jchem, and the configuration xml file is attached.
Do anybody know why i have wrong datas in the "data" field?
Thank you for your replies!
ChemAxon 42004978e8
21-04-2009 16:41:18
Hello László,
A colleague of us who is expert with the CFParameters class will answer your question soon.
Bye,
Robert
ChemAxon efa1591b5a
22-04-2009 12:10:38
Hi,
I see wrong datas in the object.Can you be more specific what data is actually wrong?
The "length" field has value 1024, but the "data" field is a 129 length byte array. It should be a 128 length byte array.
Why should it be 128? It can actually be anything, any size just made sure that the 1024 bits of the fingerprint are stored, right?
The .data field stores the internal representation of the ChemicalFingerprint as a MoleculeDescriptor, it's our choice how we represent it and users of this class should not be bothered what's inside the class. The get an external representation the toData() method has to be invoked instead of direct access to the (otherwise protected) .data field.
If, however, your circumstances are special and you are working on a class derived from the ChemicalFingerprint class then you may need to tell us more about your aims to enable us to better support your goals.
Do anybody know why i have wrong datas in the "data" field?
Again, tell us more why do you think data is wrong. What did you experience and what are your expectations.
I'm afraid I cannot help you unless you make a more specific description of the problem you encountered.
Regards,
Miklos
User 97986b5d09
23-04-2009 07:01:09
Hi Miklos,
Thank you for you reply!
I though, if the length is 1024 the data field must be a byte array with 128 elements.
After the fingerprint generation, i just convert the fingerprint to binary format, thats all. But when i got a byte array with 129 elements from the toData() method, my fingerprint file will have wrong length after my conversion. If i use only the first 128 elemenst of this array, the fingerprint is good. So it's useful for me, if i don't use all of the 129 elments, because the last element alwasy has value 0 (if true if i use different fingerprint length).
Just i though it's a bug, because i did not see it, and didn't have assertion problem before.
Laszlo
Edit: i'm sorry i sad sg wrong. :) It's not converting (i can not be converting because the toData() method returns byte array), i just write these bytes to a file. And if i write all of the bytes to a file, i have wrong fingerprint length.
ChemAxon efa1591b5a
28-04-2009 08:18:27
Hi Laszlo,
toData() was not intended for external usage, though feel free to use it in your application. The extra byte has been preserved to store additional information if needed (e.g. encoding method, when applicable). You can ignore it for now.
HTH
Miklos