Is Tanimoto a metric?

preprint OA: closed CC-BY-ND-4.0
📄 Open PDF Full text JSON View at publisher
AI-generated deep summary by claude@2026-07, 2026-07-03 · read from full text

This note analyzes whether common molecular similarity indices—specifically Tanimoto, Russel-Rao, and Sokal-Michener—can be turned into valid metrics that satisfy the triangle inequality while remaining consistent with the original similarity rankings. Using general vector/fingerprint representations (including non-binary vectors in [0,1]), the authors prove the triangle inequality for Russel-Rao and Sokal-Michener but show that Tanimoto requires a more nuanced construction: they introduce a Tanimoto-based distance formula and demonstrate that a square-root transformation is necessary to obtain a proper metric consistent with Tanimoto similarity for the stated setting. They further evaluate ranking consistency by computing Kendall Tau correlations among these indices across all possible combinations for 2048-bit binary fingerprints. A key caveat is that previously cited triangle-inequality proofs for Tanimoto apply only to binary fingerprints, and their new argument targets the specified vector range rather than guaranteeing validity under all possible representations. The paper does not explicitly discuss endometriosis or adenomyosis; it was included in the corpus via a keyword match in the upstream search index.

Read from the paper's body, not the abstract. Not a substitute for reading the paper. No clinical advice. How this works

Abstract

