2010/1/23 Andrew Dalke <[email protected]>:
> On Jan 23, 2010, at 11:36 AM, Noel O'Boyle wrote:
>> (Questions on the API are best sent to the devel list or the scripting list.)
>
> There's a scripting list? I had no idea.
>
> I was influenced by the python-dev list, which is only concerned
> with implementation questions, while using the API is left to
> the general list. While I didn't check the list purposes first,
> I read now:
>
>  About OpenBabel-discuss
>  A list for discussion on all aspects of Open Babel,
>  including use, development, bugs, future goals, etc.
>
>  About OpenBabel-Devel
>  This list is for discussion of development plans, etc. of Open Babel.

Ok - either the descriptions are wrong or I am. I'll get Geoff to clarify.

>> Getting Python/SWIG to handle streams is difficult. I haven't done it
>> (contributions welcome here). I could add a convenience function
>> ReadFromStdin().
>
> Another option is to have ob.cin, ob.cout and ob.cerr variables
> with the correct type signatures. SWIG will treat them as opaque
> pointers and allow them to be passed to functions which take
> those types.

Gotcha. I'll see if that's possible (do you know of any example of a
SWIG library that has this?).

>> However that would not solve the general problem,
>> just your specific one. Can you describe the use case?
>
> You are asking why someone wants to read SMILES from stdin?
>
> My specific case is I'm working on my fingerprint format code.
> I have a program which uses OB to read structures and generate
> OB fingerprints.
>
> I want it to handle being part of the standard Unix workflow.
> For example, suppose "dump_smiles" is a program which
> connects to a database and dumps the compounds in SMILES
> format, and I want to convert them to a set of fingerprints
> in my new format:
>
> dump_smiles mysql://chem:ad...@localhost/test | ob2fps --FP3

In that case, why not use the code behind pybel.readstring()? You can
read strings from stdin in Python, and pass them to OpenBabel.

>> Will look into the version question. I could try to set this in the
>> Python interface if all else fails.
>
> Daylight used to only support the version via a compile-time
> value. It was tricky for me to get the value through the SWIG
> interface in PyDaylight.
>
> I pointed out that because of shared libraries, a program
> might be compiled against one version but run using another
> version. They later made it a function to make those cases
> easier. I think the same is true here.

Ok, I see. So you are requesting a global function, GetVersion() or
so, that returns the version string.

> Cheers!
>
>                                Andrew
>                                [email protected]
>
>
>

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to