├── .nojekyll ├── docs ├── .nojekyll ├── MolHash.pdf ├── _static │ ├── up.png │ ├── down.png │ ├── file.png │ ├── plus.png │ ├── comment.png │ ├── minus.png │ ├── ajax-loader.gif │ ├── down-pressed.png │ ├── up-pressed.png │ ├── comment-bright.png │ ├── comment-close.png │ ├── nextmove_logo.png │ ├── fonts │ │ ├── Lato-Bold.ttf │ │ ├── Lato-Italic.ttf │ │ ├── Lato-Regular.ttf │ │ ├── Inconsolata-Bold.ttf │ │ ├── Lato-BoldItalic.ttf │ │ ├── RobotoSlab-Bold.ttf │ │ ├── RobotoSlab-Regular.ttf │ │ ├── Inconsolata-Regular.ttf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 │ ├── documentation_options.js │ ├── nm_style.css │ ├── css │ │ └── badge_only.css │ ├── js │ │ └── theme.js │ ├── pygments.css │ ├── doctools.js │ ├── underscore.js │ └── basic.css ├── _images │ ├── arthor-order.png │ ├── mesomer-hash-3.svg │ ├── mesomer-hash-4.svg │ ├── element-graph.svg │ ├── tautomer-hash-1.svg │ ├── tautomer-hash-2.svg │ ├── tautomer-hash-3.svg │ ├── murcko.svg │ ├── anonymous-graph.svg │ ├── extendedmurcko.svg │ ├── regioisomer.svg │ ├── mesomer-hash-2.svg │ └── mesomer-hash-1.svg ├── search.html ├── genindex.html ├── index.html ├── installation.html └── commandline.html ├── README.md ├── toolkit.h ├── cmake ├── ReportRDKitVersion.cpp └── modules │ └── FindRDKit.cmake ├── license.txt ├── normalize.cpp ├── molhash.h ├── CMakeLists.txt ├── mf.h ├── rdktoolkit.cpp ├── rdktoolkit.h └── molhash.cpp /.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/MolHash.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/MolHash.pdf -------------------------------------------------------------------------------- /docs/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/up.png -------------------------------------------------------------------------------- /docs/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/down.png -------------------------------------------------------------------------------- /docs/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/file.png -------------------------------------------------------------------------------- /docs/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/plus.png -------------------------------------------------------------------------------- /docs/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/comment.png -------------------------------------------------------------------------------- /docs/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/minus.png -------------------------------------------------------------------------------- /docs/_images/arthor-order.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_images/arthor-order.png -------------------------------------------------------------------------------- /docs/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/ajax-loader.gif -------------------------------------------------------------------------------- /docs/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/down-pressed.png -------------------------------------------------------------------------------- /docs/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/up-pressed.png -------------------------------------------------------------------------------- /docs/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/comment-bright.png -------------------------------------------------------------------------------- /docs/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/comment-close.png -------------------------------------------------------------------------------- /docs/_static/nextmove_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/nextmove_logo.png -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/Lato-Bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/Lato-Italic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/Lato-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/Inconsolata-Bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Lato-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/Lato-BoldItalic.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/RobotoSlab-Bold.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/RobotoSlab-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/RobotoSlab-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/Inconsolata-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/Inconsolata-Regular.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /docs/_static/fonts/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nextmovesoftware/molhash/HEAD/docs/_static/fonts/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /docs/_static/documentation_options.js: -------------------------------------------------------------------------------- 1 | var DOCUMENTATION_OPTIONS = { 2 | URL_ROOT: '', 3 | VERSION: '1.0', 4 | LANGUAGE: 'None', 5 | COLLAPSE_INDEX: false, 6 | FILE_SUFFIX: '.html', 7 | HAS_SOURCE: true, 8 | SOURCELINK_SUFFIX: '.txt' 9 | }; -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MolHash 2 | 3 | Command-line executable for the generation of "molecular hashes" for use in deduplication, sorting, or identifying related molecules. 4 | 5 | For more info, see https://nextmovesoftware.github.io/molhash/MolHash.pdf or https://nextmovesoftware.github.io/molhash/index.html 6 | -------------------------------------------------------------------------------- /toolkit.h: -------------------------------------------------------------------------------- 1 | /*==============================================*/ 2 | /* Copyright (C) 2013-2019 NextMove Software */ 3 | /* All rights reserved. */ 4 | /* */ 5 | /* This file is part of molhash. */ 6 | /* */ 7 | /* The contents are covered by the terms of the */ 8 | /* BSD license, which is included in the file */ 9 | /* license.txt. */ 10 | /*==============================================*/ 11 | #ifndef NMS_TOOLKIT_H 12 | #define NMS_TOOLKIT_H 13 | 14 | #include "rdktoolkit.h" 15 | 16 | #endif // NMS_TOOLKIT_H 17 | 18 | -------------------------------------------------------------------------------- /docs/_static/nm_style.css: -------------------------------------------------------------------------------- 1 | html * 2 | { 3 | font-family: 'Helvetica Neue', Arial; 4 | } 5 | 6 | pre, 7 | pre * 8 | { 9 | font-family: Consolas,"Andale Mono WT","Andale Mono","Lucida Console", 10 | "Lucida Sans Typewriter","DejaVu Sans Mono", 11 | "Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L", 12 | Monaco,"Courier New",Courier,monospace !important; 13 | } 14 | 15 | .wy-side-nav-search { 16 | background-color: #25B2AA; 17 | } 18 | 19 | .wy-nav-side { 20 | background-color: #c8893a; 21 | } 22 | 23 | .wy-menu-vertical a { 24 | color: #444444; 25 | } 26 | 27 | .wy-menu-vertical a:hover { 28 | background-color: #c89b60; 29 | } 30 | 31 | a { 32 | color: #25B2AA; 33 | } 34 | 35 | a.icon { 36 | font-size: 22pt; 37 | } 38 | 39 | td, 40 | .wy-table-responsive table td { 41 | word-wrap:break-word; 42 | white-space:normal; 43 | } 44 | 45 | .wy-nav-content { 46 | max-width: 1000px; 47 | } 48 | -------------------------------------------------------------------------------- /cmake/ReportRDKitVersion.cpp: -------------------------------------------------------------------------------- 1 | /*==============================================*/ 2 | /* Copyright (c) 2018-2019 NextMove Software */ 3 | /* */ 4 | /* This file is part of molhash. */ 5 | /* */ 6 | /* The contents are covered by the terms of the */ 7 | /* BSD license, which is included in the file */ 8 | /* license.txt. */ 9 | /*==============================================*/ 10 | #include 11 | 12 | #include 13 | 14 | int main() 15 | { 16 | unsigned int parts[3] = {0, 0, 0}; 17 | 18 | const char* version = RDKit::rdkitVersion; 19 | const char *p = version; 20 | unsigned int part = 0; 21 | while(*p) { 22 | if (*p >= '0' && *p <= '9') { 23 | parts[part] *= 10; 24 | parts[part] += *p - '0'; 25 | } else if ( *p == '.') { 26 | part++; 27 | if (part == 3) 28 | break; 29 | } else { 30 | break; // e.g. the 'd' in "2019.03.01dev" 31 | } 32 | p++; 33 | } 34 | 35 | printf("%d", parts[0]*10000 + parts[1]*100 + parts[2]); 36 | return 0; 37 | } 38 | 39 | -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | Unless otherwise noted, all files in this directory and all 2 | subdirectories are distributed under the following license: 3 | 4 | Copyright (c) 2013-2019 NextMove Software 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials provided 16 | with the distribution. 17 | * Neither the name of NextMove Software nor the names of its 18 | contributors may be used to endorse or promote products derived 19 | from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /normalize.cpp: -------------------------------------------------------------------------------- 1 | /*==============================================*/ 2 | /* Copyright (C) 2019 NextMove Software */ 3 | /* All rights reserved. */ 4 | /* */ 5 | /* This file is part of molhash. */ 6 | /* */ 7 | /* The contents are covered by the terms of the */ 8 | /* BSD license, which is included in the file */ 9 | /* license.txt. */ 10 | /*==============================================*/ 11 | 12 | #include "toolkit.h" 13 | #include "molhash.h" 14 | 15 | void Strip(NMS_pMOL mol, unsigned int striptype) 16 | { 17 | // The order of these operations is significant to some degree 18 | // - Hydrogens should be at the end as that is the common 19 | // use case 20 | 21 | if (striptype & StripType::AtomStereo) { 22 | NMS_FOR_ATOM_IN_MOL(atom, mol) { 23 | NMS_pATOM aptr = NMS_ITER_MOL_ATOM(atom, mol); 24 | if (NMS_ATOM_HAS_STEREO(aptr)) 25 | NMS_ATOM_REMOVE_STEREO(aptr); 26 | } 27 | } 28 | if (striptype & StripType::BondStereo) { 29 | NMS_FOR_BOND_IN_MOL(bond, mol) { 30 | NMS_pBOND bptr = NMS_ITER_MOL_BOND(bond, mol); 31 | if (NMS_BOND_HAS_STEREO(bptr)) 32 | NMS_BOND_REMOVE_STEREO(bptr); 33 | } 34 | } 35 | if (striptype & StripType::Isotope) { 36 | NMS_FOR_ATOM_IN_MOL(atom, mol) { 37 | NMS_pATOM aptr = NMS_ITER_MOL_ATOM(atom, mol); 38 | NMS_ATOM_SET_ISOTOPE(aptr, 0); 39 | } 40 | } 41 | if (striptype & StripType::AtomMap) { 42 | NMS_FOR_ATOM_IN_MOL(atom, mol) { 43 | NMS_pATOM aptr = NMS_ITER_MOL_ATOM(atom, mol); 44 | NMS_ATOM_SET_MAPIDX(aptr, 0); 45 | } 46 | } 47 | if (striptype & StripType::Hydrogen) { 48 | NMS_MOL_SUPPRESS_HYDROGENS(mol); 49 | } 50 | } 51 | 52 | void SplitMolecule(NMS_pMOL mol, std::vector &molv) 53 | { 54 | NMS_MOL_SPLIT_INTO_FRAGMENTS(mol, molv); 55 | } 56 | -------------------------------------------------------------------------------- /molhash.h: -------------------------------------------------------------------------------- 1 | /*==============================================*/ 2 | /* Copyright (C) 2019 NextMove Software */ 3 | /* All rights reserved. */ 4 | /* */ 5 | /* This file is part of molhash. */ 6 | /* */ 7 | /* The contents are covered by the terms of the */ 8 | /* BSD license, which is included in the file */ 9 | /* license.txt. */ 10 | /*==============================================*/ 11 | #ifndef NMS_MOLHASH_H 12 | #define NMS_MOLHASH_H 13 | 14 | #include "toolkit.h" 15 | #include 16 | 17 | struct HashFunction { 18 | static const unsigned int AnonymousGraph = 1; 19 | static const unsigned int ElementGraph = 2; 20 | static const unsigned int CanonicalSmiles = 3; 21 | static const unsigned int MurckoScaffold = 4; 22 | static const unsigned int ExtendedMurcko = 5; 23 | static const unsigned int MolFormula = 6; 24 | static const unsigned int AtomBondCounts = 7; 25 | static const unsigned int DegreeVector = 8; 26 | static const unsigned int Mesomer = 9; 27 | static const unsigned int HetAtomTautomer = 10; 28 | static const unsigned int HetAtomProtomer = 11; 29 | static const unsigned int RedoxPair = 12; 30 | static const unsigned int Regioisomer = 13; 31 | static const unsigned int NetCharge = 14; 32 | static const unsigned int SmallWorldIndexBR = 15; 33 | static const unsigned int SmallWorldIndexBRL = 16; 34 | static const unsigned int ArthorSubstructureOrder = 17; 35 | }; 36 | 37 | std::string MolHash(NMS_pMOL mol, unsigned int func); 38 | 39 | struct StripType { 40 | static const unsigned int AtomStereo = 1; 41 | static const unsigned int BondStereo = 2; 42 | static const unsigned int Isotope = 4; 43 | static const unsigned int AtomMap = 8; 44 | static const unsigned int Hydrogen = 16; 45 | }; 46 | 47 | void Strip(NMS_pMOL mol, unsigned int striptype); 48 | void SplitMolecule(NMS_pMOL mol, std::vector &molv); 49 | 50 | #endif // NMS_MOLHASH_H 51 | -------------------------------------------------------------------------------- /docs/_static/css/badge_only.css: -------------------------------------------------------------------------------- 1 | .fa:before{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-weight:normal;font-style:normal;src:url("../fonts/fontawesome-webfont.eot");src:url("../fonts/fontawesome-webfont.eot?#iefix") format("embedded-opentype"),url("../fonts/fontawesome-webfont.woff") format("woff"),url("../fonts/fontawesome-webfont.ttf") format("truetype"),url("../fonts/fontawesome-webfont.svg#FontAwesome") format("svg")}.fa:before{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;text-decoration:inherit}a .fa{display:inline-block;text-decoration:inherit}li .fa{display:inline-block}li .fa-large:before,li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-0.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before,ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before{content:""}.icon-book:before{content:""}.fa-caret-down:before{content:""}.icon-caret-down:before{content:""}.fa-caret-up:before{content:""}.icon-caret-up:before{content:""}.fa-caret-left:before{content:""}.icon-caret-left:before{content:""}.fa-caret-right:before{content:""}.icon-caret-right:before{content:""}.rst-versions{position:fixed;bottom:0;left:0;overflow-y:scroll;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:"Lato","proxima-nova","Helvetica Neue",Arial,sans-serif;z-index:400}.rst-versions a{color:#2980B9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27AE60;*zoom:1}.rst-versions .rst-current-version:before,.rst-versions .rst-current-version:after{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book{float:left}.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#E74C3C;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#F1C40F;color:#000}.rst-versions.shift-up{max-height:100%}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:gray;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:solid 1px #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px}.rst-versions.rst-badge .icon-book{float:none}.rst-versions.rst-badge .fa-book{float:none}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book{float:left}.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge .rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width: 768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} 2 | -------------------------------------------------------------------------------- /docs/_images/mesomer-hash-3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /docs/_images/mesomer-hash-4.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /docs/_static/js/theme.js: -------------------------------------------------------------------------------- 1 | require=function r(s,a,l){function c(i,n){if(!a[i]){if(!s[i]){var e="function"==typeof require&&require;if(!n&&e)return e(i,!0);if(u)return u(i,!0);var t=new Error("Cannot find module '"+i+"'");throw t.code="MODULE_NOT_FOUND",t}var o=a[i]={exports:{}};s[i][0].call(o.exports,function(n){var e=s[i][1][n];return c(e||n)},o,o.exports,r,s,a,l)}return a[i].exports}for(var u="function"==typeof require&&require,n=0;n"),i("table.docutils.footnote").wrap("
"),i("table.docutils.citation").wrap("
"),i(".wy-menu-vertical ul").not(".simple").siblings("a").each(function(){var e=i(this);expand=i(''),expand.on("click",function(n){return t.toggleCurrent(e),n.stopPropagation(),!1}),e.prepend(expand)})},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),i=e.find('[href="'+n+'"]');if(0===i.length){var t=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(i=e.find('[href="#'+t.attr("id")+'"]')).length&&(i=e.find('[href="#"]'))}0this.docHeight||(this.navBar.scrollTop(i),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",function(){this.linkScroll=!1})},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current"),e.siblings().find("li.current").removeClass("current"),e.find("> ul li.current").removeClass("current"),e.toggleClass("current")}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:e.exports.ThemeNav}),function(){for(var r=0,n=["ms","moz","webkit","o"],e=0;e 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /docs/_static/pygments.css: -------------------------------------------------------------------------------- 1 | .highlight .hll { background-color: #ffffcc } 2 | .highlight { background: #eeffcc; } 3 | .highlight .c { color: #408090; font-style: italic } /* Comment */ 4 | .highlight .err { border: 1px solid #FF0000 } /* Error */ 5 | .highlight .k { color: #007020; font-weight: bold } /* Keyword */ 6 | .highlight .o { color: #666666 } /* Operator */ 7 | .highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ 8 | .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ 9 | .highlight .cp { color: #007020 } /* Comment.Preproc */ 10 | .highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ 11 | .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ 12 | .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ 13 | .highlight .gd { color: #A00000 } /* Generic.Deleted */ 14 | .highlight .ge { font-style: italic } /* Generic.Emph */ 15 | .highlight .gr { color: #FF0000 } /* Generic.Error */ 16 | .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ 17 | .highlight .gi { color: #00A000 } /* Generic.Inserted */ 18 | .highlight .go { color: #333333 } /* Generic.Output */ 19 | .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ 20 | .highlight .gs { font-weight: bold } /* Generic.Strong */ 21 | .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ 22 | .highlight .gt { color: #0044DD } /* Generic.Traceback */ 23 | .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ 24 | .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ 25 | .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ 26 | .highlight .kp { color: #007020 } /* Keyword.Pseudo */ 27 | .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ 28 | .highlight .kt { color: #902000 } /* Keyword.Type */ 29 | .highlight .m { color: #208050 } /* Literal.Number */ 30 | .highlight .s { color: #4070a0 } /* Literal.String */ 31 | .highlight .na { color: #4070a0 } /* Name.Attribute */ 32 | .highlight .nb { color: #007020 } /* Name.Builtin */ 33 | .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */ 34 | .highlight .no { color: #60add5 } /* Name.Constant */ 35 | .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */ 36 | .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */ 37 | .highlight .ne { color: #007020 } /* Name.Exception */ 38 | .highlight .nf { color: #06287e } /* Name.Function */ 39 | .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ 40 | .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ 41 | .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ 42 | .highlight .nv { color: #bb60d5 } /* Name.Variable */ 43 | .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ 44 | .highlight .w { color: #bbbbbb } /* Text.Whitespace */ 45 | .highlight .mb { color: #208050 } /* Literal.Number.Bin */ 46 | .highlight .mf { color: #208050 } /* Literal.Number.Float */ 47 | .highlight .mh { color: #208050 } /* Literal.Number.Hex */ 48 | .highlight .mi { color: #208050 } /* Literal.Number.Integer */ 49 | .highlight .mo { color: #208050 } /* Literal.Number.Oct */ 50 | .highlight .sa { color: #4070a0 } /* Literal.String.Affix */ 51 | .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */ 52 | .highlight .sc { color: #4070a0 } /* Literal.String.Char */ 53 | .highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */ 54 | .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ 55 | .highlight .s2 { color: #4070a0 } /* Literal.String.Double */ 56 | .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ 57 | .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */ 58 | .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ 59 | .highlight .sx { color: #c65d09 } /* Literal.String.Other */ 60 | .highlight .sr { color: #235388 } /* Literal.String.Regex */ 61 | .highlight .s1 { color: #4070a0 } /* Literal.String.Single */ 62 | .highlight .ss { color: #517918 } /* Literal.String.Symbol */ 63 | .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ 64 | .highlight .fm { color: #06287e } /* Name.Function.Magic */ 65 | .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */ 66 | .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */ 67 | .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */ 68 | .highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */ 69 | .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ -------------------------------------------------------------------------------- /docs/_images/tautomer-hash-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /docs/_images/tautomer-hash-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /docs/_images/tautomer-hash-3.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /docs/_images/murcko.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.11) 2 | project(molhash) 3 | 4 | set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH}) 5 | set(CMAKE_SKIP_BUILD_RPATH FALSE) 6 | set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) 7 | 8 | find_package(RDKit) 9 | 10 | #################################### Set up the build for different targets 11 | set(TARGET "RDKIT") 12 | 13 | set(RDKIT_DIR "${RDKIT_DIR}" CACHE PATH "Where is RDKit installed?") 14 | 15 | message(STATUS "Targeting RDKit toolkit") 16 | if(NOT RDKIT_FOUND) 17 | message(FATAL_ERROR "Please specify the RDKit directory -DRDKIT_DIR") 18 | endif() 19 | find_package(ZLIB) 20 | 21 | # set(Boost_DEBUG ON) 22 | # Attempt 1: Search for static components 23 | set(Boost_USE_STATIC_LIBS ON) 24 | # find_package(Boost COMPONENTS date_time system thread) 25 | find_package(Boost QUIET COMPONENTS system thread) 26 | if(Boost_FOUND) 27 | # Again without QUIET to report version number 28 | find_package(Boost COMPONENTS system thread) 29 | else() 30 | # Attempt 2: Search for dynamic components 31 | set(Boost_USE_STATIC_LIBS OFF) 32 | find_package(Boost QUIET COMPONENTS system thread) 33 | if(Boost_FOUND) 34 | # Again without QUIET to report version number 35 | find_package(Boost COMPONENTS system thread) 36 | else() 37 | # Attempt 3: Search for static 38 | set(Boost_USE_STATIC_LIBS ON) 39 | find_package(Boost) 40 | if(NOT Boost_FOUND) 41 | message(FATAL_ERROR "Please specify the Boost directories") 42 | endif() 43 | endif() 44 | endif() 45 | 46 | add_definitions(-DUSE_RDKIT) 47 | set(TOOLKIT_CPP rdktoolkit.cpp rdktoolkit.h) 48 | set(TOOLKIT_INCLUDE_DIR ${RDKIT_INCLUDE_DIR} ${Boost_INCLUDE_DIRS}) 49 | link_directories(${Boost_LIBRARY_DIRS}) # Needed for some MSVC compilers 50 | set(TOOLKIT_LIBS ${RDKIT_LIBRARIES} ${Boost_SYSTEM_LIBRARY} 51 | ${Boost_THREAD_LIBRARY} ${Boost_DATE_TIME_LIBRARY} 52 | ${ZLIB_LIBRARIES}) 53 | # Boost_THREAD_LIBRARY can depend upon pthread and rt on Linux 54 | if(NOT MSVC) 55 | if (NOT APPLE AND NOT MINGW) 56 | set(TOOLKIT_LIBS ${TOOLKIT_LIBS} pthread rt) 57 | else() 58 | set(TOOLKIT_LIBS ${TOOLKIT_LIBS} pthread) 59 | endif() 60 | endif() 61 | 62 | # Find what version of RDKit - for MSVC test multiple build types 63 | if (MSVC) 64 | foreach(TEST_BUILD_TYPE ${CMAKE_BUILD_TYPE} RELEASE DEBUG) 65 | set(CMAKE_TRY_COMPILE_CONFIGURATION ${TEST_BUILD_TYPE}) 66 | try_run(RUNOK COMPILEOK "${CMAKE_BINARY_DIR}/getrdkitversion" "${CMAKE_SOURCE_DIR}/cmake/ReportRDKitVersion.cpp" 67 | LINK_LIBRARIES ${TOOLKIT_LIBS} 68 | RUN_OUTPUT_VARIABLE RDKITVERSION 69 | CMAKE_FLAGS 70 | "-DINCLUDE_DIRECTORIES=${TOOLKIT_INCLUDE_DIR}") 71 | if(COMPILEOK) 72 | break() 73 | endif() 74 | endforeach() 75 | else() 76 | try_run(RUNOK COMPILEOK "${CMAKE_BINARY_DIR}/getrdkitversion" "${CMAKE_SOURCE_DIR}/cmake/ReportRDKitVersion.cpp" 77 | LINK_LIBRARIES ${TOOLKIT_LIBS} 78 | RUN_OUTPUT_VARIABLE RDKITVERSION 79 | CMAKE_FLAGS 80 | "-DINCLUDE_DIRECTORIES=${TOOLKIT_INCLUDE_DIR}") 81 | endif() 82 | if(COMPILEOK) 83 | message(STATUS "The RDKit version is ${RDKITVERSION}") 84 | else() 85 | message(FATAL_ERROR "Compiling a test program using RDKit failed. Are the library paths correct? (${TOOLKIT_LIBS})") 86 | endif() 87 | 88 | add_definitions(-DNMS_RDKIT_VERSION=${RDKITVERSION}) 89 | 90 | ########################################################################### 91 | 92 | 93 | ######################################################### Build the Project 94 | if(CMAKE_COMPILER_IS_GNUCXX) 95 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -W -Wall -ffast-math") 96 | if(MINGW) 97 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc") 98 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") 99 | set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS 100 | "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -static-libgcc -s") 101 | set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS 102 | "${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS} -static-libgcc -static-libstdc++ -s") 103 | elseif(NOT CYGWIN) # GCC on Linux (needed for Java bindings to compile) 104 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") 105 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") 106 | endif() 107 | if(NOT "${RDKITVERSION}" LESS 20180101) 108 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") 109 | endif() 110 | endif() 111 | if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") 112 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -W -Wall -ffast-math") 113 | if(NOT "${RDKITVERSION}" LESS 20180101) 114 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") 115 | endif() 116 | endif() 117 | 118 | include_directories(${TOOLKIT_INCLUDE_DIR}) 119 | include_directories(${CMAKE_SOURCE_DIR}) 120 | 121 | set(molhashlib_srcs 122 | mf.h 123 | molhash.h 124 | hashfunctions.cpp 125 | normalize.cpp 126 | ${TOOLKIT_CPP} 127 | ) 128 | 129 | # Static library 130 | add_library(molhashlib ${molhashlib_srcs}) 131 | target_link_libraries(molhashlib ${TOOLKIT_LIBS}) 132 | 133 | add_executable(molhash molhash.cpp) 134 | target_link_libraries(molhash molhashlib) 135 | -------------------------------------------------------------------------------- /docs/search.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Search — MolHash 1.0 documentation 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
45 | 46 | 47 | 102 | 103 |
104 | 105 | 106 | 112 | 113 | 114 |
115 | 116 |
117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 |
135 | 136 |
    137 | 138 |
  • Docs »
  • 139 | 140 |
  • Search
  • 141 | 142 | 143 |
  • 144 | 145 | 146 | 147 |
  • 148 | 149 |
150 | 151 | 152 |
153 |
154 |
155 |
156 | 157 | 165 | 166 | 167 |
168 | 169 |
170 | 171 |
172 | 173 |
174 |
175 | 176 | 177 |
178 | 179 |
180 |

181 | © Copyright 2015-2019, NextMove Software. 182 | 183 |

184 |
185 | 186 |
187 | 188 |
189 |
190 | 191 |
192 | 193 |
194 | 195 | 196 | 197 | 198 | 199 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 229 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | -------------------------------------------------------------------------------- /cmake/modules/FindRDKit.cmake: -------------------------------------------------------------------------------- 1 | # FindRDKit.cmake 2 | # Copyright (C) 2013-2017 NextMove Software 3 | # Try to find RDKit headers and libraries 4 | # Defines: 5 | # 6 | # RDKIT_FOUND - system has RDKit 7 | # RDKIT_INCLUDE_DIR - the RDKit include directory 8 | # RDKIT_LIBRARIES - Link these to use RDKit 9 | 10 | if(RDKIT_INCLUDE_DIR AND RDKIT_LIBRARIES) 11 | # in cache already or user-specified 12 | set(RDKIT_FOUND TRUE) 13 | 14 | else() 15 | 16 | if(NOT RDKIT_INCLUDE_DIR) 17 | if(WIN32) 18 | find_path(RDKIT_INCLUDE_DIR GraphMol/RDKitBase.h 19 | PATHS 20 | ${RDKIT_DIR}\\Code 21 | ${RDKIT_DIR}\\include\\rdkit 22 | $ENV{RDKIT_INCLUDE_DIR} 23 | $ENV{RDKIT_INCLUDE_PATH} 24 | $ENV{RDKIT_BASE}\\Code 25 | $ENV{RDBASE}\\Code 26 | C:\\RDKit\\include 27 | C:\\RDKit\\Code 28 | ) 29 | else() 30 | find_path(RDKIT_INCLUDE_DIR GraphMol/RDKitBase.h 31 | PATHS 32 | ${RDKIT_DIR}/Code 33 | ${RDKIT_DIR}/include/rdkit 34 | $ENV{RDKIT_INCLUDE_DIR} 35 | $ENV{RDKIT_INCLUDE_PATH} 36 | $ENV{RDKIT_BASE}/Code 37 | $ENV{RDBASE}/Code 38 | /usr/local/rdkit/include/Code 39 | /usr/local/rdkit/include 40 | /usr/local/rdkit/Code 41 | /usr/local/include/rdkit 42 | ~/rdkit/Code 43 | ) 44 | endif() 45 | if(RDKIT_INCLUDE_DIR) 46 | message(STATUS "Found RDKit include files at ${RDKIT_INCLUDE_DIR}") 47 | endif() 48 | endif() 49 | 50 | if(NOT RDKIT_LIBRARIES) 51 | find_library(RDKIT_FILEPARSERS_LIB 52 | NAMES RDKitFileParsers_static RDKitFileParsers 53 | FileParsers_static FileParsers 54 | NO_DEFAULT_PATH 55 | PATHS 56 | ${RDKIT_DIR}/lib 57 | $ENV{RDKIT_LIB_DIR} 58 | $ENV{RDKIT_LIB_PATH} 59 | $ENV{RDKIT_LIBRARIES} 60 | $ENV{RDKIT_BASE}/lib 61 | $ENV{RDBASE}/lib 62 | /usr/local/rdkit/lib 63 | ~/rdkit/lib 64 | $ENV{LD_LIBRARY_PATH} 65 | ) 66 | find_library(RDKIT_FILEPARSERS_LIB # repeat but use the default path 67 | NAMES RDKitFileParsers_static RDKitFileParsers 68 | FileParsers_static FileParsers 69 | ) 70 | if(RDKIT_FILEPARSERS_LIB) 71 | GET_FILENAME_COMPONENT(RDKIT_LIBRARY_DIR ${RDKIT_FILEPARSERS_LIB} PATH) 72 | 73 | # Note that the order of the following libraries is significant!! 74 | find_library(SMILESPARSE_LIB NAMES RDKitSmilesParse_static 75 | RDKitSmilesParse 76 | SmilesParse_static 77 | SmilesParse 78 | HINTS ${RDKIT_LIBRARY_DIR} NO_DEFAULT_PATH) 79 | find_library(DEPICTOR_LIB NAMES RDKitDepictor_static 80 | RDKitDepictor 81 | Depictor_static 82 | Depictor 83 | HINTS ${RDKIT_LIBRARY_DIR} NO_DEFAULT_PATH) 84 | find_library(SUBSTRUCTMATCH_LIB NAMES RDKitSubstructMatch_static 85 | RDKitSubstructMatch 86 | SubstructMatch_static 87 | SubstructMatch 88 | HINTS ${RDKIT_LIBRARY_DIR} NO_DEFAULT_PATH) 89 | find_library(GRAPHMOL_LIB NAMES RDKitGraphMol_static 90 | RDKitGraphMol 91 | GraphMol_static 92 | GraphMol 93 | HINTS ${RDKIT_LIBRARY_DIR} NO_DEFAULT_PATH) 94 | find_library(RDGEOMETRYLIB_LIB NAMES RDKitRDGeometryLib_static 95 | RDKitRDGeometryLib 96 | RDKitGeometryLib_static 97 | RDKitGeometryLib 98 | RDGeometryLib_static 99 | RDGeometryLib 100 | HINTS ${RDKIT_LIBRARY_DIR} NO_DEFAULT_PATH) 101 | find_library(RDGENERAL_LIB NAMES RDKitRDGeneral_static 102 | RDKitRDGeneral 103 | RDKitGeneral_static 104 | RDKitGeneral 105 | RDGeneral_static 106 | RDGeneral 107 | HINTS ${RDKIT_LIBRARY_DIR} NO_DEFAULT_PATH) 108 | find_library(COORDGEN_LIB NAMES RDKitcoordgen_static 109 | RDKitcoordgen 110 | RDKitcoordgenlib_static 111 | RDKitcoordgenlib 112 | coordgenlib_static 113 | coordgenlib 114 | coordgen_static 115 | coordgen 116 | HINTS ${RDKIT_LIBRARY_DIR} NO_DEFAULT_PATH) 117 | find_library(MAEPARSER_LIB NAMES RDKitmaeparser_static 118 | RDKitmaeparser 119 | maeparser_static 120 | maeparser 121 | HINTS ${RDKIT_LIBRARY_DIR} NO_DEFAULT_PATH) 122 | find_library(DATASTRUCTS_LIB NAMES RDKitDataStructs_static 123 | RDKitDataStructs 124 | HINTS ${RDKIT_LIBRARY_DIR} NO_DEFAULT_PATH) 125 | set (RDKIT_LIBRARIES ${RDKIT_FILEPARSERS_LIB} ${SMILESPARSE_LIB} 126 | ${DEPICTOR_LIB} ${SUBSTRUCTMATCH_LIB} ${GRAPHMOL_LIB} 127 | ${RDGEOMETRYLIB_LIB} ${RDGENERAL_LIB}) 128 | if(COORDGEN_LIB AND MAEPARSER_LIB) 129 | set(RDKIT_LIBRARIES ${RDKIT_LIBRARIES} ${COORDGEN_LIB} ${MAEPARSER_LIB}) 130 | endif() 131 | if(DATASTRUCTS_LIB) 132 | set(RDKIT_LIBRARIES ${RDKIT_LIBRARIES} ${DATASTRUCTS_LIB}) 133 | endif() 134 | message(STATUS "Found RDKit libraries at ${RDKIT_LIBRARY_DIR}") 135 | endif() 136 | endif() 137 | 138 | if(RDKIT_INCLUDE_DIR AND RDKIT_LIBRARIES) 139 | set(RDKIT_FOUND TRUE) 140 | endif() 141 | 142 | mark_as_advanced(RDKIT_INCLUDE_DIR RDKIT_LIBRARIES RDKIT_FILEPARSERS_LIB) 143 | endif() 144 | 145 | -------------------------------------------------------------------------------- /mf.h: -------------------------------------------------------------------------------- 1 | /*==============================================*/ 2 | /* Copyright (C) 2016-2019 NextMove Software */ 3 | /* All rights reserved. */ 4 | /* */ 5 | /* This file is part of molhash. */ 6 | /* */ 7 | /* The contents are covered by the terms of the */ 8 | /* BSD license, which is included in the file */ 9 | /* license.txt. */ 10 | /*==============================================*/ 11 | #ifndef NMS_MOLFORMULA_H 12 | #define NMS_MOLFORMULA_H 13 | 14 | static unsigned char OrganicHillOrder[119] = { 15 | 6, /* C */ 16 | 1, /* H */ 17 | 89, /* Ac */ 18 | 47, /* Ag */ 19 | 13, /* Al */ 20 | 95, /* Am */ 21 | 18, /* Ar */ 22 | 33, /* As */ 23 | 85, /* At */ 24 | 79, /* Au */ 25 | 5, /* B */ 26 | 56, /* Ba */ 27 | 4, /* Be */ 28 | 107, /* Bh */ 29 | 83, /* Bi */ 30 | 97, /* Bk */ 31 | 35, /* Br */ 32 | 20, /* Ca */ 33 | 48, /* Cd */ 34 | 58, /* Ce */ 35 | 98, /* Cf */ 36 | 17, /* Cl */ 37 | 96, /* Cm */ 38 | 112, /* Cn */ 39 | 27, /* Co */ 40 | 24, /* Cr */ 41 | 55, /* Cs */ 42 | 29, /* Cu */ 43 | 105, /* Db */ 44 | 110, /* Ds */ 45 | 66, /* Dy */ 46 | 68, /* Er */ 47 | 99, /* Es */ 48 | 63, /* Eu */ 49 | 9, /* F */ 50 | 26, /* Fe */ 51 | 114, /* Fl */ 52 | 100, /* Fm */ 53 | 87, /* Fr */ 54 | 31, /* Ga */ 55 | 64, /* Gd */ 56 | 32, /* Ge */ 57 | 2, /* He */ 58 | 72, /* Hf */ 59 | 80, /* Hg */ 60 | 67, /* Ho */ 61 | 108, /* Hs */ 62 | 53, /* I */ 63 | 49, /* In */ 64 | 77, /* Ir */ 65 | 19, /* K */ 66 | 36, /* Kr */ 67 | 57, /* La */ 68 | 3, /* Li */ 69 | 103, /* Lr */ 70 | 71, /* Lu */ 71 | 116, /* Lv */ 72 | 115, /* Mc */ 73 | 101, /* Md */ 74 | 12, /* Mg */ 75 | 25, /* Mn */ 76 | 42, /* Mo */ 77 | 109, /* Mt */ 78 | 7, /* N */ 79 | 11, /* Na */ 80 | 41, /* Nb */ 81 | 60, /* Nd */ 82 | 10, /* Ne */ 83 | 113, /* Nh */ 84 | 28, /* Ni */ 85 | 102, /* No */ 86 | 93, /* Np */ 87 | 8, /* O */ 88 | 118, /* Og */ 89 | 76, /* Os */ 90 | 15, /* P */ 91 | 91, /* Pa */ 92 | 82, /* Pb */ 93 | 46, /* Pd */ 94 | 61, /* Pm */ 95 | 84, /* Po */ 96 | 59, /* Pr */ 97 | 78, /* Pt */ 98 | 94, /* Pu */ 99 | 88, /* Ra */ 100 | 37, /* Rb */ 101 | 75, /* Re */ 102 | 104, /* Rf */ 103 | 111, /* Rg */ 104 | 45, /* Rh */ 105 | 86, /* Rn */ 106 | 44, /* Ru */ 107 | 16, /* S */ 108 | 51, /* Sb */ 109 | 21, /* Sc */ 110 | 34, /* Se */ 111 | 106, /* Sg */ 112 | 14, /* Si */ 113 | 62, /* Sm */ 114 | 50, /* Sn */ 115 | 38, /* Sr */ 116 | 73, /* Ta */ 117 | 65, /* Tb */ 118 | 43, /* Tc */ 119 | 52, /* Te */ 120 | 90, /* Th */ 121 | 22, /* Ti */ 122 | 81, /* Tl */ 123 | 69, /* Tm */ 124 | 117, /* Ts */ 125 | 92, /* U */ 126 | 23, /* V */ 127 | 74, /* W */ 128 | 0, /* X */ 129 | 54, /* Xe */ 130 | 39, /* Y */ 131 | 70, /* Yb */ 132 | 30, /* Zn */ 133 | 40 /* Zr */ 134 | }; 135 | 136 | static unsigned char InorganicHillOrder[119] = { 137 | 89, /* Ac */ 138 | 47, /* Ag */ 139 | 13, /* Al */ 140 | 95, /* Am */ 141 | 18, /* Ar */ 142 | 33, /* As */ 143 | 85, /* At */ 144 | 79, /* Au */ 145 | 5, /* B */ 146 | 56, /* Ba */ 147 | 4, /* Be */ 148 | 107, /* Bh */ 149 | 83, /* Bi */ 150 | 97, /* Bk */ 151 | 35, /* Br */ 152 | 6, /* C */ 153 | 20, /* Ca */ 154 | 48, /* Cd */ 155 | 58, /* Ce */ 156 | 98, /* Cf */ 157 | 17, /* Cl */ 158 | 96, /* Cm */ 159 | 112, /* Cn */ 160 | 27, /* Co */ 161 | 24, /* Cr */ 162 | 55, /* Cs */ 163 | 29, /* Cu */ 164 | 105, /* Db */ 165 | 110, /* Ds */ 166 | 66, /* Dy */ 167 | 68, /* Er */ 168 | 99, /* Es */ 169 | 63, /* Eu */ 170 | 9, /* F */ 171 | 26, /* Fe */ 172 | 114, /* Fl */ 173 | 100, /* Fm */ 174 | 87, /* Fr */ 175 | 31, /* Ga */ 176 | 64, /* Gd */ 177 | 32, /* Ge */ 178 | 1, /* H */ 179 | 2, /* He */ 180 | 72, /* Hf */ 181 | 80, /* Hg */ 182 | 67, /* Ho */ 183 | 108, /* Hs */ 184 | 53, /* I */ 185 | 49, /* In */ 186 | 77, /* Ir */ 187 | 19, /* K */ 188 | 36, /* Kr */ 189 | 57, /* La */ 190 | 3, /* Li */ 191 | 103, /* Lr */ 192 | 71, /* Lu */ 193 | 116, /* Lv */ 194 | 115, /* Mc */ 195 | 101, /* Md */ 196 | 12, /* Mg */ 197 | 25, /* Mn */ 198 | 42, /* Mo */ 199 | 109, /* Mt */ 200 | 7, /* N */ 201 | 11, /* Na */ 202 | 41, /* Nb */ 203 | 60, /* Nd */ 204 | 10, /* Ne */ 205 | 113, /* Nh */ 206 | 28, /* Ni */ 207 | 102, /* No */ 208 | 93, /* Np */ 209 | 8, /* O */ 210 | 118, /* Og */ 211 | 76, /* Os */ 212 | 15, /* P */ 213 | 91, /* Pa */ 214 | 82, /* Pb */ 215 | 46, /* Pd */ 216 | 61, /* Pm */ 217 | 84, /* Po */ 218 | 59, /* Pr */ 219 | 78, /* Pt */ 220 | 94, /* Pu */ 221 | 88, /* Ra */ 222 | 37, /* Rb */ 223 | 75, /* Re */ 224 | 104, /* Rf */ 225 | 111, /* Rg */ 226 | 45, /* Rh */ 227 | 86, /* Rn */ 228 | 44, /* Ru */ 229 | 16, /* S */ 230 | 51, /* Sb */ 231 | 21, /* Sc */ 232 | 34, /* Se */ 233 | 106, /* Sg */ 234 | 14, /* Si */ 235 | 62, /* Sm */ 236 | 50, /* Sn */ 237 | 38, /* Sr */ 238 | 73, /* Ta */ 239 | 65, /* Tb */ 240 | 43, /* Tc */ 241 | 52, /* Te */ 242 | 90, /* Th */ 243 | 22, /* Ti */ 244 | 81, /* Tl */ 245 | 69, /* Tm */ 246 | 117, /* Ts */ 247 | 92, /* U */ 248 | 23, /* V */ 249 | 74, /* W */ 250 | 0, /* X */ 251 | 54, /* Xe */ 252 | 39, /* Y */ 253 | 70, /* Yb */ 254 | 30, /* Zn */ 255 | 40 /* Zr */ 256 | }; 257 | 258 | 259 | static const char *symbol[119] = { 260 | // x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 261 | "X", "H", "He", "Li", "Be", "B", "C", "N", "O", "F", // x 262 | "Ne", "Na", "Mg", "Al", "Si", "P", "S", "Cl", "Ar", "K", // 1x 263 | "Ca", "Sc", "Ti", "V", "Cr", "Mn", "Fe", "Co", "Ni", "Cu", // 2x 264 | "Zn", "Ga", "Ge", "As", "Se", "Br", "Kr", "Rb", "Sr", "Y", // 3x 265 | "Zr", "Nb", "Mo", "Tc", "Ru", "Rh", "Pd", "Ag", "Cd", "In", // 4x 266 | "Sn", "Sb", "Te", "I", "Xe", "Cs", "Ba", "La", "Ce", "Pr", // 5x 267 | "Nd", "Pm", "Sm", "Eu", "Gd", "Tb", "Dy", "Ho", "Er", "Tm", // 6x 268 | "Yb", "Lu", "Hf", "Ta", "W", "Re", "Os", "Ir", "Pt", "Au", // 7x 269 | "Hg", "Tl", "Pb", "Bi", "Po", "At", "Rn", "Fr", "Ra", "Ac", // 8x 270 | "Th", "Pa", "U", "Np", "Pu", "Am", "Cm", "Bk", "Cf", "Es", // 9x 271 | "Fm", "Md", "No", "Lr", "Rf", "Db", "Sg", "Bh", "Hs", "Mt", // 10x 272 | "Ds", "Rg", "Cn", "Nh", "Fl", "Mc", "Lv", "Ts", "Og" }; 273 | 274 | #endif // NMS_MOLFORMULA_H 275 | 276 | -------------------------------------------------------------------------------- /rdktoolkit.cpp: -------------------------------------------------------------------------------- 1 | /*==============================================*/ 2 | /* Copyright (C) 2012-2019 NextMove Software */ 3 | /* All rights reserved. */ 4 | /* */ 5 | /* This file is part of molhash. */ 6 | /* */ 7 | /* The contents are covered by the terms of the */ 8 | /* BSD license, which is included in the file */ 9 | /* license.txt. */ 10 | /*==============================================*/ 11 | #include "toolkit.h" 12 | 13 | #include 14 | 15 | #include 16 | #include 17 | #include 18 | 19 | 20 | #include "RDGeneral/versions.h" 21 | 22 | RDKit::RWMol *NMRDKitSmilesToMol(const char *smi) 23 | { 24 | // Special case empty molecules for RDKit 25 | if (smi[0] == ' ' || smi[0] == '\t' || smi[0] == '\0') 26 | return new RDKit::RWMol(); 27 | RDKit::RWMol *mol = (RDKit::RWMol*)0; 28 | try { 29 | mol = RDKit::SmilesToMol(smi); 30 | } 31 | catch (...) { // RDKit::MolSanitizeException and friends 32 | mol = (RDKit::RWMol*)0; 33 | } 34 | 35 | // Extract title 36 | const char* ptr = smi; 37 | while(true) { 38 | if (*ptr == '\0' || *ptr == ' ' || *ptr == '\t') 39 | break; 40 | ptr++; 41 | } 42 | while (*ptr == ' ' || *ptr == '\t') 43 | ptr++; 44 | if (*ptr) { 45 | std::string title(ptr); 46 | mol->setProp("_Name", title); 47 | } 48 | 49 | return mol; 50 | } 51 | 52 | 53 | RDKit::Atom *NMRDKitMolNewAtom(RDKit::RWMol *mol, unsigned int elem) 54 | { 55 | RDKit::Atom *result = new RDKit::Atom(elem); 56 | mol->addAtom(result,true,true); 57 | result->setNoImplicit(true); 58 | 59 | #if 0 60 | /* This should now be fixed in latest RDKit */ 61 | if (mol->getNumConformers()) 62 | mol->getConformer().resize(mol->getNumAtoms()); 63 | #endif 64 | 65 | return result; 66 | } 67 | 68 | 69 | RDKit::Bond *NMRDKitMolNewBond(RDKit::RWMol *mol, 70 | RDKit::Atom *src, RDKit::Atom *dst, 71 | unsigned int order, bool arom) 72 | { 73 | RDKit::Bond *result; 74 | result = mol->getBondBetweenAtoms(src->getIdx(),dst->getIdx()); 75 | if (result) { 76 | if (order == 1) { 77 | switch (result->getBondType()) { 78 | case RDKit::Bond::SINGLE: 79 | result->setBondType(RDKit::Bond::DOUBLE); 80 | break; 81 | case RDKit::Bond::DOUBLE: 82 | result->setBondType(RDKit::Bond::TRIPLE); 83 | break; 84 | default: 85 | break; 86 | } 87 | } 88 | return result; 89 | } 90 | RDKit::Bond::BondType type = RDKit::Bond::UNSPECIFIED; 91 | if (!arom) { 92 | switch (order) { 93 | case 1: type = RDKit::Bond::SINGLE; break; 94 | case 2: type = RDKit::Bond::DOUBLE; break; 95 | case 3: type = RDKit::Bond::TRIPLE; break; 96 | case 4: type = RDKit::Bond::QUADRUPLE; break; 97 | } 98 | } else type = RDKit::Bond::AROMATIC; 99 | 100 | result = new RDKit::Bond(type); 101 | result->setOwningMol(mol); 102 | result->setBeginAtom(src); 103 | result->setEndAtom(dst); 104 | mol->addBond(result,true); 105 | if (arom) 106 | result->setIsAromatic(true); 107 | return result; 108 | } 109 | 110 | 111 | unsigned int NMRDKitAtomGetExplicitValence(RDKit::Atom *atm) 112 | { 113 | unsigned int result = 0; 114 | RDKit::ROMol::OEDGE_ITER beg,end; 115 | const RDKit::ROMol &mol = atm->getOwningMol(); 116 | boost::tie(beg,end) = mol.getAtomBonds(atm); 117 | while (beg!=end) { 118 | switch (mol[*beg]->getBondType()) { 119 | default: /* silence warnings */ 120 | case RDKit::Bond::SINGLE: 121 | case RDKit::Bond::AROMATIC: 122 | result += 1; 123 | break; 124 | case RDKit::Bond::DOUBLE: 125 | result += 2; 126 | break; 127 | case RDKit::Bond::TRIPLE: 128 | result += 3; 129 | break; 130 | case RDKit::Bond::QUADRUPLE: 131 | result += 4; 132 | break; 133 | } 134 | ++beg; 135 | } 136 | return result; 137 | } 138 | 139 | 140 | void NMRDKitBondSetOrder(RDKit::Bond *bnd, unsigned int order) 141 | { 142 | switch (order) { 143 | case 1: bnd->setBondType(RDKit::Bond::SINGLE); break; 144 | case 2: bnd->setBondType(RDKit::Bond::DOUBLE); break; 145 | case 3: bnd->setBondType(RDKit::Bond::TRIPLE); break; 146 | case 4: bnd->setBondType(RDKit::Bond::QUADRUPLE); break; 147 | case 5: bnd->setBondType(RDKit::Bond::QUINTUPLE); break; 148 | } 149 | bnd->setIsAromatic(false); 150 | } 151 | 152 | 153 | unsigned int NMRDKitBondGetOrder(const RDKit::Bond *bnd) 154 | { 155 | switch (bnd->getBondType()) { 156 | case RDKit::Bond::AROMATIC: 157 | case RDKit::Bond::SINGLE: 158 | return 1; 159 | case RDKit::Bond::DOUBLE: 160 | return 2; 161 | case RDKit::Bond::TRIPLE: 162 | return 3; 163 | case RDKit::Bond::QUADRUPLE: 164 | return 4; 165 | case RDKit::Bond::QUINTUPLE: 166 | return 5; 167 | case RDKit::Bond::HEXTUPLE: 168 | return 6; 169 | default: 170 | return 0; 171 | } 172 | } 173 | 174 | 175 | std::string NMRDKitMolGetTitle(RDKit::RWMol *mol) 176 | { 177 | static std::string key("_Name"); 178 | std::string result; 179 | if (mol->hasProp(key)) 180 | mol->getProp(key,result); 181 | return result; 182 | } 183 | 184 | 185 | void NMRDKitAtomSetMapIdx(RDKit::Atom *atm, unsigned int idx) 186 | { 187 | static std::string key("molAtomMapNumber"); 188 | if (idx) 189 | atm->setProp(key,(int)idx); 190 | else if (atm->hasProp(key)) 191 | atm->clearProp(key); 192 | } 193 | 194 | 195 | void NMRDKitAtomSetImplicitHCount(RDKit::Atom *atm, unsigned int hcount) 196 | { 197 | atm->setNoImplicit(true); 198 | atm->setNumExplicitHs(hcount); 199 | } 200 | 201 | void NMRDKitSanitizeHydrogens(RDKit::RWMol *mol) 202 | { 203 | // Move all of the implicit Hs into one box 204 | NMS_FOR_ATOM_IN_MOL(atom, mol) { 205 | NMS_pATOM aptr = NMS_ITER_MOL_ATOM(atom, mol); 206 | unsigned int hcount = aptr->getTotalNumHs(); 207 | aptr->setNoImplicit(true); 208 | aptr->setNumExplicitHs(hcount); 209 | aptr->updatePropertyCache(); // or else the valence is reported incorrectly 210 | } 211 | } 212 | 213 | void NMRDKitMolSplitFragments(NMS_pMOL mol, std::vector &fragments) 214 | { 215 | RDKit::MOL_SPTR_VECT mfrags = RDKit::MolOps::getMolFrags(*mol); 216 | RDKit::MOL_SPTR_VECT::iterator vit; 217 | for(vit = mfrags.begin(); vit != mfrags.end(); ++vit) { 218 | RDKit::ROMol* wrappedmol = (*vit).get(); // reach inside the shared pointer... 219 | fragments.push_back(new NMS_MOL(*wrappedmol)); // ...and make a copy 220 | } 221 | } 222 | 223 | void NMRDKitMolCalculateRingInfo(NMS_pMOL mol) 224 | { 225 | if (!mol->getRingInfo()->isInitialized()) 226 | RDKit::MolOps::fastFindRings(*mol); 227 | } 228 | -------------------------------------------------------------------------------- /docs/_images/anonymous-graph.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /docs/genindex.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Index — MolHash 1.0 documentation 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 48 | 103 | 104 |
105 | 106 | 107 | 113 | 114 | 115 |
116 | 117 |
118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 |
136 | 137 |
    138 | 139 |
  • Docs »
  • 140 | 141 |
  • Index
  • 142 | 143 | 144 |
  • 145 | 146 | 147 | 148 |
  • 149 | 150 |
