Hello!
I am currently struggling with writing fingerprints (i.e. from CDK or RDKit) to a file in something else than a bistring (which is the typical way to do so using a Column Rename node to convert the fingerprint column into a (bit)string column). I would prefer Base64 for file size reasons or at least hex format. Java converters exist for these but they require the fingerprint to be in the right input format. And it is not yet obvious to me which internal format is used by Knime for dealing with fingerprints.
I.e. fingerprints cannot directly be converted to Base64 using javax.xml.bind.DatatypeConverter.printBase64Binary($FINGERPRINT$)
as this requires $FINGERPRINT$
to be an array of bin ( bin[]
) but it is reported by the compiler to be java.lang.String
(which surprises me as I expected a binary fingerprint to be represented by a binary object). So one could expect that converting the fingerprint to a byte array before should help:
fp_bin = $FINGERPRINT$.getBytes();
String Base64 = javax.xml.bind.DatatypeConverter.printBase64Binary(fp_bin);
Indeed this results in a valid Base64 string, but it is of wrong size.
So, does anybody have a solution for this?
Thanks!