[Open Babel] Fwd: Open Babel 2.0 User Documentation

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

[Open Babel] Fwd: Open Babel 2.0 User Documentation

Geoffrey Hutchison
Chris Swain has been kind enough to contribute some "user  
documentation" for 2.0. This is in addition to the standard UNIX-
style "man" pages.

Any comments or suggestions? Thanks very much to Chris for the guide  
and some helpful examples.

I have one -- Chris mentions the new gzip support. But Chris, the new  
code automatically supports import of gzip'ed files:

% babel 1ABC.pdb.gz -omol2 1abc.mol2

Are you having trouble with the gzip support? If so, that's a bug.

Thanks,
-Geoff

Begin forwarded message:

> Hi,
>
> Here is what I have written so far, as text in the email and as an  
> attached word doc
>
> Chris
>
>
>
> Openbabel User Documentation
>
> The aim of this document is to provide real world examples of the  
> syntax needed to use OpenBabel, it is not a developers guide.
>
> To get help using OpenBabel at the command using the Terminal at  
> the prompt type babel –H
>
> PROMPT>babel –H
>
> This will output the general syntax followed by a list of  
> conversion options and the file formats currently supported.
>
> Open Babel converts chemical structures from one file format to  
> another
>
> Usage: babel <input spec> <output spec> [Options]
>
> Each spec can be a file whose extension decides the format.
> Optionally the format can be specified by preceding the file by
> -i<format-type> e.g. -icml, for input and -o<format-type> for output
>
> See below for available format-types, which are the same as the
> file extensions and are case independent.
> If no input or output file is given stdin or stdout are used instead.
>
> More than one input file can be specified and their names can contain
> wildcard chars (* and ?).The molecules are aggregated in the output  
> file.
>
> Conversion options
>   -f <#> Start import at molecule # specified
>   -l <#> End import at molecule # specified
>   -t All input files describe a single molecule
>   -e Continue with next object after error, if possible
>   -z Compress the output with gzip
>   -H Outputs this help text
>   -Hxxx (xxx is file format ID e.g. -Hcml) gives format info
>   -Hall Outputs details of all formats
>   -V Outputs version number
>   -F Outputs the available fingerprint types
>   -m Produces multiple output files, to allow:
>      Splitting: e.g.        babel infile.mol new.smi -m
>        puts each molecule into new1.smi new2.smi etc
>      Batch conversion: e.g. babel *.mol -osmi -m
>        converts each input file to a .smi file
> For conversions of molecules
>    Additional options :
>    -d Delete Hydrogens
>    -h Add Hydrogens
>    -p Add Hydrogens appropriate for pH
>    -b Convert dative bonds e.g.[N+]([O-])=O to N(=O)=O
>    -c Center Coordinates
>    -j Join all input molecules into a single output molecule
>    -s"smarts" Convert only molecules matching SMARTS:
>    -v"smarts" Convert only molecules NOT matching SMARTS:
>
> Interface to OBAPI internals
>  API options, e.g. ---errorlevel 2
>   errorlevel # to control logging and reporting
>
> The following file formats are recognized:
>   alc -- Alchemy format
>   bgf -- MSI BGF format
>   box -- Dock 3.5 Box format
>   bs -- Ball and Stick format
>   c3d1 -- Chem3D Cartesian 1 format
>   c3d2 -- Chem3D Cartesian 2 format
>   caccrt -- Cacao Cartesian format
>   cache -- CAChe MolStruct format [Write-only]
>   cacint -- Cacao Internal format [Write-only]
>   car -- Accelrys/MSI Biosym/Insight II CAR format [Read-only]
>   ccc -- CCC format [Read-only]
>   cht -- Chemtool format [Write-only]
>   cml --  Chemical Markup Language
>   cmlr --  CML Reaction format
>   com -- Gaussian 98/03 Cartesian Input [Write-only]
>   copy -- Copies raw text [Write-only]
>   crk2d -- Chemical Resource Kit diagram format (2D)
>   crk3d -- Chemical Resource Kit 3D format
>   csr -- Accelrys/MSI Quanta CSR format [Write-only]
>   cssr -- CSD CSSR format [Write-only]
>   ct -- ChemDraw Connection Table format
>   dmol -- DMol3 coordinates format
>   ent -- Protein Data Bank format
>   feat -- Feature format
>   fh -- Fenske-Hall Z-Matrix format [Write-only]
>   fix -- SMILES FIX format [Write-only]
>   fpt -- Fingerprint format [Write-only]
>   fract -- Free Form Fractional format
>   fs -- FastSearching
>   g03 -- Gaussian98/03 Output [Read-only]
>   g98 -- Gaussian98/03 Output [Read-only]
>   gam -- GAMESS Output [Read-only]
>   gamin -- GAMESS Input [Write-only]
>   gamout -- GAMESS Output [Read-only]
>   gau -- Gaussian 98/03 Cartesian Input [Write-only]
>   gpr -- Ghemical format
>   gr96 -- GROMOS96 format [Write-only]
>   hin -- HyperChem HIN format
>   inp -- GAMESS Input [Write-only]
>   ins -- ShelX format [Read-only]
>   jin -- Jaguar input format [Write-only]
>   jout -- Jaguar output format [Read-only]
>   mdl -- MDL MOL format
>   mmd -- MacroModel format
>   mmod -- MacroModel format
>   mol -- MDL MOL format
>   mol2 -- Sybyl Mol2 format
>   mopcrt -- MOPAC Cartesian format
>   mopout -- MOPAC Output format [Read-only]
>   mpd -- Sybyl descriptor format [Write-only]
>   mpqc -- MPQC output format [Read-only]
>   mpqcin -- MPQC simplified input format [Write-only]
>   nw -- NWChem input format [Write-only]
>   nwo -- NWChem output format [Read-only]
>   pc --  PubChem format  [Read-only]
>   pdb -- Protein Data Bank format
>   pov -- POV-Ray input format [Write-only]
>   pqs -- Parallel Quantum Solutions format
>   prep -- Amber Prep format [Read-only]
>   qcin -- Q-Chem input format [Write-only]
>   qcout -- Q-Chem output format [Read-only]
>   report -- Open Babel report format [Write-only]
>   res -- ShelX format [Read-only]
>   rxn -- MDL RXN format
>   sd -- MDL MOL format
>   sdf -- MDL MOL format
>   smi -- SMILES format
>   tmol -- TurboMole Coordinate format
>   txyz -- Tinker MM2 format [Write-only]
>   unixyz -- UniChem XYZ format
>   vmol -- ViewMol format
>   xed -- XED format [Write-only]
>   xml --  General XML format [Read-only]
>   xyz -- XYZ cartesian coordinates format
>   yob -- YASARA.org YOB format
>   zin -- ZINDO input format [Write-only]
>
> File Conversion
>
> To convert mymols.sdf to SMILES format.
>
> PROMPT>babel -isdf  'mymols.sdf' -osmi 'outputfile.smi'
>
> You may need to include the full path to the files e.g. '/Users/
> username/Desktop/mymols.sdf'. If no input or output specification  
> is defined OpenBabel will try to assign the filetype
> based on the file suffix. Openbabel cannot generate coordinates so  
> whilst the conversion from SMILES to sdf will generate a file the  
> resulting sdf will not contain coordinates.
> Similarly OpenBabel cannot generate a 3D structure from a 2D  
> structure file.
> If you want to remove all hydrogens when doing the conversion the  
> command would be:-
>
> PROMPT>babel -isdf  'mymols.sdf' -osmi 'outputfile.smi' –d
>
> If you want to add all hydrogens when doing the conversion the  
> command would be:-
>
> PROMPT>babel -isdf  'mymols.sdf' -osmi 'outputfile.smi' –h
>
> If you want to add hydrogens appropriate for pH7.4 when doing the  
> conversion the command would be:-
>
> PROMPT>babel -isdf  'mymols.sdf' -osmi 'outputfile.smi' –p
>
> The protonation appears to be done an atom-by-atom basis so  
> molecules with multiple ionizable centers will have all centers  
> ionized.
>
> Of course you don’t actually need to change the file type to modify  
> the hydrogens if you want to add all hydrogens the command would be:-
>
> PROMPT>babel -isdf  'mymols.sdf' -osmi 'mymols_H.sdf' ' –h
>
> Some functional groups e.g. nitro or sulphone can be represented  
> either as [N+]([O-])=O or N(=O)=O, to convert all to the dative  
> bond form.
>
> PROMPT>babel -isdf  'mymols.sdf'  -osmi 'outputfile.smi' –b
>
> If you only want to convert a subset of molecules you can define  
> them using –f and –l, so to convert molecules 2-4 of the file  
> mymols.sdf type
>
> PROMPT>/babel   'mymols.sdf' -f 2 -l 4 -osdf 'outputfile.sdf'
>
> Alternatively you can select a subset matching a SMARTS pattern, so  
> to select all molecules containing bromobenzene use.
>
> PROMPT>babel   mymols.sdf  -osdf  ‘selected.sdf’    -s ‘c1ccccc1Br’
>
> You can select a subset that do not match a SMARTS pattern, so to  
> select all molecules not containing bromobenzene use.
>
> PROMPT>babel   mymols.sdf  -osdf  ‘selected.sdf’    -v ‘c1ccccc1Br’
>
>
> You can of course combine options, so to join molecules and add  
> hydrogens type
>
> PROMPT>babel   mymols.sdf’ –osdf ‘ myjoined.sdf’ –h   -j
>
> The output file can be compressed with gzip, but at the moment  
> OpenBabel cannot import gzipped files.
>
> PROMPT> /babel   ‘ /mymols.sdf’ –osdf ‘outputfile.sdf.zip’     -z
>
> OpenBabel Tools
>
> There are a number of included tools that have been built using  
> OpenBabel, obprop calculates a couple of simple molecular  
> properties (MWt and ring count).
>
> PROMPT>obprop ' mymols.sdf'  > 'outputfile.txt'
>
> PROMPT> cat  outputfile.txt
>
> name MOL_00000067
> mol_weight 191.989
> num_rings 1
> $$$$
> name MOL_00000083
> mol_weight 191.989
> num_rings 1
> $$$$
> name MOL_00000105
> mol_weight 191.989
> num_rings 1
> $$$$
> name MOL_00000296
> mol_weight 207.077
> num_rings 1
> $$$$



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: [Open Babel] Fwd: Open Babel 2.0 User Documentation

