Adding new formats

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

Adding new formats

Stuart Armstrong
Dear babel,

I'm currently working on adding pdbqt to babel, a format used by autodock4, and very close to pdb.

I have the linux source code, and I'm doing this by creating a pdbqtformat.cpp file in the src/formats/ directory.

However I have been unable to link the file in so far, and was wondering all the steps needed to do. Greping for 'pdbformat' finds it in many different locations, and I feel I shouldn't just blindly add the 'pdbqtformat' version at each of these. How would you go about linking the new format in?

All the best,
Stuart

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Adding new formats

Noel O'Boyle
Administrator
Assuming that you are working off our subversion trunk (which you
should do), take a look at src/formats/CMakeLists.txt and add your
format in the appropriate place.

We should really write a tutorial on adding new formats - we only have
146 at the moment after all!

Hope this helps...

- Noel

On 29 July 2010 10:20, Stuart Armstrong <[hidden email]> wrote:

> Dear babel,
> I'm currently working on adding pdbqt to babel, a format used by autodock4,
> and very close to pdb.
> I have the linux source code, and I'm doing this by creating a
> pdbqtformat.cpp file in the src/formats/ directory.
> However I have been unable to link the file in so far, and was wondering all
> the steps needed to do. Greping for 'pdbformat' finds it in many different
> locations, and I feel I shouldn't just blindly add the 'pdbqtformat' version
> at each of these. How would you go about linking the new format in?
> All the best,
> Stuart
> ------------------------------------------------------------------------------
> The Palm PDK Hot Apps Program offers developers who use the
> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
> of $1 Million in cash or HP Products. Visit us here for more details:
> http://p.sf.net/sfu/dev2dev-palm
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Adding new formats

Dr Garrett M. Morris
On 2 Aug 2010, at 08:43 PM, "Noel O'Boyle" <[hidden email]> wrote:

> Assuming that you are working off our subversion trunk (which you
> should do), take a look at src/formats/CMakeLists.txt and add your
> format in the appropriate place.
>
> We should really write a tutorial on adding new formats - we only have
> 146 at the moment after all!

Yes--but once you document something, it becomes obsolete!  :-)

G.

>
> Hope this helps...
>
> - Noel
>
> On 29 July 2010 10:20, Stuart Armstrong <[hidden email]> wrote:
>> Dear babel,
>> I'm currently working on adding pdbqt to babel, a format used by autodock4,
>> and very close to pdb.
>> I have the linux source code, and I'm doing this by creating a
>> pdbqtformat.cpp file in the src/formats/ directory.
>> However I have been unable to link the file in so far, and was wondering all
>> the steps needed to do. Greping for 'pdbformat' finds it in many different
>> locations, and I feel I shouldn't just blindly add the 'pdbqtformat' version
>> at each of these. How would you go about linking the new format in?
>> All the best,
>> Stuart
>> ------------------------------------------------------------------------------
>> The Palm PDK Hot Apps Program offers developers who use the
>> Plug-In Development Kit to bring their C/C++ apps to Palm for a share
>> of $1 Million in cash or HP Products. Visit us here for more details:
>> http://p.sf.net/sfu/dev2dev-palm
>> _______________________________________________
>> OpenBabel-discuss mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>>
>>

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Adding new formats

Noel O'Boyle
Administrator
In reply to this post by Noel O'Boyle
You didn't say whether you are using the subversion trunk or not - it
sounds like you aren't. See http://openbabel.org/wiki/CMake for
information on checking and compiling the development code. There will
be a release in a few weeks so now is a good time to get it in.

- Noel

On 4 August 2010 15:14, Stuart Armstrong <[hidden email]> wrote:

> Alas, that wasn't enough; even with a distclean re-making, the pdbqt format
> doesn't show up. I noticed that pdbformat appears in Makefile.in,
> Makefile.am and Makefile in the src/formats/ directory; should I be
> attempting to duplicate these entries with pdbqtformat?
> All the best,
> Stuart
>
> On 2 August 2010 20:43, Noel O'Boyle <[hidden email]> wrote:
>>
>> Assuming that you are working off our subversion trunk (which you
>> should do), take a look at src/formats/CMakeLists.txt and add your
>> format in the appropriate place.
>>
>> We should really write a tutorial on adding new formats - we only have
>> 146 at the moment after all!
>>
>> Hope this helps...
>>
>> - Noel
>>
>> On 29 July 2010 10:20, Stuart Armstrong <[hidden email]>
>> wrote:
>> > Dear babel,
>> > I'm currently working on adding pdbqt to babel, a format used by
>> > autodock4,
>> > and very close to pdb.
>> > I have the linux source code, and I'm doing this by creating a
>> > pdbqtformat.cpp file in the src/formats/ directory.
>> > However I have been unable to link the file in so far, and was wondering
>> > all
>> > the steps needed to do. Greping for 'pdbformat' finds it in many
>> > different
>> > locations, and I feel I shouldn't just blindly add the 'pdbqtformat'
>> > version
>> > at each of these. How would you go about linking the new format in?
>> > All the best,
>> > Stuart
>> >
>> > ------------------------------------------------------------------------------
>> > The Palm PDK Hot Apps Program offers developers who use the
>> > Plug-In Development Kit to bring their C/C++ apps to Palm for a share
>> > of $1 Million in cash or HP Products. Visit us here for more details:
>> > http://p.sf.net/sfu/dev2dev-palm
>> > _______________________________________________
>> > OpenBabel-discuss mailing list
>> > [hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>> >
>> >
>
>

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Adding new formats

Geoffrey Hutchison
> You didn't say whether you are using the subversion trunk or not - it
> sounds like you aren't. See http://openbabel.org/wiki/CMake for
> information on checking and compiling the development code.

Or if you think the PDBQT format is close to ready, you can also send it to Noel or myself and we'll add it to the SVN trunk for testing.

There is a snapshot of 2.3.0b2 available:
https://sourceforge.net/projects/openbabel/files/openbabel-snapshots/2010-08-03/openbabel-2.3.0b2-20100803-r3942.tar.gz/download

Hope that helps,
-Geoff
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Adding new formats

Stuart Armstrong
Yay! It all works now; many many thanks.

The PDBQT format is not yet close to ready; it still needs to be programmed so that it can do the root-and-branch layout for molecules with many rotatable bonds, and needs to be tidied up to remove the remaining bits of the PDB format from it (I used that as a template). I'll try and send it in next week?

All the best,
Stuart

On 4 August 2010 15:51, Geoffrey Hutchison <[hidden email]> wrote:
> You didn't say whether you are using the subversion trunk or not - it
> sounds like you aren't. See http://openbabel.org/wiki/CMake for
> information on checking and compiling the development code.

Or if you think the PDBQT format is close to ready, you can also send it to Noel or myself and we'll add it to the SVN trunk for testing.

There is a snapshot of 2.3.0b2 available:
https://sourceforge.net/projects/openbabel/files/openbabel-snapshots/2010-08-03/openbabel-2.3.0b2-20100803-r3942.tar.gz/download

Hope that helps,
-Geoff


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Adding new formats

Stuart Armstrong
The pdbqt format (after a little bit of tidying up and testing) should be ready to submit by the end of the week.

One last thing is lacking, though, and that's the ability to pass a numerical value to the write options (the number of rotatable bonds); how is this done? If n is the option, then would it be:
-xn 99
-xn"99"
-n 99
-n"99"
(I haven't had any luck with any of these, nor have I managed to recuperate the numerical value using pConv->IsOption("n",OBConversion::OUTOPTIONS) ).

All the best,
Stuart


On 5 August 2010 11:21, Stuart Armstrong <[hidden email]> wrote:
Yay! It all works now; many many thanks.

The PDBQT format is not yet close to ready; it still needs to be programmed so that it can do the root-and-branch layout for molecules with many rotatable bonds, and needs to be tidied up to remove the remaining bits of the PDB format from it (I used that as a template). I'll try and send it in next week?

All the best,
Stuart


On 4 August 2010 15:51, Geoffrey Hutchison <[hidden email]> wrote:
> You didn't say whether you are using the subversion trunk or not - it
> sounds like you aren't. See http://openbabel.org/wiki/CMake for
> information on checking and compiling the development code.

Or if you think the PDBQT format is close to ready, you can also send it to Noel or myself and we'll add it to the SVN trunk for testing.

There is a snapshot of 2.3.0b2 available:
https://sourceforge.net/projects/openbabel/files/openbabel-snapshots/2010-08-03/openbabel-2.3.0b2-20100803-r3942.tar.gz/download

Hope that helps,
-Geoff



------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Adding new formats

Noel O'Boyle
Administrator
On 9 August 2010 18:16, Stuart Armstrong <[hidden email]> wrote:

> The pdbqt format (after a little bit of tidying up and testing) should be
> ready to submit by the end of the week.
> One last thing is lacking, though, and that's the ability to pass a
> numerical value to the write options (the number of rotatable bonds); how is
> this done? If n is the option, then would it be:
> -xn 99
> -xn"99"
> -n 99
> -n"99"
> (I haven't had any luck with any of these, nor have I managed to recuperate
> the numerical value using pConv->IsOption("n",OBConversion::OUTOPTIONS) ).

We are moving from 'babel' to 'obabel' over time. Babel doesn't
support write option parameters; obabel does. Number 1 or number 2
should work with obabel. (ccing to Chris in case I'm wrong!).

> All the best,
> Stuart
>
> On 5 August 2010 11:21, Stuart Armstrong <[hidden email]>
> wrote:
>>
>> Yay! It all works now; many many thanks.
>> The PDBQT format is not yet close to ready; it still needs to be
>> programmed so that it can do the root-and-branch layout for molecules with
>> many rotatable bonds, and needs to be tidied up to remove the remaining bits
>> of the PDB format from it (I used that as a template). I'll try and send it
>> in next week?
>> All the best,
>> Stuart
>>
>> On 4 August 2010 15:51, Geoffrey Hutchison <[hidden email]>
>> wrote:
>>>
>>> > You didn't say whether you are using the subversion trunk or not - it
>>> > sounds like you aren't. See http://openbabel.org/wiki/CMake for
>>> > information on checking and compiling the development code.
>>>
>>> Or if you think the PDBQT format is close to ready, you can also send it
>>> to Noel or myself and we'll add it to the SVN trunk for testing.
>>>
>>> There is a snapshot of 2.3.0b2 available:
>>>
>>> https://sourceforge.net/projects/openbabel/files/openbabel-snapshots/2010-08-03/openbabel-2.3.0b2-20100803-r3942.tar.gz/download
>>>
>>> Hope that helps,
>>> -Geoff
>
>

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Adding new formats

Chris Morley-3
Sorry, this is less a message and more a piece of the manual.

On 09/08/2010 18:40, Noel O'Boyle wrote:

> On 9 August 2010 18:16, Stuart Armstrong<[hidden email]>  wrote:
>> The pdbqt format (after a little bit of tidying up and testing) should be
>> ready to submit by the end of the week.
>> One last thing is lacking, though, and that's the ability to pass a
>> numerical value to the write options (the number of rotatable bonds); how is
>> this done? If n is the option, then would it be:
>> -xn 99
>> -xn"99"
>> -n 99
>> -n"99"
>> (I haven't had any luck with any of these, nor have I managed to recuperate
>> the numerical value using pConv->IsOption("n",OBConversion::OUTOPTIONS) ).

On the command line -xn99 -xn 99 -xn"99" should all work.
In the code:

   const char* txt = pConv->IsOption("n",OBConversion::OUTOPTIONS) );
   int rotbonds;
   if(txt) //-xn present
     rotbonds = atoi(txt);
   else //no option present
     whatever

> We are moving from 'babel' to 'obabel' over time. Babel doesn't
> support write option parameters; obabel does. Number 1 or number 2
> should work with obabel. (ccing to Chris in case I'm wrong!).

Not quite; with babel, if you want freedom to safely place the  option
anywhere on the command line, rather than being forced to put it at
the end, you need to register the number of parameters it will take.
This has to be the same across all output formats, which is a bit of a
problem with single-letter options because there are now so many
formats (and options).

If you try to register "n" as an output option with one parameter by
putting

   OBConversion::RegisterOptionParam
       ("n", this, 1, OBConversion::OUTOPTIONS);

in your format's constructor and then start babel, say

   babel -V

you will get:

  *** Open Babel Error  in OpenBabel::OBConversion::RegisterOptionParam
  The number of parameters needed by option "n" in pdbqt format
  differs from an earlier registration.

It would be safer to use a multi-character option, e.g. --rotbonds:

   OBConversion::RegisterOptionParam
       ("rotbonds", this, 1, OBConversion::GENOPTIONS);
and

   OBConversion::RegisterOptionParam
       ("rotbonds", this, 1, OBConversion::GENOPTIONS);

Note that multi-character options for the command line are all GENOPTIONS.

obabel is a newer interface very similar to babel, but you have to
specify an outputfile with a -O option, e.g.

   obabel infile.mol --rotbonds 3 -O outfile.pdbqt

With it, options don't have to be registered, can come anywhere after
the input file name, and can have default values (which might be
different from the value if the option is not specified.

It is probably better at the moment for normal formats to be
compatible with babel, since that is what most people are using.

The format's Description() function should return information on
possible options. For the above case the returned text would include:

"Write Options, e.g. --rotbonds 3\n"
" rotbonds # specify the number of rotatable bonds\n"

This text is parsed to make checkboxes, etc., for the GUI, so sticking
to a standard form is a good idea.


Chris


>> On 5 August 2010 11:21, Stuart Armstrong<[hidden email]>
>> wrote:
>>>
>>> Yay! It all works now; many many thanks.
>>> The PDBQT format is not yet close to ready; it still needs to be
>>> programmed so that it can do the root-and-branch layout for molecules with
>>> many rotatable bonds, and needs to be tidied up to remove the remaining bits
>>> of the PDB format from it (I used that as a template). I'll try and send it
>>> in next week?
>>> All the best,
>>> Stuart
>>>
>>> On 4 August 2010 15:51, Geoffrey Hutchison<[hidden email]>
>>> wrote:
>>>>
>>>>> You didn't say whether you are using the subversion trunk or not - it
>>>>> sounds like you aren't. See http://openbabel.org/wiki/CMake for
>>>>> information on checking and compiling the development code.
>>>>
>>>> Or if you think the PDBQT format is close to ready, you can also send it
>>>> to Noel or myself and we'll add it to the SVN trunk for testing.
>>>>
>>>> There is a snapshot of 2.3.0b2 available:
>>>>
>>>> https://sourceforge.net/projects/openbabel/files/openbabel-snapshots/2010-08-03/openbabel-2.3.0b2-20100803-r3942.tar.gz/download
>>>>
>>>> Hope that helps,
>>>> -Geoff
>>
>>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> OpenBabel-discuss mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>
>
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.851 / Virus Database: 271.1.1/3060 - Release Date: 08/09/10 07:35:00
>


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Adding new formats

Stuart Armstrong
In reply to this post by Noel O'Boyle
Thanks! Unfortunately, I've been called away by a death and a funeral in the family, so haven't been able to finish work on the pdbqt format. I'll finalise it once I'm returned.
 
All the best,
Stuart

On 9 August 2010 13:40, Noel O'Boyle <[hidden email]> wrote:
On 9 August 2010 18:16, Stuart Armstrong <[hidden email]> wrote:
> The pdbqt format (after a little bit of tidying up and testing) should be
> ready to submit by the end of the week.
> One last thing is lacking, though, and that's the ability to pass a
> numerical value to the write options (the number of rotatable bonds); how is
> this done? If n is the option, then would it be:
> -xn 99
> -xn"99"
> -n 99
> -n"99"
> (I haven't had any luck with any of these, nor have I managed to recuperate
> the numerical value using pConv->IsOption("n",OBConversion::OUTOPTIONS) ).

We are moving from 'babel' to 'obabel' over time. Babel doesn't
support write option parameters; obabel does. Number 1 or number 2
should work with obabel. (ccing to Chris in case I'm wrong!).

> All the best,
> Stuart
>
> On 5 August 2010 11:21, Stuart Armstrong <[hidden email]>
> wrote:
>>
>> Yay! It all works now; many many thanks.
>> The PDBQT format is not yet close to ready; it still needs to be
>> programmed so that it can do the root-and-branch layout for molecules with
>> many rotatable bonds, and needs to be tidied up to remove the remaining bits
>> of the PDB format from it (I used that as a template). I'll try and send it
>> in next week?
>> All the best,
>> Stuart
>>
>> On 4 August 2010 15:51, Geoffrey Hutchison <[hidden email]>
>> wrote:
>>>
>>> > You didn't say whether you are using the subversion trunk or not - it
>>> > sounds like you aren't. See http://openbabel.org/wiki/CMake for
>>> > information on checking and compiling the development code.
>>>
>>> Or if you think the PDBQT format is close to ready, you can also send it
>>> to Noel or myself and we'll add it to the SVN trunk for testing.
>>>
>>> There is a snapshot of 2.3.0b2 available:
>>>
>>> https://sourceforge.net/projects/openbabel/files/openbabel-snapshots/2010-08-03/openbabel-2.3.0b2-20100803-r3942.tar.gz/download
>>>
>>> Hope that helps,
>>> -Geoff
>
>


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss