Molecule file conversion with MolConverter

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



molconvert [options] outformat[:export-options] [files...]

The outformat argument must be one of the following strings:

mrv, (document formats)
mol, rgf, sdf, rdf, csmol, csrgf, cssdf, csrdf,
cml, smiles, sybyl, pdb, xyz
(molecule file formats)
jpeg, png, pov, ppm, svg, (graphics formats)
gzip, base64 (compression and encoding)
-o file Write output to specified file instead of standard output
-s string Read a molecule from specified SMILES string
-F Remove small fragments, keep the largest
-Y Remove explicit H atoms
-T f1:f2... Print a table containing fields from SDF separated by tab in the 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:
O0 no optimization
O1 optimize if needed
O2 optimize
e double bonds with unspecified cis/trans will be "either"
-3[:options] Calculate 3D coordinates
Options for coordinate calculation:
O0 lightweight optimization
OD Dreiding optimization
Import options can be specified between braces, in one of the following forms:
filename{MULTISET,options} to merge molecules into one that contains multiple atom sets
filename{format:}to skip automatic format recognition


  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"
  6. Converting a SMILES file to MDL Molfile:
    molconvert mol caffeine.smiles -o caffeine.mol
  7. Making an SDF from molfiles:
    molconvert sdf *.mol -o molecules.sdf
  8. 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
  9. Import a file as XYZ, do not try to recognize the file format:
    molconvert smiles "{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.

  10. Import a file as XYZ, with bond-length cut-off = 1.4, and max. number of Carbon connections = 4, export to SMILES:
    molconvert smiles "{f1.4C4}"
  11. Import a file as Gzipped XYZ, with the same import options as in the previous example:
    molconvert smiles "{gzip:xyz:f1.4C4}"
  12. Like the previous example but merge the molecules into one molecule that contains multiple atom sets. MDL molfile is exported.
    molconvert mol "{gzip:xyz:MULTISET,f1.4C4}"
  13. 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