User 71f9fd1282
09-09-2004 10:57:40
I store the structures in a table called "test3" and using a custom fingerprint (classes FP*.java) and used generatemd to create the custom fingerprints for the molecules in table "f9901".
Now I want to count how often a Bit is set in "f9901" for a group of molecules belonging to the same drugclass (this information is stored in a user defined field VARCHAR(100) called 'gruppe', e.g. "aRB").
Can you tell me if i am really reading out the data from the "f9901" table (or am i creating new fingerprints according to the FPGenerator-class???)?
Thanks for your help!
here is the code:
public class mrechnen
{
public static void main(String[] args)
throws SQLException, ClassNotFoundException
{
int dim=379; //fingerprintlength
String structuretablename = "test3";
String fingerprintname = "f9901"
String gruppe = "aRB"
String[] mdNames = {fingerprintname};
String sqlCondition="gruppe='"+gruppe+"'";
ConnectionHandler ch = new ConnectionHandler();
ch.setDriver("org.gjt.mm.mysql.Driver");
ch.setUrl("jdbc:mysql://localhost/mysql");
ch.setLoginName("fp1");
ch.setPassword(";-)");
try
{
ch.connect();
}
catch ...
MDDBReader mddbreader = new MDDBReader(ch, structuretablename, mdNames, sqlCondition);
String cd_id;
int ctr=0;
MDSet mdset = new MDSet();
FP descriptor = new FP();
int i,j,hits=0;
int[] bitsset = new int[dim];
boolean ersterTreffer = true;
try
{
while (mddbreader.next()!=null)
{
if (ersterTreffer)
{
ersterTreffer = false;
}
ctr=ctr+1;
mdset = mddbreader.getMDSet();
// is this correct?????
descriptor = (FP) mdset.getDescriptor(0);
System.out.println("Checking molecule nr"+ctr+". of group");
for (i=0;i<dim;i++) //Eintraege berechnen
{
if (descriptor.getKey(i)==1)
{
bitsset++;
}
...
}
Now I want to count how often a Bit is set in "f9901" for a group of molecules belonging to the same drugclass (this information is stored in a user defined field VARCHAR(100) called 'gruppe', e.g. "aRB").
Can you tell me if i am really reading out the data from the "f9901" table (or am i creating new fingerprints according to the FPGenerator-class???)?
Thanks for your help!
here is the code:
public class mrechnen
{
public static void main(String[] args)
throws SQLException, ClassNotFoundException
{
int dim=379; //fingerprintlength
String structuretablename = "test3";
String fingerprintname = "f9901"
String gruppe = "aRB"
String[] mdNames = {fingerprintname};
String sqlCondition="gruppe='"+gruppe+"'";
ConnectionHandler ch = new ConnectionHandler();
ch.setDriver("org.gjt.mm.mysql.Driver");
ch.setUrl("jdbc:mysql://localhost/mysql");
ch.setLoginName("fp1");
ch.setPassword(";-)");
try
{
ch.connect();
}
catch ...
MDDBReader mddbreader = new MDDBReader(ch, structuretablename, mdNames, sqlCondition);
String cd_id;
int ctr=0;
MDSet mdset = new MDSet();
FP descriptor = new FP();
int i,j,hits=0;
int[] bitsset = new int[dim];
boolean ersterTreffer = true;
try
{
while (mddbreader.next()!=null)
{
if (ersterTreffer)
{
ersterTreffer = false;
}
ctr=ctr+1;
mdset = mddbreader.getMDSet();
// is this correct?????
descriptor = (FP) mdset.getDescriptor(0);
System.out.println("Checking molecule nr"+ctr+". of group");
for (i=0;i<dim;i++) //Eintraege berechnen
{
if (descriptor.getKey(i)==1)
{
bitsset++;
}
...
}