On Tuesday 19 June 2007 17:17, Robert Stones wrote: > I have a molecule mol = sp.parseSmiles("CCC"); > > Fingerprinter fingerprinter = new Fingerprinter(); > > Using CDK fingerprinter.getFingerprint(mol); > > Java BitSet representation: > BitSet BS1 = fingerprinter.getFingerprint(mol); > > I now want to store the BitSet BS1 representation of my mol in MySQL > database? > > So that I can pull the BitSet representation of mol out of my mySQL > database and compare my query molecule BitSet BS2 against BS1 as an > initial screen before doing a more deep substrcuture search. A possible way would be: -create 16 columns in the mysql database of type bigint. -create the 16 figures to save in here with a code similar to this: /** *Gets a BigIntger value representation of the Fingerprint bitset * * @param bs Fingerprint bitset * @param num A number between 63 and 1023 representing one of the 16 sectors of the Fingerprint * @return The BigInteger representations of the specified Fingerprint sector */ public static BigInteger getBigIntegerValue(BitSet bs, int num) { BigInteger bi = new BigInteger("0"); for (int i = 0; i < 64; i++) { if (bs.get(i + (num * 64))) { bi = bi.add(new BigInteger("2").pow(i)); } } return bi; -write the values to db with a normal update/insert statement, using getBigIntegerValue().longValue() -so a search like select from where fingerprintcolumn1 & searchfingerprint1=searchfingerprint1 and fingerprintcolumn2 ... Stefan
> > > Anyone got ideas how to do this. > > > > CSL Bioinformatics Internet Pages at http://bioinformatics.csl.gov.uk > ---------------------------------------------------------------------- > Robert Stones MRes, BSc Phone: +44 (0)1904 462675 > Higher Bioinformatics Specialist GTN: 5129 2675 > Central Science Laboratory Fax: +44 (0)1904 462111 > Sand Hutton Email: [EMAIL PROTECTED] > York YO41 1LZ Web: http://www.csl.gov.uk > ---------------------------------------------------------------------- > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Cdk-user mailing list > Cdk-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/cdk-user -- Stefan Kuhn BSc MA IPB Halle AG Bioinformatik & Massenspektrometrie Weinberg 3 06120 Halle http://www.ipb-halle.de http://msbi.bic-gh.de [EMAIL PROTECTED] +49 (0) 345 5582 1474 Fax.+49 (0) 345 5582 1409 ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Cdk-user mailing list Cdk-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cdk-user