Tanimoto similarity calculation with Java library

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Tanimoto similarity calculation with Java library

Selim güneş
Hello all,

I'd like to compute Tanimoto similarity of two ligands using Java library. There is an example of how to do it in Python, and also
I found this thread (https://sourceforge.net/p/openbabel/mailman/message/28660809/) but I got confused about the part we use vectorUnsignedInt().

I'd be really grateful if you help me through this.

My java implementation looks like this:

                 String smiles1 = lg1.lSMILES;
         String smiles2 = lg2.lSMILES;
         
         OBConversion conv = new OBConversion();
         OBMol mol = new OBMol();
                 OBMol mol2 = new OBMol();
         conv.SetInFormat("smi");
         conv.ReadString(mol, smiles1);
                 conv.ReadString(mol2, smiles2);

         
         OBFingerprint fprinter = OBFingerprint.FindFingerprint("FP2");
         OBVectorData fp = vectorUnsignedInt(); // ??? this is the part I could not integrate from python 
                 OBVectorData fp2 = vectorUnsignedInt(); // ??? it gives an error saying vectorUnsignedInt() is undefined
         fprinter.GetFingerprint(mol, fp);    
                 fprinter.GetFingerprint(mol2, fp2);
         
         double sim = OBFingerprint.Tanimoto(fp, fp2);


Thanks in advance!

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Tanimoto similarity calculation with Java library

Geoff Hutchison
         OBFingerprint fprinter = OBFingerprint.FindFingerprint("FP2");
         OBVectorData fp = vectorUnsignedInt(); // ??? this is the part I could not integrate from python 
                 OBVectorData fp2 = vectorUnsignedInt(); // ??? it gives an error saying vectorUnsignedInt() is undefined


The Java interface is created using the SWIG tool (http://swig.org/). The "vectorUnsignedInt" is a piece in the Open Babel python interface that helps to wrap the C++ std::vector<unsigned int> type.

I see a few hits on a search for "swig java c++ vector" but don't have the time right now to sift through. My guess is that code needs to be added to scripts/openbabel-java.i but it looks like there is a wrapper already in that java interface file.

-Geoff


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Tanimoto similarity calculation with Java library

Noel O'Boyle
Administrator
Looks like it's called VectorUnsignedInt in Java. This will be a
member of a class called something like openbabel, OpenBabel,
Openbabel.

- Noel

On 2 March 2016 at 20:56, Geoffrey Hutchison <[hidden email]> wrote:

>          OBFingerprint fprinter = OBFingerprint.FindFingerprint("FP2");
>          OBVectorData fp = vectorUnsignedInt(); // ??? this is the part I
> could not integrate from python
>                  OBVectorData fp2 = vectorUnsignedInt(); // ??? it gives an
> error saying vectorUnsignedInt() is undefined
>
>
>
> The Java interface is created using the SWIG tool (http://swig.org/). The
> "vectorUnsignedInt" is a piece in the Open Babel python interface that helps
> to wrap the C++ std::vector<unsigned int> type.
>
> I see a few hits on a search for "swig java c++ vector" but don't have the
> time right now to sift through. My guess is that code needs to be added to
> scripts/openbabel-java.i but it looks like there is a wrapper already in
> that java interface file.
>
> -Geoff
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Tanimoto similarity calculation with Java library

Noel O'Boyle
Administrator
My bad. Actually, now that I actually look in the jar file, it seems
that it is called vectorUnsignedInt and is present in package
org.openbabel.

On 3 March 2016 at 11:15, Noel O'Boyle <[hidden email]> wrote:

> Looks like it's called VectorUnsignedInt in Java. This will be a
> member of a class called something like openbabel, OpenBabel,
> Openbabel.
>
> - Noel
>
> On 2 March 2016 at 20:56, Geoffrey Hutchison <[hidden email]> wrote:
>>          OBFingerprint fprinter = OBFingerprint.FindFingerprint("FP2");
>>          OBVectorData fp = vectorUnsignedInt(); // ??? this is the part I
>> could not integrate from python
>>                  OBVectorData fp2 = vectorUnsignedInt(); // ??? it gives an
>> error saying vectorUnsignedInt() is undefined
>>
>>
>>
>> The Java interface is created using the SWIG tool (http://swig.org/). The
>> "vectorUnsignedInt" is a piece in the Open Babel python interface that helps
>> to wrap the C++ std::vector<unsigned int> type.
>>
>> I see a few hits on a search for "swig java c++ vector" but don't have the
>> time right now to sift through. My guess is that code needs to be added to
>> scripts/openbabel-java.i but it looks like there is a wrapper already in
>> that java interface file.
>>
>> -Geoff
>>
>>
>> ------------------------------------------------------------------------------
>> Site24x7 APM Insight: Get Deep Visibility into Application Performance
>> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
>> Monitor end-to-end web transactions and take corrective actions now
>> Troubleshoot faster and improve end-user experience. Signup Now!
>> http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss