I had miss that in the source code, but if I get this right, writing extra
fields should
be even easier that I thought (although I suspect that a lot of internal
properties
shouldn't be written in the mol2 file).
In the meantime, I took a look at the Mol2 format standard [1] and I found that
I could
hijack many record types for my own purposes ("@<TRIPOS>NORMAL", "
@<TRIPOS>ROTATABLE_BOND" and "@<TRIPOS>RING_CLOSURE", to name a few).
Although, I'm not sure I've seen any of these mentioned in the OB source code.
If that's the case, this means that some work is needed in any case, in both
parsing and
writing.
For that, I'm wondering if it would be useful to support a generalized property
tag, i.e.:
@<{PROPERTY_NAME}>
(value) (value) (value) ...
another alternative could be:
@<TRIPOS>{PROPERTY_NAME}
(value) (value) (value) ...
but I see no clear advantage in that over the first one.
A real case example is the GOLD docking software, which adds properties to the
docking
output files in both SDF and Mol2 files.
The SDF standard supports arbitrary properties, while for Mol2 files they user
the first
example I wrote above.
Anyway, thanks for the help and the support in the discussion!
S
[1] http://www.tripos.com/data/support/mol2.pdf
On 12/07/2015 01:25 AM, Maciek Wójcikowski wrote:
> I noticed that "local" OBPairData are explicitly ignored, which may be the
> reason they are
> not written for you:
> https://github.com/openbabel/openbabel/pull/112/files#diff-d6e9941b72192e2ba1a2d244948450aeR535
>
> ----
> Pozdrawiam, | Best regards,
> Maciek Wójcikowski
> [email protected] <mailto:[email protected]>
>
> 2015-12-07 10:21 GMT+01:00 Maciek Wójcikowski <[email protected]
> <mailto:[email protected]>>:
>
> I forgot to mention - only the development version (git master branch)
> has that
> feature. You can check it by:
>
> obabel -Hmol2
>
>
> ----
> Pozdrawiam, | Best regards,
> Maciek Wójcikowski
> [email protected] <mailto:[email protected]>
>
> 2015-12-07 10:18 GMT+01:00 Maciek Wójcikowski <[email protected]
> <mailto:[email protected]>>:
>
> Hi,
> Writting comments works fine (-ac and -xc parameters in CLI). I use
> them on daily
> basis with UCSF Chimera, which was the reason for implementation. The
> only problem
> with them is skipping molecules - it also skips comments for the
> first molecule
> [https://github.com/openbabel/openbabel/issues/127].
>
> Eg. If you would like to convert SDF file to mol2 with
> scores/properties:
>
> obabel -isdf test_in.sdf -omol2 -O test_out.mol2 *-xc*
>
>
> To do the opposite:
> obabel -imol2 *-ac* test_in.mol2 -osdf -O test_out.sdf
>
> It also work correctly in pybel:
>
> mol = pybel.readfile('mol2', 'test.mol2', opt={'c':None})
>
> And writing accordingly
>
> mol.write('mol2', 'test.mol2', opt={'c':None})
>
>
> I hope that helps :)
>
> ----
> Pozdrawiam, | Best regards,
> Maciek Wójcikowski
> [email protected] <mailto:[email protected]>
>
> 2015-12-04 21:59 GMT+01:00 Geoffrey Hutchison
> <[email protected]
> <mailto:[email protected]>>:
>
> > Are there any development plans to fill this gap in the near
> future? (for variably large
> > value of 'near'…).
>
> Sure, I don't think it would be terribly difficult. Personally,
> I'd need to
> see a few of these "commented" Mol2 files to make sure they're
> being written
> correctly - it's an extension that's not in the mol2 format
> specification.
>
> -Geoff
>
>
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for
> multiple OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
> _______________________________________________
> OpenBabel-Devel mailing list
> [email protected]
> <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/openbabel-devel
>
>
>
>
> ------------------------------------------------------------------------------------------
> NOTE: This message was trained as non-spam. If this is wrong, please correct
> the training
> as soon as possible.
--
Stefano Forli, PhD
Assistant Professor of Integrative
Structural and Computational Biology,
Molecular Graphics Laboratory
Dept. of Integrative Structural
and Computational Biology, MB-112F
The Scripps Research Institute
10550 North Torrey Pines Road
La Jolla, CA 92037-1000, USA.
tel: +1 (858)784-2055
fax: +1 (858)784-2860
email: [email protected]
http://www.scripps.edu/~forli/
------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
OpenBabel-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel