Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



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


Panel
borderColororange

Syntax

Options

Examples


Anchor
syntax
syntax
Syntax


Code Block
molconvert [options] outformat[:exportoptions] [files...]


The outformat stands for one of the supported formats.

Expand
titleFormats and codenames











Alternatively, use

Code Block
molconvert [options] query-encoding [files...]

to query the automatically detected encodings of the specified molecule files.



From files having doc, docx, ppt, pptx, xls, xls, odt, pdf, xml, html or txt format, Molconvert is able to recognize the name of compounds and convert it to any of the above mentioned output formats.

Anchor
Options
Options
Options

Molconvert options can be specified in the format string. The format descriptor and the options are separated by a colon, the options by commas.

 molconvert jpeg:w100,Q95,#ffff00 nice.mol -o nice.jpg

(creates 100x100 JPEG image on yellow background, with 95% quality)

-o fileWrite output to specified file instead of standard output
-mProduce multiple output files
-e charsetSet 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 stringRead molecule from specified SMILES, SMARTS or peptide string (try to recognize its format)
-s string { format : options }Read molecule from the string in the specified format (can be omitted), using the specified importoptions (can be omitted)
-f stringSpecify the import format and options
--smiles stringRead molecule from specified SMILES string
--smarts stringRead molecule from specified SMARTS string
--peptide stringRead molecule from specified peptide string
-gContinue with next molecule on error (default: exit on error)
-YRemove explicit H atoms
-I <range>process input molecules with molecule index (1-based) falling into the specified range (e.g. 5-8,15 refers to molecules 5,6,7,8,15)
-Ufuse input molecules and output the union
-R <file>[:<range>]fuse fragments to input molecule(s) from file with specified mol index range range syntax: "-5,10-20,25,26,38-" (e.g. -R frags.mrv:20-)
-R<i> <file>[:<range>]fuse R<i> definition members to input molecule(s) from file in specified index range (e.g. -R1 rdef1.mrv:5-8,19)
-R<i>:<1|2> <file>[:<range>]fuse R<i> definition members to input molecule(s) from file in specified index range, filter molecules having 1 (2, resp.) attachment points (e.g. -R1:2 rdef1.mrv:-3,8-10)
-FRemove small fragments, keep the largest
-c"f1 OP value&f2 OP value..."Filtering by the values of fields in the case of SDF import.
OP may be: =,<,>,<=,>=
--mol-fields-to-recordsConvert molecule type fields to separate records.
-vVerbose
-vvVery verbose (print stack trace at error)
-2 [ : options] [ : F<i1><i2>...,<iN>]Calculate 2D coordinates Options for coordinate calculation. 
Performs partial clean with fixed atom coordinates for atoms <i1><i2>...,<iN> (1-based indexes) if the Fparameter is specified.
-3 [ : options]Calculate 3D coordinates
Options for coordinate calculation.
-H3D Help on options for 3D calculations. Detailed list on Clean 3d 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 also pass options to JAVA VM when you run the application from command line.

 

Options for file formats:

Expand
titleMRV


a, +a, +a_gen

General aromatization

mrv:a
a_bas
Basic aromatization
mrv:a_bas
a_loose 
Loose aromatization
mrv:a_loose
a_ambig
Ambiguous aromatization
mrv:a_ambig
-a, -a_gen
General Dearomatization
mrv:-a
-a_huckel
Huckel dearomatization
mrv:-a_huckel
-a_huckel_ex
Huckel dearomatization, throwing exception in case of failure
mrv:-a_huckel_ex
H, +H
Add explicit Hydrogen atoms
mrv:H
-H
Remove explicit Hydrogen atoms
mrv:-H
+numbering  
assigns atom numberings corresponding to the IUPAC name
mrv:+numbering



Expand
titleCDX, CDXML


a, +a, +a_gen

General aromatization

cdx:a
a_bas
Basic aromatization
cdx:a_bas
a_loose 
Loose aromatization
cdx:a_loose
a_ambig
Ambiguous aromatization
cdx:a_ambig
-a, -a_gen
General Dearomatization
cdx:-a
-a_huckel
Huckel dearomatization
cdx:-a_huckel
-a_huckel_ex
Huckel dearomatization, throwing exception in case of failure
cdx:-a_huckel_ex
H, +H
Add explicit Hydrogen atoms
cdx:H
-H
Remove explicit Hydrogen atoms
cdx:-H
+numbering  
assigns atom numberings corresponding to the IUPAC name
cdx:+numbering



Expand
titleSKC


a, +a, +a_gen

General aromatization

skc:a
a_bas
Basic aromatization
skc:a_bas
a_loose 
Loose aromatization
skc:a_loose
a_ambig
Ambiguous aromatization
skc:a_ambig
-a, -a_gen
General Dearomatization
skc:-a
-a_huckel
Huckel dearomatization
skc:-a_huckel
-a_huckel_ex
Huckel dearomatization, throwing exception in case of failure
skc:-a_huckel_ex
H, +H
Add explicit Hydrogen atoms
skc:H
-H
Remove explicit Hydrogen atoms
skc:-H
+numbering  
assigns atom numberings corresponding to the IUPAC name
skc:+numbering



Expand
titleCML
Excerpt Include
CML Export Options
CML Export Options
nopaneltrue


Expand
titleMDL MOL
Include Page
MDL MOL Import and Export Options
MDL MOL Import and Export Options


Expand
titleSMILES, SMARTS
Include Page
SMILES and SMARTS import and export options
SMILES and SMARTS import and export options


Expand
titlepeptide

Include Page
Peptide import and export options
Peptide import and export options


Expand
titlePBD

Include Page
PDB import and export options
PDB import and export options


Expand
titleInChI
Excerpt Include
InChi and InChiKey export options
InChi and InChiKey export options
nopaneltrue


Expand
titleInChIkey
Excerpt Include
InChi and InChiKey export options
InChi and InChiKey export options
nopaneltrue


Expand
titlename

Excerpt Include
Name import and export options
Name import and export options
nopaneltrue

Import options

Excerpt Include
Name to Structure Format options
Name to Structure Format options
nopaneltrue


Expand
titleCSV

Include Page
CSV
CSV


Expand
titleGraphic formats

Excerpt Include
Image Export in Marvin
Image Export in Marvin
nopaneltrue


Anchor
Example
Example
Examples


Expand
titleExample
  1. Printing the SMILES string of a molecule in a molfile

    Code Block
    molconvert smiles caffeine.mol


  2. Dearomatizing an aromatic molecule:

    Code Block
    molconvert smiles:-a -s "c1ccccc1"


  3. Aromatizing a molecule:

    Code Block
    molconvert smiles:a -s "C1=CC=CC=C1"

    (The default general aromatization is used.)

  4. Aromatizing a molecule using the basic algorithm:

    Code Block
    molconvert smiles:a_bas -s "CN1C=NC2=C1C(=O)N(C)C(=O)N2C"


  5. Converting a SMILES file to MDL Molfile

    Code Block
    molconvert mol caffeine.smiles -o caffeine.mol


  6. Making an SDF from molfiles:

    Code Block
    molconvert sdf *.mol -o molecules.sdf


  7. Printing the encodings of SDfiles in the working directory:

    Code Block
    molconvert query-encoding *.sdf


  8. SMILES to Molfile with optimized 2D coordinate calculation, converting double bonds with unspecified cis/trans to "either"

    Code Block
    molconvert -2:2e mol caffeine.smiles -o caffeine.mol


  9. 2D coordinate calculation with optimization and fixed atom coordinates for atoms 1, 5, 6:

    Code Block
    molconvert -2:2:F1,5,6 mol caffeine.mol


  10. Import a file as XYZ, do not try to recognize the file format:

    Code Block
    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.

  11. Import a file as XYZ, with bond-length cut-off = 1.4, and max. number of Carbon connections = 4, export to SMILES:

    Code Block
    molconvert smiles "foo.xyz{f1.4C4}"


  12. Import a file as Gzipped XYZ, with the same import options as in the previous example:

    Code Block
    molconvert smiles "foo.xyz.gz{gzip:xyz:f1.4C4}"


  13. Like the previous example but merge the molecules into one molecule that contains multiple atom sets. MDL molfile is exported.

    Code Block
    molconvert mol "foo.xyz.gz{gzip:xyz:MULTISET,f1.4C4}"


  14. Import an SDF and export a table containing selected molecules with columns: SMILES, ID, and logP:

    Code Block
    molconvert smiles -c "ID<=1000&logP>=-2&logP<=4" -T ID:logP foo.sdf


  15. Fuse R2 definition from file, filter fragments with 1 attachment point:

    Code Block
    molconvert mrv in.mrv -R2:1 rdef.mrv


  16. Fuse fragments from file (note, that the input molecule, which the fragments are fused to, should also be specified):

    Code Block
    molconvert mrv in.mrv -R frags.mrv


  17. Generate all common names for a structure:

    Code Block
    molconvert "name:common,all" -s tylenol


  18. Generate the most popular common name for a structure (It fails if none is known.):

    Code Block
    molconvert name:common -s viagra


  19. Generate SMILES from those molecules that names are mentioned in a file foo.html:

    Code Block
    molconvert smiles foo.html