Molecule file conversion with MolConverter

Version 4.1.12

MolConverter is a command line program in Marvin Beans and JChem that converts between various file types.

Installation:

Usage:

molconvert [options] outformat[:basic-export-opts.html] [files...]

The outformat argument must be one of the following strings:

mrv, (document formats)
mol, rgf, sdf, rdf, csmol, csrgf, cssdf, csrdf,
cml, smiles, cxsmiles, abbrevgroup, peptide, sybyl, mol2, pdb, xyz, inchi, name
(molecule file formats)
jpeg, msbmp, png, pov, ppm, svg, emf (graphics formats)
gzip, base64 (compression and encoding)
Options:
-o file Write output to specified file instead of standard output
-e charset Set the input character encoding. The encoding must be supported by Java.
-e [in]..[out] Set the input (in) and/or output (out) character encodings. Examples: UTF-8, ASCII, Cp1250 (Windows Eastern European), Cp1252 (Windows Latin 1), ms932 (Windows Japanese).
-s string Read a molecule from specified SMILES string
-g Continue with next molecule on error (default: exit on error)
-Y Remove explicit H atoms
-F Remove small fragments, keep the largest
-T f1:f2... Print a table containing fields from SDF separated by tab in case of SMILES export.
Colon characters in field names can be escaped by backslash.
-T "*" Print a table containing all fields from SDF separated by tab in case of SMILES export.
-c "f1OPvalue&f2OPvalue..." Filtering by the values of fields in the case of SDF import.
OP may be: =,<,>,<=,>=
-v Verbose
-vv Very verbose (print stack trace at error)
-n Skip valence checking
-2[:options] Calculate 2D coordinates (default if the input is SMILES)
Options for coordinate calculation.
-3[:options] Calculate 3D coordinates
Options for coordinate calculation.
-H3D Detailed list on Clean3D options
Import options can be specified between braces, in one of the following forms:
filename{options}
filename{MULTISET,options} to merge molecules into one that contains multiple atom sets
filename{format:} to skip automatic format recognition
filename{format:options}
filename{format:MULTISET,options}

You can pass also options to Java VM when you run the application from command line.

Examples:

  1. Printing the SMILES string of a molecule in a molfile:
    molconvert smiles caffeine.mol
  2. Dearomatizing an aromatic molecule:
  3. molconvert smiles:-a -s "c1ccccc1"
  4. Aromatizing a molecule:
  5. molconvert smiles:a -s "C1=CC=CC=C1"
    (The default general aromatization is used.)
  6. Aromatizing a molecule using the basic algorithm:
  7. molconvert smiles:a_bas -s "CN1C=NC2=C1C(=O)N(C)C(=O)N2C"
  8. Converting a SMILES file to MDL Molfile:
    molconvert mol caffeine.smiles -o caffeine.mol
  9. Making an SDF from molfiles:
    molconvert sdf *.mol -o molecules.sdf
  10. SMILES to Molfile with optimized 2D coordinate calculation, converting double bonds with unspecified cis/trans to "either"
    molconvert -2:O2e mol caffeine.smiles -o caffeine.mol
  11. Import a file as XYZ, do not try to recognize the file format:
    molconvert smiles "foo.xyz{xyz:}"
    Note: This is just an example. XYZ and other formats known by Marvin are always recognized (send us a bug report otherwise), so the specification of the input format is usually not needed. It is only relevant if a user-defined import module is used.

  12. Import a file as XYZ, with bond-length cut-off = 1.4, and max. number of Carbon connections = 4, export to SMILES:
    molconvert smiles "foo.xyz{f1.4C4}"
  13. Import a file as Gzipped XYZ, with the same import options as in the previous example:
    molconvert smiles "foo.xyz.gz{gzip:xyz:f1.4C4}"
  14. Like the previous example but merge the molecules into one molecule that contains multiple atom sets. MDL molfile is exported.
    molconvert mol "foo.xyz.gz{gzip:xyz:MULTISET,f1.4C4}"
  15. Import an SDF and export a table containing selected molecules with columns: SMILES, ID, and logP:
    molconvert smiles -c "ID<=1000&logP>=-2&logP<=4" -T ID:logP foo.sdf