No. However, here we show how to generate a metric consistent with the Tanimoto similarity. We also explore new properties of this index, and how it relates to other popular alternatives.
Full text 21,110 characters · extracted from preprint-html · click to expand
Is Tanimoto a metric? | bioRxiv /* */ /* */ <!-- <!-- /*! * yepnope1.5.4 * (c) WTFPL, GPLv2 */ (function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0];var j=d.createElement(s);var dl=l!='dataLayer'?'&l='+l:'';j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;j.type='text/javascript';j.async=true;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-M677548'); Skip to main content Home About Submit ALERTS / RSS Search for this keyword Advanced Search New Results Is Tanimoto a metric? Akash Surendran , Krisztina Zsigmond , Kenneth López-Pérez , View ORCID Profile Ramón Alain Miranda-Quintana doi: https://doi.org/10.1101/2025.02.18.638904 Akash Surendran 1 Department of Chemistry and Quantum Theory Project, University of Florida , Gainesville, FL 32611, USA Find this author on Google Scholar Find this author on PubMed Search for this author on this site Krisztina Zsigmond 1 Department of Chemistry and Quantum Theory Project, University of Florida , Gainesville, FL 32611, USA Find this author on Google Scholar Find this author on PubMed Search for this author on this site Kenneth López-Pérez 1 Department of Chemistry and Quantum Theory Project, University of Florida , Gainesville, FL 32611, USA Find this author on Google Scholar Find this author on PubMed Search for this author on this site Ramón Alain Miranda-Quintana 1 Department of Chemistry and Quantum Theory Project, University of Florida , Gainesville, FL 32611, USA Find this author on Google Scholar Find this author on PubMed Search for this author on this site ORCID record for Ramón Alain Miranda-Quintana For correspondence: quintana{at}chem.ufl.edu Abstract Full Text Info/History Metrics Preview PDF Abstract No. However, here we show how to generate a metric consistent with the Tanimoto similarity. We also explore new properties of this index, and how it relates to other popular alternatives. 1. INTRODUCTION Similarity (in particular, molecular similarity) plays a key role in medicinal chemistry, cheminformatics, drug design, and as a key component in multiple machine learning algorithms. 1 – 17 It is not strange then that multiple ways of quantifying the “separation between molecules” have been proposed. Perhaps the two most general and popular concepts in this regard are those of similarity index and metric . The former refers to pairwise functions that are symmetric, usually bound in the [0, 1] interval, and for which a bigger value means a closer relation between the molecules. Metrics, on the other hand are monotonically decreasing with increasing similarity, are non-negative but usually unbounded from above, and critically, satisfy the triangle inequality. That is, for a metric d and any three molecules x, y , and z : Another critical component of similarity analyzes is to determine when two different functions order the data in the same way. 18 , 19 That is, when they both agree in that molecule x is more similar to molecule y than z . This property (termed “consistency”) 9 is crucial in determining if the functions capture the same information about the data, and also provides a simple recipe to go from dissimilarity to similarity functions, and vice versa. For example, notice that every monotonically decreasing transformation will map a similarity into a dissimilarity, and that both of them will be consistent. The simplest recipe for a given similarity index S (which takes advantage of the bounded values of S ), is just to take 1 – S , which is often referred to as the “distance” counterpart to S . Now, even if S and 1 – S rank the data in exactly the same way, this does not immediately imply that 1 – S is an actual metric, since it can not be guaranteed beforehand that this transformation alone is sufficient to enforce Eq. (1). In this Note we show how to actually obtain proper companion metrics for three popular similarity indices: Tanimoto, 20 – 22 Russel-Rao, 23 and Sokal-Michener. 24 We also discuss the conditions under which these indices provide consistent results among themselves. 2. RESULTS 2.1 Metric analysis We will focus on three similarity indices: Tanimoto ( t ), Russel-Rao ( r ), and Sokal-Michener ( s ), which can be defined as: Here we are assuming that molecules are represented by vectors | x ⟩, with ⟨ x | y ⟩ indicating the inner product between the representations of molecules x and y . In Eqs. (3) and (4), M stands for the number of components in a given molecular representation (e.g., the “dimension” of the underlying vector space). This setup includes the popular molecular fingerprint representation of drug-like molecules, in which case these are just binary vectors. However, we will focus on the more general case in which the vector components are in the [0, 1] range. In all of these cases, we can trivially define dissimilarity indices (which we will denote with a “bar” on top of the similarity index notation) as: Now the question is to check whether these expressions satisfy the triangle inequality. In the case of Russel-Rao and Sokal-Michener, we can immediately answer this in the positive: Russel-Rao Let us start with the following expression, which is equivalent to d ( x, z ) + d ( y, z ) ≥ d ( x, y ): To prove the triangle inequality, we just need to show that the term in parenthesis in the r.h.s is less than 1. Let us first consider the simple case in which x, y , and z are just numbers in the [0, 1] interval. In this situation: If y ≥ z then the proof is trivial, so we only have to focus on the z ≥ y case, then: Now, going back to general M -dimensional representations, it is clear that: Sokal-Michener From the same general starting expression as for the Russel-Rao case: Once again starting from the one-component case: where we used Eq. (8) in the step before the last one. Once again adding over all the single components in the inner product completes the proof. Tanimoto, on the other hand, demands a more nuanced study. First of all, a study by Lipkus is often cited as proof of the triangle inequality for this index, but that proof is only valid for binary fingerprints. For example, consider the following vectors: then: To circumvent this issue, and propose a proper metric associated with the Tanimoto index, we instead propose the following formula for the Tanimoto distance: Hence, we just need to show that: Squaring both sides: This inequality is trivial if any of these vectors is 0, so from now on we will only refer to the case in which they are all different from 0. The maximum possible value of the r.h.s is 1, which will occur iff ⟨ x ❘ y ⟩ = 0, so is enough to show that : It is convenient to represent the vectors explicitly referring to their lengths: Also, due to Gram-Schmidt, we can always write: Where ⟨ x ❘ n ⟩ =⟨ y ❘ n ⟩ = 0. So: Since we can always set the size of an arbitrary vector to 1, we will use the shortest of ❘ x ⟩, ❘ y ⟩ as our unit of length. Without losing any generality, we can say that ❘ x ⟩ is the shortest between them, so: This also implies that: It is now clear that: Finally, since we only need to show that the triangle inequality holds for vectors with components in the [0,1] range, that means that we only need to check that the function: is non-negative. This can be easily seen in Fig. 1 . Download figure Open in new tab Figure 1: Function τ (see Eq. (24)) for different r y , r z , and θ values. Subfigure A shows τ for fixed r y between 1 and 10000. Subfigures B and C depict τ for fixed r z . In B r z is in the range of 0 to 1, whereas in C r z is between 1 and 10000. In short, the square root transformation is necessary to generate a proper metric that is consistent with the Tanimoto similarity. 2.2 Ranking analysis Other studies have compared the rankings generated by Tanimoto similarity with other plethora of similarity indexes. 18 , 21 , 25 Here we calculate all the possible combinations of similarity counters ( a :1-1 similarity, b + c : dissimilarity, d : 0-0 similarity) for 2048-bit binary fingerprints. We group the dissimilarity counters (b and c), for a total of 3 counters. The total number of possibilities is given by: 26 After calculating the r, t , and s similarities for all the possible combinations; we calculate the Kendall Tau between indices to assess the relationship of the rankings according to similarities. The results of this analysis are shown in Table 1 . We can see that the Kendall τ for the rankings between Tanimoto and the two other indexes are about the same, with a positive high value. The above-proposed actual metric has the same Kendall tau values since it is Tanimoto-based. Sokal-Michener and Russell-Rao rankings have a low relationship. In Figure 2 , we can see how the Kendall τ values get lower when we include the instances with higher values of zero-zero similarity counter ( d ) in the calculation, meaning that with sparser fingerprints the rankings differ more. We want to point out that the relationships between t-r and t-s stay almost identical throughout all the possible d values. View this table: View inline View popup Download powerpoint Table 1. Kendall τ values for molecular similarity rankings by all the possible combinations of similarity counters in 2048 fingerprints with r, t , and s similarity indexes. Download figure Open in new tab Figure 2. Variation of the Kendall τ in similarity rankings of all possible combinations of similarity counters filtering only instances with d lower than a threshold d’ . Even though this analysis gives an idea of how indexes’ ranks are related in the bigger picture where all the possible combinations are present, it does not directly reflect the scenarios where similarity is employed (i.e., similarity searching) 1 , 27 , 28 where the number of possibilities is way more reduced. To further comment on their relationship in those cases we do a consistency analysis in the next section. 2.3 Consistency analysis Two comparative measures are consistent if the similarity/distance rankings calculated taking an arbitrary reference molecule are identical for the given measures. 9 , 18 , 19 , 29 For a reference molecule i and two molecules j and k ; a pair of similarity (S, s) or distance (D, d) measurements will be consistent if: This situation resembles more the cheminformatic tasks where similarity or distance measures are used. We applied this one million randomly chosen triads (reference and two molecules) from the ChEMBL33 30 natural products (N = 64,086) library represented with both binary fingerprints (RDKit, M = 2048), 31 and real-value normalized descriptors (RDKit, M = 197). We calculated the proportion of the cases where the similarity indexes are consistent. Results are shown in Table 2 for binary fingerprints and Table 3 for real value descriptors. View this table: View inline View popup Download powerpoint Table 2. Proportions of consistent measures between similarity indexes for the ChEMBL33 natural products database represented with RDKit fingerprints. View this table: View inline View popup Download powerpoint Table 3. Proportions of consistent measures between similarity indexes for the ChEMBL33 natural product database represented with RDKit normalized real-value descriptors. In the case of normalized real-value descriptors de observed trends support the findings in the previous section. The consistency between t-r and t-s is about the same and way higher than the r-s consistency. With the binary fingerprints, r-s is still the least consistent pair of indices. However, we see that r-t has a higher consistency than s-t in this instance. Just as similarity, consistency will also depend on representation. 32 , 33 This analysis expands the previous literature where the consistency of Tanimoto with other similarity indices was studied. DATA AVAILABILITY STATEMENT Data sharing not applicable-no new data generated: Data sharing is not applicable to this article as no new data were created or analyzed in this study. ACKNOWLEDGEMENTS We thank support from the National Institute of General Medical Sciences and the National Institutes of Health under award number R35GM150620. References (1). ↵ Maggiora , G. M. ; Vogt , M. ; Stumpfe , D. ; Bajorath , J. J. Med. Chem . 2014 , 57 , 3186 . OpenUrl CrossRef PubMed (2). Martinez-Mayorga , K. , Medina-Franco , J. L. Maggiora , G. M. In Foodinformatics ; Martinez-Mayorga , K. , Medina-Franco , J. L. , Eds.; Springer : 2014 . (3). Heidar Zadeh , F. ; Ayers , P. W. J. Math. Chem . 2013 , 51 , 927 . OpenUrl CrossRef (4). Chakraborty , T. , Bucknum , M. J. , Castro , E. A. Carbo-Dorca , R. In Computational and Experimental Chemistry: Developments and Applications ; Chakraborty , T. , Bucknum , M. J. , Castro , E. A. , Eds.; Apple Academic Press : Oakville, Canada , 2013 . (5). Reutlinger , M. ; Schneider , G. Journal of Molecular Graphics & Modelling 2012 , 34 , 108 . OpenUrl CrossRef PubMed (6). Alcoba , D. R. ; Lain , L. ; Torre , A. ; Ona , O. B. ; Tiznado , W. Chem. Phys. Lett . 2012 , 549 , 103 . OpenUrl CrossRef (7). Carbo-Dorca , R. ; Besalu , E. J. Math. Chem . 2012 , 50 , 210 . OpenUrl CrossRef (8). Todeschini , R. ; Consonni , V. ; Xiang , H. ; Holliday , J. ; Buscema , M. ; Willett , P. J. Chem Inf. Model . 2012 , 52 , 2884 . OpenUrl CrossRef PubMed (9). ↵ Miranda-Quintana , R. A. ; Cruz-Rodes , R. ; Codorniu-Hernandez , E. ; Batista-Leyva , A. J. J. Math. Chem . 2010 , 47 , 1344 . OpenUrl CrossRef (10). Borgoo , A. ; Torrent-Sucarrat , M. ; De Proft , F. ; Geerlings , P. J. Chem. Phys . 2007 , 126 , 234104 . OpenUrl CrossRef PubMed (11). Bultinck , P. ; Girones , X. ; Carbó-Dorca , R. Rev. Comput. Chem . 2005 , 21 , 127 . OpenUrl CrossRef (12). Geerlings , P. ; Boon , G. ; Van Alsenoy , C. ; De Proft , F. Int. J. Quantum Chem . 2005 , 101 , 722 . OpenUrl CrossRef (13). Bender , A. ; Glen , R. C. Organic & Biomolecular Chemistry 2004 , 2 , 3204 . OpenUrl CrossRef PubMed (14). Girones , X. ; Carbo-Dorca , R. J. Comput. Chem . 2004 , 25 , 153 . OpenUrl CrossRef PubMed (15). Johnson , M. A. ; Maggiora , G. M. Concepts and applications of molecular similarity ; Wiley: University of Minnesota , 1990 . (16). Hodgkin , E. E. ; Richards , W. G. Int. J. Quantum Chem . 1987 , S14 , 105 . OpenUrl (17). ↵ Carbo-Dorca , R. ; Leyda , L. ; Arnau , M. Int. J. Quantum Chem . 1980 , 17 , 1185 . OpenUrl CrossRef (18). ↵ Miranda-Quintana , R. A. ; Bajusz , D. ; Rácz , A. ; Héberger , K. Molecular Informatics 2021 , 40 , 2060017 . OpenUrl CrossRef (19). ↵ Miranda-Quintana , R. A. ; Kim , T. D. ; Heidar-Zadeh , F. ; Ayers , P. W. J. Math. Chem . 2019 , 57 , 1755 . OpenUrl CrossRef (20). ↵ Dunn , T. B. ; Lopez-Lopez , E. ; Kim , T. D. ; Medina-Franco , J. L. ; Miranda-Quintana , R. A. Molecular Informatics 2023 , 42 , 2300056 . OpenUrl CrossRef (21). ↵ Bajusz , D. ; Rácz , A. ; Héberger , K. Journal of Cheminformatics 2015 , 7 , 20 . OpenUrl CrossRef PubMed (22). ↵ Rogers , D. J. ; Tanimoto , T. T. Science 1960 , 132 , 1115 . OpenUrl FREE Full Text (23). ↵ Russell , P. F. ; Rao , T. S. J. Malar. Inst. India 1940 , 3 , 153 . OpenUrl (24). ↵ Sokal , R. ; Michener , C. University of Kansas Scientific Bulletin 1958 , 28 , 1409 . OpenUrl (25). ↵ Rácz , A. ; Bajusz , D. ; Héberger , K. Journal of Cheminformatics 2018 , 10 , 48 . OpenUrl CrossRef PubMed (26). ↵ Hogan , V. ; Miller , S. J. When Generalized Sumsets are Difference Dominated . arXiv [Online Early Access] . Published Online: 2013 . (27). ↵ Maggiora , G. M. ; Bajorath , J. J. Comput. Aided Mol. Des . 2014 , 28 , 795 . OpenUrl CrossRef PubMed (28). ↵ Eckert , H. ; Bajorath , J. Drug Discovery Today 2007 , 12 , 225 . OpenUrl CrossRef PubMed Web of Science (29). ↵ Miranda-Quintana , R. A. ; Racz , A. ; Bajusz , D. ; Heberger , K. Journal of Cheminformatics 2021 , 13 , 33 . OpenUrl CrossRef PubMed (30). ↵ Zdrazil , B. ; al., e. Nucleic Acids Res . 2024 , 52 , D1180 . OpenUrl CrossRef PubMed (31). ↵ Landrum , G. (32). ↵ Rácz , A. ; Bajusz , D. ; Héberger , K. Metabolomics 2018 , 14 , 29 . OpenUrl CrossRef PubMed (33). ↵ Chackalamannil , S. , Rotella , D. , Ward , S. E. Bajusz , D. ; Rácz , A. ; Héberger , K. In Comprehensive medicinal chemistry III ; Chackalamannil , S. , Rotella , D. , Ward , S. E. , Eds.; Elsevier : Amsterdam, The Netherlands , 2017 . View the discussion thread. Back to top Previous Next Posted February 23, 2025. Download PDF Email Thank you for your interest in spreading the word about bioRxiv. NOTE: Your email address is requested solely to identify you as the sender of this article. Your Email * Your Name * Send To * Enter multiple addresses on separate lines or separate them with commas. You are going to email the following Is Tanimoto a metric? Message Subject (Your Name) has forwarded a page to you from bioRxiv Message Body (Your Name) thought you would like to see this page from the bioRxiv website. Your Personal Message CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions. Share Is Tanimoto a metric? Akash Surendran , Krisztina Zsigmond , Kenneth López-Pérez , Ramón Alain Miranda-Quintana bioRxiv 2025.02.18.638904; doi: https://doi.org/10.1101/2025.02.18.638904 Share This Article: Copy Citation Tools Is Tanimoto a metric? Akash Surendran , Krisztina Zsigmond , Kenneth López-Pérez , Ramón Alain Miranda-Quintana bioRxiv 2025.02.18.638904; doi: https://doi.org/10.1101/2025.02.18.638904 Citation Manager Formats BibTeX Bookends EasyBib EndNote (tagged) EndNote 8 (xml) Medlars Mendeley Papers RefWorks Tagged Ref Manager RIS Zotero Tweet Widget Facebook Like Google Plus One Subject Area Bioinformatics Subject Areas All Articles Animal Behavior and Cognition (7622) Biochemistry (17648) Bioengineering (13870) Bioinformatics (41880) Biophysics (21423) Cancer Biology (18553) Cell Biology (25458) Clinical Trials (138) Developmental Biology (13364) Ecology (19866) Epidemiology (2067) Evolutionary Biology (24290) Genetics (15589) Genomics (22475) Immunology (17711) Microbiology (40326) Molecular Biology (17145) Neuroscience (88471) Paleontology (666) Pathology (2826) Pharmacology and Toxicology (4815) Physiology (7635) Plant Biology (15114) Scientific Communication and Education (2044) Synthetic Biology (4286) Systems Biology (9815) Zoology (2268)

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00
unpaywall
last seen: 2026-05-27T02:00:06.600101+00:00
License: CC-BY-ND-4.0