151 | 152 | 153 |
154 |
155 |
156 |
157 | 158 | 159 |

Index

160 | 161 |
162 | H 163 | | M 164 | | S 165 | 166 |
167 |

H

168 | 169 | 173 |
174 | 175 |

M

176 | 177 | 183 | 189 |
190 | 191 |

S

192 | 193 | 197 | 203 |
204 | 205 | 206 | 207 |
208 | 209 |
210 |
211 | 212 | 213 |
214 | 215 |
216 |

217 | © Copyright 2015-2019, NextMove Software. 218 | 219 |

220 |
221 | 222 |
223 | 224 |
225 |
226 | 227 |
228 | 229 |
230 | 231 | 232 | 233 | 234 | 235 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 264 | 265 | 266 | -------------------------------------------------------------------------------- /docs/_images/extendedmurcko.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | MolHash — MolHash 1.0 documentation 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 48 | 103 | 104 |
105 | 106 | 107 | 113 | 114 | 115 |
116 | 117 |
118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 |
136 | 137 |
    138 | 139 |
  • Docs »
  • 140 | 141 |
  • MolHash
  • 142 | 143 | 144 |
  • 145 | 146 | 147 | 148 |
  • 149 | 150 |
151 | 152 | 153 |
154 |
155 |
156 |
157 | 158 |
159 |

MolHash

160 |
161 |

Contents

162 | 185 |
186 |
187 | 188 | 189 |
190 | 191 |
192 |
193 | 194 | 200 | 201 | 202 |
203 | 204 |
205 |

206 | © Copyright 2015-2019, NextMove Software. 207 | 208 |

209 |
210 | 211 |
212 | 213 |
214 |
215 | 216 |
217 | 218 |
219 | 220 | 221 | 222 | 223 | 224 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 253 | 254 | 255 | -------------------------------------------------------------------------------- /docs/installation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Installation — MolHash 1.0 documentation 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 |
47 | 48 | 49 | 107 | 108 |
109 | 110 | 111 | 117 | 118 | 119 |
120 | 121 |
122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
140 | 141 |
    142 | 143 |
  • Docs »
  • 144 | 145 |
  • Installation
  • 146 | 147 | 148 |
  • 149 | 150 | 151 | 152 |
  • 153 | 154 |
155 | 156 | 157 |
158 |
159 |
160 |
161 | 162 |
163 |

Installation

164 |
165 |

Compile the executable

166 |

Ensure that a version of CMake is available, as well as RDKit. Boost will also be necessary.:

167 |
cd molhash
168 | mkdir build
169 | cd build
170 | cmake ..
171 | make -j6
172 | 
173 |
174 |

If CMake cannot automatically find the cheminformatics toolkit or the Boost libraries, it may be necessary to provide more information:

175 |
cmake .. -DTARGET=RDKIT -DRDKIT_DIR=D:\Tools\RDKit\msvc\Release\tree -DBOOST_ROOT=D:\Tools\boost -DBOOST_LIBRARYDIR=D:\Tools\boost\boost_1_65_1\lib64-msvc-14.1
176 | 
177 |
178 |

If successful, the molhash executable will be generated.

179 |
180 |
181 | 182 | 183 |
184 | 185 |
186 |
187 | 188 | 196 | 197 | 198 |
199 | 200 |
201 |

202 | © Copyright 2015-2019, NextMove Software. 203 | 204 |

205 |
206 | 207 |
208 | 209 |
210 |
211 | 212 |
213 | 214 |
215 | 216 | 217 | 218 | 219 | 220 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 249 | 250 | 251 | -------------------------------------------------------------------------------- /rdktoolkit.h: -------------------------------------------------------------------------------- 1 | /*==============================================*/ 2 | /* Copyright (c) 2012-2019 NextMove Software */ 3 | /* */ 4 | /* This file is part of molhash. */ 5 | /* */ 6 | /* The contents are covered by the terms of the */ 7 | /* BSD license, which is included in the file */ 8 | /* license.txt. */ 9 | /*==============================================*/ 10 | #ifndef NMS_RDKTOOLKIT_H 11 | #define NMS_RDKTOOLKIT_H 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #if NMS_RDKIT_VERSION < 20180301 23 | #define NMS_RDKIT_ITER_TO_BOND(M,I) (M)[I].get() 24 | #define NMS_RDKIT_ITER_TO_ATOM(M,I) (M)[I].get() 25 | #else 26 | #define NMS_RDKIT_ITER_TO_BOND(M,I) (M)[I] 27 | #define NMS_RDKIT_ITER_TO_ATOM(M,I) (M)[I] 28 | #endif 29 | 30 | #define NMS_MOL RDKit::RWMol 31 | #define NMS_pMOL RDKit::RWMol* 32 | #define NMS_MOL_TO_pMOL(X) (&(X)) 33 | 34 | #define NMS_pATOM RDKit::Atom* 35 | #define NMS_pBOND RDKit::Bond* 36 | 37 | #define NMS_MOL_SET_DIMENSION(M,D) NMRDKitMolSetDimension(M,D) 38 | #define NMS_MOL_SET_TITLE(M,X) (M)->setProp("_Name",(X)) 39 | #define NMS_MOL_SET_TITLEP(M,X) (M)->setProp("_Name",std::string(X)) 40 | #define NMS_MOL_SET_ISRXN(M,X) (M)->setProp("isRxn",(X)?1:0) 41 | #define NMS_MOL_SET_ATOM_COORDS(M,A,C) NMRDKitMolSetAtomCoords(M,A,C) 42 | #define NMS_MOL_SET_ATOM_COORDSF(M,A,C) NMRDKitMolSetAtomCoordsF(M,A,C) 43 | 44 | #define NMS_MOL_GET_ATOM_COORDS(M,A,C) NMRDKitMolGetAtomCoords(M,A,C) 45 | #define NMS_MOL_GET_ATOM_COORDSF(M,A,C) NMRDKitMolGetAtomCoordsF(M,A,C) 46 | #define NMS_MOL_GET_DIMENSION(M) NMRDKitMolGetDimension(M) 47 | #define NMS_MOL_GET_ISRXN(M) NMRDKitMolGetIsRxn(M) 48 | #define NMS_MOL_GET_MAXATOMIDX(M) (M)->getNumAtoms() 49 | #define NMS_MOL_GET_MAXBONDIDX(M) (M)->getNumBonds() 50 | #define NMS_MOL_GET_NUMATOMS(M) (M)->getNumAtoms() 51 | #define NMS_MOL_GET_NUMBONDS(M) (M)->getNumBonds() 52 | #define NMS_MOL_GET_TITLE(M) NMRDKitMolGetTitle(M) 53 | 54 | #define NMS_MOL_ADD_MOL(D,S) NMRDKitMolInsert(D,S) 55 | #define NMS_MOL_CLEAR(M) NMRDKitMolClear(M) 56 | #define NMS_MOL_COPY_TITLE(D,S) NMRDKitMolCopyTitle(D,S) 57 | #define NMS_MOL_DELETE_ATOM(M,A) (M)->removeAtom(A) 58 | #define NMS_MOL_DELETE_BOND(M,B) \ 59 | (M)->removeBond((B)->getBeginAtomIdx(),(B)->getEndAtomIdx()) 60 | #define NMS_MOL_NEW_ATOM(X,Y) NMRDKitMolNewAtom((X),(Y)) 61 | #define NMS_MOL_NEW_BOND(M,B,E,O,A) NMRDKitMolNewBond((M),(B),(E),(O),(A)) 62 | #define NMS_MOL_NONEMPTY(M) ((M)->getNumAtoms()>0) 63 | #define NMS_MOL_ASSIGN_RADICALS(M) RDKit::MolOps::assignRadicals(*(M)); 64 | #define NMS_MOL_SUPPRESS_HYDROGENS(M) RDKit::MolOps::removeHs(*(M)) 65 | #define NMS_MOL_SPLIT_INTO_FRAGMENTS(M, N) NMRDKitMolSplitFragments(M, N) 66 | #define NMS_MOL_CALCULATE_RINGINFO(M) NMRDKitMolCalculateRingInfo(M); 67 | 68 | #define NMS_ATOM_SET_ATOMICNUM(A,X) (A)->setAtomicNum(X) 69 | #define NMS_ATOM_SET_FORMALCHARGE(A,X) (A)->setFormalCharge(X) 70 | #define NMS_ATOM_SET_IMPLICITHCOUNT(A,X) NMRDKitAtomSetImplicitHCount(A,X) 71 | #define NMS_ATOM_SET_RADICALCOUNT(A,X) (A)->setNumRadicalElectrons(X) 72 | #define NMS_ATOM_SET_ISOTOPE(A,X) (A)->setIsotope(X) 73 | #define NMS_ATOM_SET_ALIAS(A,X) (A)->setProp("molFileAlias",(X)) 74 | #define NMS_ATOM_SET_ALIASP(A,X) (A)->setProp("molFileAlias",\ 75 | std::string(X)) 76 | #define NMS_ATOM_SET_MAPIDX(A,X) NMRDKitAtomSetMapIdx(A,X) 77 | #define NMS_ATOM_SET_RXNROLE(A,X) (A)->setProp("molRxnRole",(int)(X)) 78 | #define NMS_ATOM_SET_RXNGROUP(A,X) (A)->setProp("molRxnComponent",(int)(X)) 79 | #define NMS_ATOM_SET_IS_AROMATIC(A,X) (A)->setIsAromatic(X) 80 | #define NMS_ATOM_IS_IN_RING(X) RDKit::queryIsAtomInRing(X) 81 | 82 | #define NMS_ATOM_GET_ATOMICNUM(A) (A)->getAtomicNum() 83 | #define NMS_ATOM_GET_BOND(A,B) \ 84 | (A)->getOwningMol().getBondBetweenAtoms((A)->getIdx(),(B)->getIdx()) 85 | #define NMS_ATOM_GET_EXPLICITDEGREE(A) (A)->getDegree() 86 | #define NMS_ATOM_GET_EXPLICITVALENCE(A) NMRDKitAtomGetExplicitValence(A) 87 | #define NMS_ATOM_GET_VALENCE(A) (A)->getTotalValence() 88 | #define NMS_ATOM_GET_FORMALCHARGE(A) (A)->getFormalCharge() 89 | #define NMS_ATOM_GET_IDX(A) (A)->getIdx() 90 | #define NMS_ATOM_GET_IMPLICITHCOUNT(A) (A)->getTotalNumHs(false) 91 | #define NMS_ATOM_GET_RADICALCOUNT(A) (A)->getNumRadicalElectrons() 92 | #define NMS_ATOM_GET_ISOTOPE(A) (A)->getIsotope() 93 | #define NMS_ATOM_GET_MAPIDX(A) NMRDKitAtomGetMapIdx(A) 94 | #define NMS_ATOM_GET_TOTALHCOUNT(A) (A)->getTotalNumHs(true) 95 | #define NMS_ATOM_IS_CONNECTED(A, B) NMRDKitAtomIsConnected(A, B) 96 | #define NMS_ATOM_IS_AROMATIC(A) (A)->getIsAromatic() 97 | #define NMS_ATOM_HAS_STEREO(A) ((A)->getChiralTag() != RDKit::Atom::CHI_UNSPECIFIED) 98 | #define NMS_ATOM_REMOVE_STEREO(A) (A)->setChiralTag(RDKit::Atom::CHI_UNSPECIFIED) 99 | 100 | #define NMS_BOND_SET_ORDER(B,O) NMRDKitBondSetOrder(B,O) 101 | #define NMS_BOND_SET_WEDGE(B) (B)->setBondDir(RDKit::Bond::BEGINWEDGE) 102 | #define NMS_BOND_SET_HASH(B) (B)->setBondDir(RDKit::Bond::BEGINDASH) 103 | 104 | #define NMS_BOND_GET_BEG(B) (B)->getBeginAtom() 105 | #define NMS_BOND_GET_BEGIDX(B) (B)->getBeginAtomIdx() 106 | #define NMS_BOND_GET_END(B) (B)->getEndAtom() 107 | #define NMS_BOND_GET_ENDIDX(B) (B)->getEndAtomIdx() 108 | #define NMS_BOND_GET_IDX(B) (B)->getIdx() 109 | #define NMS_BOND_GET_NBR(B,A) (B)->getOtherAtom(A) 110 | #define NMS_BOND_GET_ORDER(B) NMRDKitBondGetOrder(B) 111 | #define NMS_BOND_IS_AROMATIC(B) \ 112 | ((B)->getBondType() == RDKit::Bond::AROMATIC) 113 | #define NMS_BOND_IS_DOUBLE(B) \ 114 | ((B)->getBondType() == RDKit::Bond::DOUBLE) 115 | #define NMS_BOND_IS_IN_RING(X) RDKit::queryIsBondInRing(X) 116 | #define NMS_BOND_HAS_STEREO(B) ((B)->getStereo() > RDKit::Bond::STEREOANY) 117 | #define NMS_BOND_REMOVE_STEREO(B) (B)->setStereo(RDKit::Bond::STEREOANY) 118 | 119 | 120 | #define NMS_FOR_ATOM_IN_MOL(X,Y) \ 121 | for (RDKit::RWMol::AtomIterator X=(Y)->beginAtoms();X!=(Y)->endAtoms();++X) 122 | #define NMS_ITER_MOL_ATOM(X,Y) (*(X)) 123 | #define NMS_FOR_BOND_IN_MOL(X,Y) \ 124 | for (RDKit::RWMol::BondIterator X=(Y)->beginBonds();X!=(Y)->endBonds();++X) 125 | #define NMS_ITER_MOL_BOND(X,Y) (*(X)) 126 | 127 | #define NMS_FOR_BOND_OF_ATOM(X,Y) \ 128 | RDKit::ROMol::OEDGE_ITER X##_beg, X##_end; \ 129 | for (boost::tie(X##_beg,X##_end) = Y->getOwningMol().getAtomBonds(Y); \ 130 | X##_beg != X##_end; ++X##_beg) 131 | #define NMS_ITER_ATOM_BOND(X,Y) \ 132 | NMS_RDKIT_ITER_TO_BOND(Y->getOwningMol(),*X##_beg) 133 | 134 | #define NMS_FOR_NBR_OF_ATOM(X,Y) \ 135 | RDKit::ROMol::ADJ_ITER X##_beg, X##_end; \ 136 | for (boost::tie(X##_beg,X##_end) = Y->getOwningMol().getAtomNeighbors(Y); \ 137 | X##_beg != X##_end; ++X##_beg) 138 | #define NMS_ITER_ATOM_NBR(X,Y) \ 139 | NMS_RDKIT_ITER_TO_ATOM(Y->getOwningMol(),*X##_beg) 140 | 141 | 142 | #define NMS_GENERATE_SMILES(M,S) S = RDKit::MolToSmiles(*(M)); 143 | #define NMS_SMILES_TO_MOL(X) NMRDKitSmilesToMol(X) 144 | #define NMS_SANITIZE_HYDROGENS(M) NMRDKitSanitizeHydrogens(M) 145 | 146 | 147 | /* Implemented in rdktoolkit.cpp */ 148 | RDKit::RWMol *NMRDKitSmilesToMol(const char *str); 149 | RDKit::Atom *NMRDKitMolNewAtom(RDKit::RWMol *mol, unsigned int elem); 150 | RDKit::Bond *NMRDKitMolNewBond(RDKit::RWMol *mol, 151 | RDKit::Atom *src, RDKit::Atom *dst, 152 | unsigned int order, bool arom); 153 | unsigned int NMRDKitAtomGetExplicitValence(RDKit::Atom *atm); 154 | unsigned int NMRDKitBondGetOrder(const RDKit::Bond *bnd); 155 | void NMRDKitAtomSetImplicitHCount(RDKit::Atom *atm, unsigned int hcount); 156 | void NMRDKitBondSetOrder(RDKit::Bond *bnd, unsigned int order); 157 | void NMRDKitSanitizeHydrogens(RDKit::RWMol *mol); 158 | void NMRDKitAtomSetMapIdx(RDKit::Atom *atm, unsigned int idx); 159 | void NMRDKitMolSplitFragments(NMS_pMOL mol, std::vector &fragments); 160 | void NMRDKitMolCalculateRingInfo(NMS_pMOL mol); 161 | std::string NMRDKitMolGetTitle(RDKit::RWMol *mol); 162 | 163 | #endif // NMS_RDKTOOLKIT_H 164 | 165 | -------------------------------------------------------------------------------- /docs/_images/regioisomer.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | -------------------------------------------------------------------------------- /molhash.cpp: -------------------------------------------------------------------------------- 1 | /*==============================================*/ 2 | /* Copyright (c) 2011-2019 NextMove Software */ 3 | /* */ 4 | /* This file is part of molhash. */ 5 | /* */ 6 | /* The contents are covered by the terms of the */ 7 | /* BSD license, which is included in the file */ 8 | /* license.txt. */ 9 | /*==============================================*/ 10 | #include 11 | #include 12 | 13 | #include "toolkit.h" 14 | #include "molhash.h" 15 | 16 | #ifdef _WIN32 17 | #define getc_unlocked _fgetc_nolock 18 | #endif 19 | 20 | static unsigned int hash_func = 0; 21 | static bool title_only = false; 22 | static bool all_flag = false; 23 | static const char *inpname; 24 | static const char *outname; 25 | 26 | #define MAXNORM 10 27 | static unsigned int normidx = 0; 28 | static unsigned int normalizations[MAXNORM] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 29 | 30 | static void ProcessComponent(NMS_pMOL mol, FILE *fp) 31 | { 32 | std::string title; 33 | std::string hash; 34 | std::string smi; 35 | 36 | if (!title_only) 37 | NMS_GENERATE_SMILES(mol, smi); 38 | 39 | hash = MolHash(mol, hash_func); 40 | 41 | fprintf(fp, "%s", hash.c_str()); 42 | if (!title_only) 43 | fprintf(fp, "\t%s", smi.c_str()); 44 | title = NMS_MOL_GET_TITLE(mol); 45 | if (!title.empty()) 46 | fprintf(fp, "\t%s", title.c_str()); 47 | fputc('\n', fp); 48 | } 49 | 50 | 51 | static void ProcessMolecule(NMS_pMOL mol, FILE *fp) 52 | { 53 | if (all_flag) 54 | ProcessComponent(mol, fp); 55 | else { 56 | std::vector vmol; 57 | SplitMolecule(mol, vmol); 58 | unsigned int largest = 0; 59 | unsigned int maxsize = 0; 60 | for(unsigned int i=0; i maxsize) { 63 | maxsize = NMS_MOL_GET_NUMATOMS(pmol); 64 | largest = i; 65 | } 66 | } 67 | ProcessComponent(NMS_MOL_TO_pMOL(*vmol[largest]), fp); 68 | for (unsigned int i = 0; i < vmol.size(); ++i) 69 | delete vmol[i]; 70 | } 71 | } 72 | 73 | 74 | /* Read a line, returning first n characters */ 75 | static bool SWReadLine2(FILE *fp, char *buffer, unsigned int n) 76 | { 77 | char *end = buffer + n; 78 | char *ptr; 79 | int ch; 80 | 81 | ptr = buffer; 82 | do { 83 | ch = getc_unlocked(fp); 84 | if (ch == '\n') { 85 | *ptr = '\0'; 86 | return true; 87 | } 88 | if (ch == '\r') { 89 | *ptr = '\0'; 90 | ch = getc_unlocked(fp); 91 | if (ch != '\n') { 92 | if (ch == -1) 93 | return false; 94 | ungetc(ch, fp); 95 | } 96 | return true; 97 | } 98 | if (ch == -1) { 99 | *ptr = '\0'; 100 | return false; 101 | } 102 | *ptr++ = ch; 103 | } while (ptr < end); 104 | *ptr = 0; 105 | 106 | /* skip to the end of the line! */ 107 | for (;;) { 108 | ch = getc_unlocked(fp); 109 | if (ch == '\n') 110 | return true; 111 | if (ch == '\r') { 112 | ch = getc_unlocked(fp); 113 | if (ch != '\n') { 114 | if (ch == -1) 115 | return false; 116 | ungetc(ch, fp); 117 | } 118 | return true; 119 | } 120 | if (ch == -1) 121 | return false; 122 | } 123 | } 124 | 125 | static void ProcessFile(FILE *ifp, FILE *ofp) 126 | { 127 | char buffer[8192]; 128 | while (SWReadLine2(ifp, buffer, 8190)) { 129 | NMS_MOL* mol = NMS_SMILES_TO_MOL(buffer); 130 | if (mol != (NMS_MOL*)0) { 131 | NMS_pMOL pmol = NMS_MOL_TO_pMOL(*mol); 132 | for (unsigned int i=0; i []\n",stderr); 185 | fputs(" Use a hyphen for to read from stdin\n",stderr); 186 | fputs("options:\n", stderr); 187 | fputs(" -a Process all the molecule (and not just the single largest component)\n", stderr); 188 | fputs(" -sa Suppress atom stereo\n", stderr); 189 | fputs(" -sb Suppress bond stereo\n", stderr); 190 | fputs(" -sh Suppress explicit hydrogens\n", stderr); 191 | fputs(" -si Suppress isotopes\n", stderr); 192 | fputs(" -sm Suppress atom maps\n", stderr); 193 | fputs(" -t Store titles only\n",stderr); 194 | fputs("hash type:\n", stderr); 195 | DisplayHashOptions(); 196 | exit(1); 197 | } 198 | 199 | static void ProcessCommandLine(int argc, char *argv[]) 200 | { 201 | const char *ptr; 202 | int i,j; 203 | 204 | inpname = (const char*)0; 205 | outname = (const char*)0; 206 | title_only = false; 207 | all_flag = false; 208 | hash_func = 0; 209 | 210 | j = 0; 211 | for (i=1; i 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | molhash application — MolHash 1.0 documentation 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 |
46 | 47 | 48 | 107 | 108 |
109 | 110 | 111 | 117 | 118 | 119 |
120 | 121 |
122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
140 | 141 |
    142 | 143 |
  • Docs »
  • 144 | 145 |
  • molhash application
  • 146 | 147 | 148 |
  • 149 | 150 | 151 | 152 |
  • 153 | 154 |
155 | 156 | 157 |
158 |
159 |
160 |
161 | 162 |
163 |

molhash application

164 |

The command-line application molhash can be used to generate one of a number of molecular hashes.

165 |
166 |

Usage

167 |
    168 |
  • molhash [options] <infile> [<outfile>]
  • 169 |
  • molhash [options] - [<outfile>] - read from standard input
  • 170 |
171 |

For example:

172 |
$ echo "c1ccccc1C(=O)Cl" | molhash -mf -
173 | C7H5ClO c1ccc(cc1)C(=O)Cl
174 | 
175 |
176 |
177 |
178 |

Options

179 | 180 | 181 | 182 | 183 | 185 | 186 | 188 | 189 | 191 | 192 | 194 | 195 | 197 | 198 | 200 | 201 | 203 | 204 | 205 |
184 | -aProcess all the molecule (and not just the single largest component)
187 | -saSuppress atom stereo
190 | -sbSuppress bond stereo
193 | -shSuppress explicit hydrogens
196 | -siSuppress isotopes
199 | -smSuppress atom maps
202 | -tStore titles only
206 |

Hash Types

207 | 208 | 209 | 210 | 211 | 213 | 214 | 216 | 217 | 219 | 220 | 222 | 223 | 225 | 226 | 228 | 229 | 231 | 232 | 234 | 235 | 237 | 238 | 240 | 241 | 242 |
212 | -ganonymous graph [default]
215 | -eelement graph
218 | -scanonical smiles
221 | -mMurcko scaffold
224 | -mfmolecular formula
227 | -memesomer
230 | -hthetatom tautomer
233 | -hphetatom protomer
236 | -rpredox-pair
239 | -riregioisomer
243 |
244 |
245 | 246 | 247 |
248 | 249 |
250 |
251 | 252 | 258 | 259 | 260 |
261 | 262 |
263 |

264 | © Copyright 2015-2019, NextMove Software. 265 | 266 |

267 |
268 | 269 |
270 | 271 |
272 |
273 | 274 |
275 | 276 |
277 | 278 | 279 | 280 | 281 | 282 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 311 | 312 | 313 | -------------------------------------------------------------------------------- /docs/_static/doctools.js: -------------------------------------------------------------------------------- 1 | /* 2 | * doctools.js 3 | * ~~~~~~~~~~~ 4 | * 5 | * Sphinx JavaScript utilities for all documentation. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /** 13 | * select a different prefix for underscore 14 | */ 15 | $u = _.noConflict(); 16 | 17 | /** 18 | * make the code below compatible with browsers without 19 | * an installed firebug like debugger 20 | if (!window.console || !console.firebug) { 21 | var names = ["log", "debug", "info", "warn", "error", "assert", "dir", 22 | "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", 23 | "profile", "profileEnd"]; 24 | window.console = {}; 25 | for (var i = 0; i < names.length; ++i) 26 | window.console[names[i]] = function() {}; 27 | } 28 | */ 29 | 30 | /** 31 | * small helper function to urldecode strings 32 | */ 33 | jQuery.urldecode = function(x) { 34 | return decodeURIComponent(x).replace(/\+/g, ' '); 35 | }; 36 | 37 | /** 38 | * small helper function to urlencode strings 39 | */ 40 | jQuery.urlencode = encodeURIComponent; 41 | 42 | /** 43 | * This function returns the parsed url parameters of the 44 | * current request. Multiple values per key are supported, 45 | * it will always return arrays of strings for the value parts. 46 | */ 47 | jQuery.getQueryParameters = function(s) { 48 | if (typeof s === 'undefined') 49 | s = document.location.search; 50 | var parts = s.substr(s.indexOf('?') + 1).split('&'); 51 | var result = {}; 52 | for (var i = 0; i < parts.length; i++) { 53 | var tmp = parts[i].split('=', 2); 54 | var key = jQuery.urldecode(tmp[0]); 55 | var value = jQuery.urldecode(tmp[1]); 56 | if (key in result) 57 | result[key].push(value); 58 | else 59 | result[key] = [value]; 60 | } 61 | return result; 62 | }; 63 | 64 | /** 65 | * highlight a given string on a jquery object by wrapping it in 66 | * span elements with the given class name. 67 | */ 68 | jQuery.fn.highlightText = function(text, className) { 69 | function highlight(node, addItems) { 70 | if (node.nodeType === 3) { 71 | var val = node.nodeValue; 72 | var pos = val.toLowerCase().indexOf(text); 73 | if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { 74 | var span; 75 | var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); 76 | if (isInSVG) { 77 | span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); 78 | } else { 79 | span = document.createElement("span"); 80 | span.className = className; 81 | } 82 | span.appendChild(document.createTextNode(val.substr(pos, text.length))); 83 | node.parentNode.insertBefore(span, node.parentNode.insertBefore( 84 | document.createTextNode(val.substr(pos + text.length)), 85 | node.nextSibling)); 86 | node.nodeValue = val.substr(0, pos); 87 | if (isInSVG) { 88 | var bbox = span.getBBox(); 89 | var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); 90 | rect.x.baseVal.value = bbox.x; 91 | rect.y.baseVal.value = bbox.y; 92 | rect.width.baseVal.value = bbox.width; 93 | rect.height.baseVal.value = bbox.height; 94 | rect.setAttribute('class', className); 95 | var parentOfText = node.parentNode.parentNode; 96 | addItems.push({ 97 | "parent": node.parentNode, 98 | "target": rect}); 99 | } 100 | } 101 | } 102 | else if (!jQuery(node).is("button, select, textarea")) { 103 | jQuery.each(node.childNodes, function() { 104 | highlight(this, addItems); 105 | }); 106 | } 107 | } 108 | var addItems = []; 109 | var result = this.each(function() { 110 | highlight(this, addItems); 111 | }); 112 | for (var i = 0; i < addItems.length; ++i) { 113 | jQuery(addItems[i].parent).before(addItems[i].target); 114 | } 115 | return result; 116 | }; 117 | 118 | /* 119 | * backward compatibility for jQuery.browser 120 | * This will be supported until firefox bug is fixed. 121 | */ 122 | if (!jQuery.browser) { 123 | jQuery.uaMatch = function(ua) { 124 | ua = ua.toLowerCase(); 125 | 126 | var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || 127 | /(webkit)[ \/]([\w.]+)/.exec(ua) || 128 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || 129 | /(msie) ([\w.]+)/.exec(ua) || 130 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || 131 | []; 132 | 133 | return { 134 | browser: match[ 1 ] || "", 135 | version: match[ 2 ] || "0" 136 | }; 137 | }; 138 | jQuery.browser = {}; 139 | jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; 140 | } 141 | 142 | /** 143 | * Small JavaScript module for the documentation. 144 | */ 145 | var Documentation = { 146 | 147 | init : function() { 148 | this.fixFirefoxAnchorBug(); 149 | this.highlightSearchWords(); 150 | this.initIndexTable(); 151 | 152 | }, 153 | 154 | /** 155 | * i18n support 156 | */ 157 | TRANSLATIONS : {}, 158 | PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, 159 | LOCALE : 'unknown', 160 | 161 | // gettext and ngettext don't access this so that the functions 162 | // can safely bound to a different name (_ = Documentation.gettext) 163 | gettext : function(string) { 164 | var translated = Documentation.TRANSLATIONS[string]; 165 | if (typeof translated === 'undefined') 166 | return string; 167 | return (typeof translated === 'string') ? translated : translated[0]; 168 | }, 169 | 170 | ngettext : function(singular, plural, n) { 171 | var translated = Documentation.TRANSLATIONS[singular]; 172 | if (typeof translated === 'undefined') 173 | return (n == 1) ? singular : plural; 174 | return translated[Documentation.PLURALEXPR(n)]; 175 | }, 176 | 177 | addTranslations : function(catalog) { 178 | for (var key in catalog.messages) 179 | this.TRANSLATIONS[key] = catalog.messages[key]; 180 | this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); 181 | this.LOCALE = catalog.locale; 182 | }, 183 | 184 | /** 185 | * add context elements like header anchor links 186 | */ 187 | addContextElements : function() { 188 | $('div[id] > :header:first').each(function() { 189 | $('\u00B6'). 190 | attr('href', '#' + this.id). 191 | attr('title', _('Permalink to this headline')). 192 | appendTo(this); 193 | }); 194 | $('dt[id]').each(function() { 195 | $('\u00B6'). 196 | attr('href', '#' + this.id). 197 | attr('title', _('Permalink to this definition')). 198 | appendTo(this); 199 | }); 200 | }, 201 | 202 | /** 203 | * workaround a firefox stupidity 204 | * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 205 | */ 206 | fixFirefoxAnchorBug : function() { 207 | if (document.location.hash && $.browser.mozilla) 208 | window.setTimeout(function() { 209 | document.location.href += ''; 210 | }, 10); 211 | }, 212 | 213 | /** 214 | * highlight the search words provided in the url in the text 215 | */ 216 | highlightSearchWords : function() { 217 | var params = $.getQueryParameters(); 218 | var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; 219 | if (terms.length) { 220 | var body = $('div.body'); 221 | if (!body.length) { 222 | body = $('body'); 223 | } 224 | window.setTimeout(function() { 225 | $.each(terms, function() { 226 | body.highlightText(this.toLowerCase(), 'highlighted'); 227 | }); 228 | }, 10); 229 | $('') 231 | .appendTo($('#searchbox')); 232 | } 233 | }, 234 | 235 | /** 236 | * init the domain index toggle buttons 237 | */ 238 | initIndexTable : function() { 239 | var togglers = $('img.toggler').click(function() { 240 | var src = $(this).attr('src'); 241 | var idnum = $(this).attr('id').substr(7); 242 | $('tr.cg-' + idnum).toggle(); 243 | if (src.substr(-9) === 'minus.png') 244 | $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); 245 | else 246 | $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); 247 | }).css('display', ''); 248 | if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { 249 | togglers.click(); 250 | } 251 | }, 252 | 253 | /** 254 | * helper function to hide the search marks again 255 | */ 256 | hideSearchWords : function() { 257 | $('#searchbox .highlight-link').fadeOut(300); 258 | $('span.highlighted').removeClass('highlighted'); 259 | }, 260 | 261 | /** 262 | * make the url absolute 263 | */ 264 | makeURL : function(relativeURL) { 265 | return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; 266 | }, 267 | 268 | /** 269 | * get the current relative url 270 | */ 271 | getCurrentURL : function() { 272 | var path = document.location.pathname; 273 | var parts = path.split(/\//); 274 | $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { 275 | if (this === '..') 276 | parts.pop(); 277 | }); 278 | var url = parts.join('/'); 279 | return path.substring(url.lastIndexOf('/') + 1, path.length - 1); 280 | }, 281 | 282 | initOnKeyListeners: function() { 283 | $(document).keyup(function(event) { 284 | var activeElementType = document.activeElement.tagName; 285 | // don't navigate when in search box or textarea 286 | if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { 287 | switch (event.keyCode) { 288 | case 37: // left 289 | var prevHref = $('link[rel="prev"]').prop('href'); 290 | if (prevHref) { 291 | window.location.href = prevHref; 292 | return false; 293 | } 294 | case 39: // right 295 | var nextHref = $('link[rel="next"]').prop('href'); 296 | if (nextHref) { 297 | window.location.href = nextHref; 298 | return false; 299 | } 300 | } 301 | } 302 | }); 303 | } 304 | }; 305 | 306 | // quick alias for translations 307 | _ = Documentation.gettext; 308 | 309 | $(document).ready(function() { 310 | Documentation.init(); 311 | }); -------------------------------------------------------------------------------- /docs/_images/mesomer-hash-2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /docs/_images/mesomer-hash-1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Generated by the Chemistry Development Kit (http://github.com/cdk) 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /docs/_static/underscore.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.3.1 2 | // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. 3 | // Underscore is freely distributable under the MIT license. 4 | // Portions of Underscore are inspired or borrowed from Prototype, 5 | // Oliver Steele's Functional, and John Resig's Micro-Templating. 6 | // For all details and documentation: 7 | // http://documentcloud.github.com/underscore 8 | (function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== 9 | c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, 10 | h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= 11 | b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== 12 | null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= 13 | function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= 14 | e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= 15 | function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, 17 | c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; 24 | b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, 25 | 1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; 26 | b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; 27 | b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), 28 | function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ 29 | u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= 30 | function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= 31 | true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); 32 | -------------------------------------------------------------------------------- /docs/_static/basic.css: -------------------------------------------------------------------------------- 1 | /* 2 | * basic.css 3 | * ~~~~~~~~~ 4 | * 5 | * Sphinx stylesheet -- basic theme. 6 | * 7 | * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. 8 | * :license: BSD, see LICENSE for details. 9 | * 10 | */ 11 | 12 | /* -- main layout ----------------------------------------------------------- */ 13 | 14 | div.clearer { 15 | clear: both; 16 | } 17 | 18 | /* -- relbar ---------------------------------------------------------------- */ 19 | 20 | div.related { 21 | width: 100%; 22 | font-size: 90%; 23 | } 24 | 25 | div.related h3 { 26 | display: none; 27 | } 28 | 29 | div.related ul { 30 | margin: 0; 31 | padding: 0 0 0 10px; 32 | list-style: none; 33 | } 34 | 35 | div.related li { 36 | display: inline; 37 | } 38 | 39 | div.related li.right { 40 | float: right; 41 | margin-right: 5px; 42 | } 43 | 44 | /* -- sidebar --------------------------------------------------------------- */ 45 | 46 | div.sphinxsidebarwrapper { 47 | padding: 10px 5px 0 10px; 48 | } 49 | 50 | div.sphinxsidebar { 51 | float: left; 52 | width: 230px; 53 | margin-left: -100%; 54 | font-size: 90%; 55 | word-wrap: break-word; 56 | overflow-wrap : break-word; 57 | } 58 | 59 | div.sphinxsidebar ul { 60 | list-style: none; 61 | } 62 | 63 | div.sphinxsidebar ul ul, 64 | div.sphinxsidebar ul.want-points { 65 | margin-left: 20px; 66 | list-style: square; 67 | } 68 | 69 | div.sphinxsidebar ul ul { 70 | margin-top: 0; 71 | margin-bottom: 0; 72 | } 73 | 74 | div.sphinxsidebar form { 75 | margin-top: 10px; 76 | } 77 | 78 | div.sphinxsidebar input { 79 | border: 1px solid #98dbcc; 80 | font-family: sans-serif; 81 | font-size: 1em; 82 | } 83 | 84 | div.sphinxsidebar #searchbox input[type="text"] { 85 | float: left; 86 | width: 80%; 87 | padding: 0.25em; 88 | box-sizing: border-box; 89 | } 90 | 91 | div.sphinxsidebar #searchbox input[type="submit"] { 92 | float: left; 93 | width: 20%; 94 | border-left: none; 95 | padding: 0.25em; 96 | box-sizing: border-box; 97 | } 98 | 99 | 100 | img { 101 | border: 0; 102 | max-width: 100%; 103 | } 104 | 105 | /* -- search page ----------------------------------------------------------- */ 106 | 107 | ul.search { 108 | margin: 10px 0 0 20px; 109 | padding: 0; 110 | } 111 | 112 | ul.search li { 113 | padding: 5px 0 5px 20px; 114 | background-image: url(file.png); 115 | background-repeat: no-repeat; 116 | background-position: 0 7px; 117 | } 118 | 119 | ul.search li a { 120 | font-weight: bold; 121 | } 122 | 123 | ul.search li div.context { 124 | color: #888; 125 | margin: 2px 0 0 30px; 126 | text-align: left; 127 | } 128 | 129 | ul.keywordmatches li.goodmatch a { 130 | font-weight: bold; 131 | } 132 | 133 | /* -- index page ------------------------------------------------------------ */ 134 | 135 | table.contentstable { 136 | width: 90%; 137 | margin-left: auto; 138 | margin-right: auto; 139 | } 140 | 141 | table.contentstable p.biglink { 142 | line-height: 150%; 143 | } 144 | 145 | a.biglink { 146 | font-size: 1.3em; 147 | } 148 | 149 | span.linkdescr { 150 | font-style: italic; 151 | padding-top: 5px; 152 | font-size: 90%; 153 | } 154 | 155 | /* -- general index --------------------------------------------------------- */ 156 | 157 | table.indextable { 158 | width: 100%; 159 | } 160 | 161 | table.indextable td { 162 | text-align: left; 163 | vertical-align: top; 164 | } 165 | 166 | table.indextable ul { 167 | margin-top: 0; 168 | margin-bottom: 0; 169 | list-style-type: none; 170 | } 171 | 172 | table.indextable > tbody > tr > td > ul { 173 | padding-left: 0em; 174 | } 175 | 176 | table.indextable tr.pcap { 177 | height: 10px; 178 | } 179 | 180 | table.indextable tr.cap { 181 | margin-top: 10px; 182 | background-color: #f2f2f2; 183 | } 184 | 185 | img.toggler { 186 | margin-right: 3px; 187 | margin-top: 3px; 188 | cursor: pointer; 189 | } 190 | 191 | div.modindex-jumpbox { 192 | border-top: 1px solid #ddd; 193 | border-bottom: 1px solid #ddd; 194 | margin: 1em 0 1em 0; 195 | padding: 0.4em; 196 | } 197 | 198 | div.genindex-jumpbox { 199 | border-top: 1px solid #ddd; 200 | border-bottom: 1px solid #ddd; 201 | margin: 1em 0 1em 0; 202 | padding: 0.4em; 203 | } 204 | 205 | /* -- domain module index --------------------------------------------------- */ 206 | 207 | table.modindextable td { 208 | padding: 2px; 209 | border-collapse: collapse; 210 | } 211 | 212 | /* -- general body styles --------------------------------------------------- */ 213 | 214 | div.body { 215 | min-width: 450px; 216 | max-width: 800px; 217 | } 218 | 219 | div.body p, div.body dd, div.body li, div.body blockquote { 220 | -moz-hyphens: auto; 221 | -ms-hyphens: auto; 222 | -webkit-hyphens: auto; 223 | hyphens: auto; 224 | } 225 | 226 | a.headerlink { 227 | visibility: hidden; 228 | } 229 | 230 | h1:hover > a.headerlink, 231 | h2:hover > a.headerlink, 232 | h3:hover > a.headerlink, 233 | h4:hover > a.headerlink, 234 | h5:hover > a.headerlink, 235 | h6:hover > a.headerlink, 236 | dt:hover > a.headerlink, 237 | caption:hover > a.headerlink, 238 | p.caption:hover > a.headerlink, 239 | div.code-block-caption:hover > a.headerlink { 240 | visibility: visible; 241 | } 242 | 243 | div.body p.caption { 244 | text-align: inherit; 245 | } 246 | 247 | div.body td { 248 | text-align: left; 249 | } 250 | 251 | .first { 252 | margin-top: 0 !important; 253 | } 254 | 255 | p.rubric { 256 | margin-top: 30px; 257 | font-weight: bold; 258 | } 259 | 260 | img.align-left, .figure.align-left, object.align-left { 261 | clear: left; 262 | float: left; 263 | margin-right: 1em; 264 | } 265 | 266 | img.align-right, .figure.align-right, object.align-right { 267 | clear: right; 268 | float: right; 269 | margin-left: 1em; 270 | } 271 | 272 | img.align-center, .figure.align-center, object.align-center { 273 | display: block; 274 | margin-left: auto; 275 | margin-right: auto; 276 | } 277 | 278 | .align-left { 279 | text-align: left; 280 | } 281 | 282 | .align-center { 283 | text-align: center; 284 | } 285 | 286 | .align-right { 287 | text-align: right; 288 | } 289 | 290 | /* -- sidebars -------------------------------------------------------------- */ 291 | 292 | div.sidebar { 293 | margin: 0 0 0.5em 1em; 294 | border: 1px solid #ddb; 295 | padding: 7px 7px 0 7px; 296 | background-color: #ffe; 297 | width: 40%; 298 | float: right; 299 | } 300 | 301 | p.sidebar-title { 302 | font-weight: bold; 303 | } 304 | 305 | /* -- topics ---------------------------------------------------------------- */ 306 | 307 | div.topic { 308 | border: 1px solid #ccc; 309 | padding: 7px 7px 0 7px; 310 | margin: 10px 0 10px 0; 311 | } 312 | 313 | p.topic-title { 314 | font-size: 1.1em; 315 | font-weight: bold; 316 | margin-top: 10px; 317 | } 318 | 319 | /* -- admonitions ----------------------------------------------------------- */ 320 | 321 | div.admonition { 322 | margin-top: 10px; 323 | margin-bottom: 10px; 324 | padding: 7px; 325 | } 326 | 327 | div.admonition dt { 328 | font-weight: bold; 329 | } 330 | 331 | div.admonition dl { 332 | margin-bottom: 0; 333 | } 334 | 335 | p.admonition-title { 336 | margin: 0px 10px 5px 0px; 337 | font-weight: bold; 338 | } 339 | 340 | div.body p.centered { 341 | text-align: center; 342 | margin-top: 25px; 343 | } 344 | 345 | /* -- tables ---------------------------------------------------------------- */ 346 | 347 | table.docutils { 348 | border: 0; 349 | border-collapse: collapse; 350 | } 351 | 352 | table.align-center { 353 | margin-left: auto; 354 | margin-right: auto; 355 | } 356 | 357 | table caption span.caption-number { 358 | font-style: italic; 359 | } 360 | 361 | table caption span.caption-text { 362 | } 363 | 364 | table.docutils td, table.docutils th { 365 | padding: 1px 8px 1px 5px; 366 | border-top: 0; 367 | border-left: 0; 368 | border-right: 0; 369 | border-bottom: 1px solid #aaa; 370 | } 371 | 372 | table.footnote td, table.footnote th { 373 | border: 0 !important; 374 | } 375 | 376 | th { 377 | text-align: left; 378 | padding-right: 5px; 379 | } 380 | 381 | table.citation { 382 | border-left: solid 1px gray; 383 | margin-left: 1px; 384 | } 385 | 386 | table.citation td { 387 | border-bottom: none; 388 | } 389 | 390 | /* -- figures --------------------------------------------------------------- */ 391 | 392 | div.figure { 393 | margin: 0.5em; 394 | padding: 0.5em; 395 | } 396 | 397 | div.figure p.caption { 398 | padding: 0.3em; 399 | } 400 | 401 | div.figure p.caption span.caption-number { 402 | font-style: italic; 403 | } 404 | 405 | div.figure p.caption span.caption-text { 406 | } 407 | 408 | /* -- field list styles ----------------------------------------------------- */ 409 | 410 | table.field-list td, table.field-list th { 411 | border: 0 !important; 412 | } 413 | 414 | .field-list ul { 415 | margin: 0; 416 | padding-left: 1em; 417 | } 418 | 419 | .field-list p { 420 | margin: 0; 421 | } 422 | 423 | .field-name { 424 | -moz-hyphens: manual; 425 | -ms-hyphens: manual; 426 | -webkit-hyphens: manual; 427 | hyphens: manual; 428 | } 429 | 430 | /* -- other body styles ----------------------------------------------------- */ 431 | 432 | ol.arabic { 433 | list-style: decimal; 434 | } 435 | 436 | ol.loweralpha { 437 | list-style: lower-alpha; 438 | } 439 | 440 | ol.upperalpha { 441 | list-style: upper-alpha; 442 | } 443 | 444 | ol.lowerroman { 445 | list-style: lower-roman; 446 | } 447 | 448 | ol.upperroman { 449 | list-style: upper-roman; 450 | } 451 | 452 | dl { 453 | margin-bottom: 15px; 454 | } 455 | 456 | dd p { 457 | margin-top: 0px; 458 | } 459 | 460 | dd ul, dd table { 461 | margin-bottom: 10px; 462 | } 463 | 464 | dd { 465 | margin-top: 3px; 466 | margin-bottom: 10px; 467 | margin-left: 30px; 468 | } 469 | 470 | dt:target, span.highlighted { 471 | background-color: #fbe54e; 472 | } 473 | 474 | rect.highlighted { 475 | fill: #fbe54e; 476 | } 477 | 478 | dl.glossary dt { 479 | font-weight: bold; 480 | font-size: 1.1em; 481 | } 482 | 483 | .optional { 484 | font-size: 1.3em; 485 | } 486 | 487 | .sig-paren { 488 | font-size: larger; 489 | } 490 | 491 | .versionmodified { 492 | font-style: italic; 493 | } 494 | 495 | .system-message { 496 | background-color: #fda; 497 | padding: 5px; 498 | border: 3px solid red; 499 | } 500 | 501 | .footnote:target { 502 | background-color: #ffa; 503 | } 504 | 505 | .line-block { 506 | display: block; 507 | margin-top: 1em; 508 | margin-bottom: 1em; 509 | } 510 | 511 | .line-block .line-block { 512 | margin-top: 0; 513 | margin-bottom: 0; 514 | margin-left: 1.5em; 515 | } 516 | 517 | .guilabel, .menuselection { 518 | font-family: sans-serif; 519 | } 520 | 521 | .accelerator { 522 | text-decoration: underline; 523 | } 524 | 525 | .classifier { 526 | font-style: oblique; 527 | } 528 | 529 | abbr, acronym { 530 | border-bottom: dotted 1px; 531 | cursor: help; 532 | } 533 | 534 | /* -- code displays --------------------------------------------------------- */ 535 | 536 | pre { 537 | overflow: auto; 538 | overflow-y: hidden; /* fixes display issues on Chrome browsers */ 539 | } 540 | 541 | span.pre { 542 | -moz-hyphens: none; 543 | -ms-hyphens: none; 544 | -webkit-hyphens: none; 545 | hyphens: none; 546 | } 547 | 548 | td.linenos pre { 549 | padding: 5px 0px; 550 | border: 0; 551 | background-color: transparent; 552 | color: #aaa; 553 | } 554 | 555 | table.highlighttable { 556 | margin-left: 0.5em; 557 | } 558 | 559 | table.highlighttable td { 560 | padding: 0 0.5em 0 0.5em; 561 | } 562 | 563 | div.code-block-caption { 564 | padding: 2px 5px; 565 | font-size: small; 566 | } 567 | 568 | div.code-block-caption code { 569 | background-color: transparent; 570 | } 571 | 572 | div.code-block-caption + div > div.highlight > pre { 573 | margin-top: 0; 574 | } 575 | 576 | div.code-block-caption span.caption-number { 577 | padding: 0.1em 0.3em; 578 | font-style: italic; 579 | } 580 | 581 | div.code-block-caption span.caption-text { 582 | } 583 | 584 | div.literal-block-wrapper { 585 | padding: 1em 1em 0; 586 | } 587 | 588 | div.literal-block-wrapper div.highlight { 589 | margin: 0; 590 | } 591 | 592 | code.descname { 593 | background-color: transparent; 594 | font-weight: bold; 595 | font-size: 1.2em; 596 | } 597 | 598 | code.descclassname { 599 | background-color: transparent; 600 | } 601 | 602 | code.xref, a code { 603 | background-color: transparent; 604 | font-weight: bold; 605 | } 606 | 607 | h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { 608 | background-color: transparent; 609 | } 610 | 611 | .viewcode-link { 612 | float: right; 613 | } 614 | 615 | .viewcode-back { 616 | float: right; 617 | font-family: sans-serif; 618 | } 619 | 620 | div.viewcode-block:target { 621 | margin: -1px -10px; 622 | padding: 0 10px; 623 | } 624 | 625 | /* -- math display ---------------------------------------------------------- */ 626 | 627 | img.math { 628 | vertical-align: middle; 629 | } 630 | 631 | div.body div.math p { 632 | text-align: center; 633 | } 634 | 635 | span.eqno { 636 | float: right; 637 | } 638 | 639 | span.eqno a.headerlink { 640 | position: relative; 641 | left: 0px; 642 | z-index: 1; 643 | } 644 | 645 | div.math:hover a.headerlink { 646 | visibility: visible; 647 | } 648 | 649 | /* -- printout stylesheet --------------------------------------------------- */ 650 | 651 | @media print { 652 | div.document, 653 | div.documentwrapper, 654 | div.bodywrapper { 655 | margin: 0 !important; 656 | width: 100%; 657 | } 658 | 659 | div.sphinxsidebar, 660 | div.related, 661 | div.footer, 662 | #top-link { 663 | display: none; 664 | } 665 | } --------------------------------------------------------------------------------