Re: [Rdkit-discuss] SDWriter from Java

2016-03-30 Thread Greg Landrum
On Wed, Mar 30, 2016 at 2:47 PM, Tim Dudgeon  wrote:

> And there's no other way to generate a SDF from Java?
> e.g. can each ROMol be converted to text in SD format and then that text
> written to the Java OutputStream?
>

There's no way to do it in a single step.
You can get the mol block and the properties individually and then use
those, but that's not particularly nice.

I *think* I can pretty easily add a static method to the SDWriter class
that takes a molecule and optional list of properties as an argument and
returns the string that would go in to the SDF. This would then
automatically show up in the wrappers (I think). Let me investigate that.

-greg
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] SDWriter from Java

2016-03-30 Thread Tim Dudgeon

And there's no other way to generate a SDF from Java?
e.g. can each ROMol be converted to text in SD format and then that text 
written to the Java OutputStream?


Tim

On 30/03/2016 13:31, Greg Landrum wrote:

Hi Tim,

That constructor is expecting a C++ stream pointer. The takeOwnership 
flag tells it to take assume ownership of the pointer (i.e. to free up 
the memory being used by the stream when the SDWriter itself is 
free'd). I am guessing that this will not be useable from Java (and 
should probably be disabled).


There is likely a way to set up the wrappers so that Java streams are 
properly handled, but it's difficult to assess how much work that 
would be.


-greg


On Wed, Mar 30, 2016 at 2:00 PM, Tim Dudgeon > wrote:


Hi All,

this probably a pretty basic question, but I'm struggling to work out
how to use the SDWriter from Java.
The class that SWIG has generated for SDWriter has a constructor
of type:
SDWriter(SWIGTYPE_p_std__ostream outstream)
which looks like its the one I need (I need to write to a Java
OutputStream, not a file).
But I can't would out how to generate an instance of
SWIGTYPE_p_std__ostream from my Java OutputStream.
Any pointers?

(Also, what does the boolean takeownership param of the similar
constructor do?)


Tim




--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/rdkit-discuss




--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


Re: [Rdkit-discuss] SDWriter from Java

2016-03-30 Thread Greg Landrum
Hi Tim,

That constructor is expecting a C++ stream pointer. The takeOwnership flag
tells it to take assume ownership of the pointer (i.e. to free up the
memory being used by the stream when the SDWriter itself is free'd). I am
guessing that this will not be useable from Java (and should probably be
disabled).

There is likely a way to set up the wrappers so that Java streams are
properly handled, but it's difficult to assess how much work that would be.

-greg


On Wed, Mar 30, 2016 at 2:00 PM, Tim Dudgeon  wrote:

> Hi All,
>
> this probably a pretty basic question, but I'm struggling to work out
> how to use the SDWriter from Java.
> The class that SWIG has generated for SDWriter has a constructor of type:
> SDWriter(SWIGTYPE_p_std__ostream outstream)
> which looks like its the one I need (I need to write to a Java
> OutputStream, not a file).
> But I can't would out how to generate an instance of
> SWIGTYPE_p_std__ostream from my Java OutputStream.
> Any pointers?
>
> (Also, what does the boolean takeownership param of the similar
> constructor do?)
>
>
> Tim
>
>
>
>
> --
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785471=/4140
> ___
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471=/4140___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss


[Rdkit-discuss] SDWriter from Java

2016-03-30 Thread Tim Dudgeon
Hi All,

this probably a pretty basic question, but I'm struggling to work out 
how to use the SDWriter from Java.
The class that SWIG has generated for SDWriter has a constructor of type:
SDWriter(SWIGTYPE_p_std__ostream outstream)
which looks like its the one I need (I need to write to a Java 
OutputStream, not a file).
But I can't would out how to generate an instance of 
SWIGTYPE_p_std__ostream from my Java OutputStream.
Any pointers?

(Also, what does the boolean takeownership param of the similar 
constructor do?)


Tim



--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785471=/4140
___
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss