![]() |
SDFilesToHTML.pl - Generate HTML table file(s) from SDFile(s)
SDFilesToHTML.pl SDFiles(s)...
SDFilesToHTML.pl [-a, --align left | center | right,[top | middle | bottom]] [-b, --border borderwidth] [--cellpadding padding] [--cellspacing spacing] [--cmpddatafield ''fieldlabel,[label,position,alignment]''] [--datafields ''fieldlabel,[fieldlabel]...'' | Common | All] [--footer string] [-d, --displaylinks top | bottom | both] [--displaylinksinfo compound | table | both] [-h, --help] [--headeralign left | center | right,[top | middle | bottom]] [--headercolor ''#RRGGBB''] [--highlight ''fieldlabel,datatype,criterion,value,[fieldlabel,datatype,criterion,value,...]''] [--highlightcolor ''#RRGGBB,#RRGGBB''] [--highlightstyle text | background] [-m, --mode plain | shade | highlight | shadedhighlight | structuresonly | shadedstructuresonly] [-n, --numcmpds number] [-o, --overwrite] [-r, --root rootname] [-s, --structure display | link] [--strlinkmode plain | shaded] [--strlinknavigation yes | no] [--strlinkshadecolor ''#RRGGBB''] [--strlinktitle string] [--strlinktitledisplay yes | no] [--strlinktype href | button] [--strviewertype Chem3DActiveX | ChemDrawActiveX | ChemDrawPlugIn | Chime | JME | Jmol | MarvinView | ViewerActiveX] [--strviewerconfig codebase[,archive,code]] [--strviewerparams ''name=value [name=value ...]''] [--strviewerembed direct | javascript] [--strviewerjsfile javascriptfilename] [--strtablesize ''numrows,numcols''] [--stylesheet old | new | none] [--stylesheetname filename] [--shadecolor ''#RRGGBB,#RRGGBB''] [-t, --title string] [--titledisplay yes | no] [-w, --workingdir dirname] SDFiles(s)...
Generate HTML file(s) from SDFile(s). The HTML file(s) contain data tables and appropriate navigational links to view other tables; navigational links are also provided on compound HTML pages. These files can be generated for local viewing or deployment on a web server. A variety of options are provided to control style and appearance of tables. And for viewing structures, options are available to use any one of these viewers: Chem3DActiveX, ChemDrawActiveX, ChemDrawPlugIn, Chime, Jmol, JME, MarvinView, or ViewerActiveX. Jmol is the default structure viewer and it is also distributed along with this package; however, to use any other supported viewers, make sure it's available in your environment.
Multiple SDFile(s) names are separated by space. The valid file extensions are .sdf and .sd. All other file names are ignored. All the SD files in a current directory can be specified either by *.sdf or the current directory name.
Default values: left,middle
--cmpddatafield option value is also linked to compound summary page.
Default values: center,middle
Input text contains these quartets: fieldlabel,datatype,criterion,value,.... Possible datatype values: numeric or text. Possible criterion values: le, ge, or eq. Examples:
For --highlighstyle option values of text and background, these colors represent text or background colors respectively. For a specific column, first color string is used for values which meet criterion indicated by --highlight option; the second color is used for rest of the values.
Default values for background --highlightstyle: ''#0fff0f,#ff0f0f''. And default values for text --highlightstyle: ''#0fbb0f,#ff0f0f''. Hexadecimal strings for both --highlightstyle colors correspond to reddish and greenish.
Possible values: plain, shade, highlight, shadedhighlight, structuresonly, or shadedstructuresonly. Default: shade.
For SDFile(s) with more than maximum number of specified compounds per table, this directory tree is generated using <Name> where <Name> corresponds to <root> or <InitialSDFileName>: Top dir - <Name>-html; Sub dirs - html and mols. <Top dir> contains <Name>.html and <Name>.css files and <sub dir> html conatins various <Name>Lines<Start>To<End>.html files; <sub dir> mols is created as needed and contains MOL files.
This option is ignored for multiple input files.
Structure viewer background color is white. Use --strviewerparams option to change default behavior of structure viewers.
Default value: ''#e0e9eb'' - it's a very light blue color.
Assuming you have access to one of these viewers on your machine, you are all set to use this script. Otherwise, visit one of these web sites to download and install your favorite viewer:
The default viewer, JmolApplet V10, is distributed with MayaChemTools package. Earlier versions of JmolApplet are not supported: due to applet security issues related to reading files, this script uses in-line loading of MOL files and this option doesn't exist in earlier version of JmolApplet.
Input text format: codebase[,archive,code]. For an applet viewer, codebase must be specified; archive and code values are optional. Here are default archive and codebase values for various applets: Jmol - JmolApplet, JmolApplet.jar; JME - JME, JME.jar; MarvinView: MView, marvin.jar
For local deployment of HTML files, codebase must correspond to a complete path to the local directory containing appropriate archive file and the complete path is converted into appropriate relative path during generation of HTML files.
By default, codebase value of <this script dir>/../lib/Jmol is used for Jmol applet viewer, and HTML file(s) are generated for local deployment; however, you can specify any supported applet viewer and generate HTML file(s) for deploying on a web server.
For deploying the HTML file(s) on a web server, specify a valid codebase directory name relative to <WWWRootDir>. Example when JME archive file, JME.jar, is available in /jme directory on the web server:
For local deployment of HTML file(s), specify a complete codebase directory name. Example when JmolApplet archive file, JmolApplet.jar, is present in <JMOLROOT> directory:
In addition to codebase, you can also specify archive file name. Example for web deployment:
Example for local deployment:
The parameter names, along with their values, are just passed to each structure viewer in appropriate format without checking their validity. Check documentation of appropriate structure viewers to figure out valid parameter names.
Input text format: name=value name=value ... Example:
Default for all structure viewers: width=250 height=170 for displaying structures in tables, and strlinkwidth=500 strlinkheight=295 for compound HTML page during link value for -s --structure option.
Default background color for all structure viewers: same as --shadecolor value for displaying structures in tables and strlinkbgcolor=#ffffff for compound HTML page; however, explicit specification of background color in this option overrides default value. To use black background for structures in tables and compound HTML page, specify bgcolor=#000000 and strlinkbgcolor=#000000 respectively. Keep this in mind: Some structure viewers don't appear to support background color parameter.
Additional structure viewer specific default values:
Try overriding default values or specify additional valid parameter/value pairs to get desired results. Example for using CPK rendering scheme with Jmol viewer:
This option only applies to these vieweres: Chem3DActiveX, ChemDrawActiveX, ChemDrawPlugIn, Jmol, and MarvinView.
For marvin.js to work correctly on your browser, you may need to set marvin_jvm=builtin or marvin_jvm=plugin using --strviewerparams option. Additionally, MarvinView - at least in my hands - also has problems during usage of JavaScript for local deployment; however, it does work via web server.
As far as I can tell, Jmol.js supplied with Jmol10 release has these issues: jmolSetAppletColor doesn't support background color; jmolInitialize disables relative specification of codebase directroy which works okay. So, use Jmol.js supplied with MayaChemTools.
Directory location for these files is specified via codebase value of --strviewerconfig option.
Stylesheet file contains various properties which control appearance of HTML pages: type, size, and color of fonts; background color; and so on.
For old value, an existing stylesheet file specified by --stylesheetname option is used for each HTML file; no new stylesheet file is created. This option is quite handy for deploying HTML file(s) on a web server: assuming you specify a valid stylesheet file location relative to your WWWRoot, a reference to this stylesheet is added to each HTML file. For local deployment of HTML file(s), a complete path to a local stylesheet is fine as well.
For create value, a new stylesheet is created and reference to this local stylesheet is added to each HTML file. Use option --stylesheetname to specify name.
For none value, stylesheet usage is completely ignored.
For create value of -s --stylesheet option, a new stylesheet file is created using -r --root option. And value of --stylesheetname is simply ignored.
Default value: ''#ffffff,#e0e9eb'' - it's white and very light blue for odd and even number rows.
HTML table file(s), containing structures, can be used in two different ways: browsing on a local machine or deployment via a web server. By default, HTML file(s) are created for viewing on a local machine using Jmol viewer through a browser; however, you can specify any supported applet viewer and generate HTML file(s) for deploying on a web server.
First two sets of examples show generation of HTML file(s) using different applet viewers and a variety of options for local browsing; last set deals with web deployment.
Local deployment: Usage of default JMol viewer distributed with MayaChemTools:
To generate HTML tables with structure display using JMol viewer, rows background filled with white and light blue colors, navigation links on top and botton of each page, type:
To generate HTML tables with structure display using JMol viewer, rows background filled with white and light blue colors, navigation links on top and botton of each page, and only containing MolWeight and Mol_ID SD data fields, type:
To generate HTML tables with CPK structure display using JMol viewer, rows background filled with white and light blue colors, navigation links on top and botton of each page, type:
To generate HTML tables with structure display using JMol viewer and black background, rows background filled with light golden and greyish colors, navigation links on top and botton of each page, 10 rows in each table, greyish header row color, and cell spacing of 1, type:
To highlight molecular weight values using specified highlight criteria and fill in default background colors, type:
To highlight molecular weight values using specified highlight criteria, color the text using default colors, and add a footer message in every page, type:
To generate tables containing only structures, type:
To generate tables containing only structures with molecular weight displayed above the structure, type:
To generate tables containing links to structures and highlight molecular weight data field values using specified highlight criteria , type:
Local deployment: Usage of other structure viewers:
Web deployment: Usage of different structure viewers and options:
For deploying HTML file(s) on a web server, specify a valid codebase directory name relative to <WWWRootDir>. In addition to codebase, you can also specify archive file name.
FilterSDFiles.pl, InfoSDFiles.pl, SplitSDFiles.pl, MergeTextFilesWithSD.pl
Copyright (C) 2004-2012 Manish Sud. All rights reserved.
This file is part of MayaChemTools.
MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.