Michael Banck
On Mon, Nov 07, 2005 at 03:00:45PM -0500, Geoffrey Hutchison wrote:
> Chris Swain has been kind enough to contribute some "user  
> documentation" for 2.0.

Great!

> Any comments or suggestions? Thanks very much to Chris for the guide  
> and some helpful examples.

We could put some basic examples into the manpage as well, perhaps.
 
> I have one --

I have one: Can we clarify that this document is under the same
licensing terms as OpenBabel itself, provided we put it into the
tarball (Do we?).  If not, which license is it under?  Maybe I have
missed it, but I did not see this from a cursory glance.


Michael


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: [Open Babel] Fwd: Open Babel 2.0 User Documentation

Geoffrey Hutchison

On Nov 7, 2005, at 4:43 PM, Michael Banck wrote:

> We could put some basic examples into the manpage as well, perhaps.

There are. :-) More examples are always welcome.

I recently reformatted the man pages significantly -- unfortunately  
the versions generated by Doxygen were pretty bad. I'll put up HTML  
versions of the new man pages soon.

> I have one: Can we clarify that this document is under the same
> licensing terms as OpenBabel itself, provided we put it into the
> tarball (Do we?).

That would be the idea. Chris just sent the file this morning, so it  
hasn't been added to the doc/ directory yet.

Which reminds me... Do you think we need to mark the website under  
open copyright?

Cheers,
-Geoff


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss