<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.3.4">Jekyll</generator><link href="http://egonw.github.io/blog/feed/by_tag/qsar.xml" rel="self" type="application/atom+xml" /><link href="http://egonw.github.io/blog/" rel="alternate" type="text/html" /><updated>2026-11-30T04:27:36+00:00</updated><id>http://egonw.github.io/blog/feed/by_tag/qsar.xml</id><title type="html">chem-bla-ics</title><subtitle>Chemblaics (pronounced chem-bla-ics) is the science that uses open science and computers to solve problems in chemistry, biochemistry and related fields.</subtitle><author><name>Egon Willighagen</name></author><entry><title type="html">Chemical data curation: yes, it is that bad.</title><link href="http://egonw.github.io/blog/2011/02/09/chemical-data-curation-yes-it-is-that.html" rel="alternate" type="text/html" title="Chemical data curation: yes, it is that bad." /><published>2011-02-09T00:00:00+00:00</published><updated>2011-02-09T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2011/02/09/chemical-data-curation-yes-it-is-that</id><content type="html" xml:base="http://egonw.github.io/blog/2011/02/09/chemical-data-curation-yes-it-is-that.html"><![CDATA[<p>The readers of <a href="http://www.chemconnector.com/chemunicating/">Antony’s blog</a>
know enough about the problem. And many in the QSAR community know it too (and
many other do not). Chemical structure data is noisy. I haven’t recently created
a new local data set for analysis, so I have not taken time to blog about it
much, but the ambiguity in chemical databases is enormous. Just yesterday, Antony
and I had a <a href="http://www.chemconnector.com/chemunicating/different-approaches-to-storing-structures-and-inchis-on-chemspider.html">good</a>
<a href="http://blueobelisk.shapado.com/questions/where-can-i-get-inchis-with-a-fixed-hydrogen-layer">discussion</a>
about tautomers and in particular how things are linked together.</p>

<p>If we are in the field of property prediction, knowing what tautomer to calculate
descriptors for is crucial. Not that we actually have easy access to experimental
data showing what the important tautomer is for our end-point (predicted property),
but at least we can track what tautomer we modeled with. Has everyone ever asked
you to add units to experimental values? Like “<em>the temperarature was 279 degrees;
Celsius or Kelvin??</em>” Well, this is the exact same thing. If your QSAR model
training report does not include that information, you are doing it wrong. (/me
ducks)</p>

<p>So, why does it in fact matter? It matter simply because calculated properties
are different. Backing up to the ChemSpider example in my <a href="http://blueobelisk.shapado.com/questions/where-can-i-get-inchis-with-a-fixed-hydrogen-layer">question about InChIs
with the fixed-hydrogen layer</a>
I noted that (like in many other databases) the synonyms seems to include IUPAC
names for at least two tautomers. However, while the ChemSpider is, in fact,
for the tautomer-independent structure (using the InChI mobile hydrogen layer;
and keep in mind that the InChI uses only a limited amount of heuristic rules
for identifying tautomers, making it not detect all 40 tautomers of <a href="http://en.wikipedia.org/wiki/Warfarin">warfarin</a>),
the 2D diagram, the 3D model, and the calculated properties reflect only <em>one</em>
tautomer.</p>

<p>And calculated properties are exactly the input in QSAR’s statistical modeling.
It is interesting to realize that the differences in calculated molecular descriptors
can vary both minimally, or not at all, as drastically. Very drastically, in
fact. The recent paper by Porter (doi:<a href="https://doi.org/10.1007/s10822-010-9335-7">10.1007/s10822-010-9335-7</a>)
shows the 40 warfarin tautomers, and discusses a few properties, such as the
pKa. The experimental pKa of warfarin is around 5. Now, the paper reports calculated
pKa values for a variety of software products (<a href="http://ambit.sf.net">AMBIT</a>
is unfortunately missing). First of all, it shows that the various tools differ,
which is to be expected. But that variance is neglectable when compared by the
effect of picking the wrong tautomer. I was impressed by the range of predicted
values for the various tautomers. I ranged from about 5 to 12, throughout all
tools. That means warfarin is predicted to be mildly acidic (some tools predict
pKa’s down to 2.5) to very basic! No way your statistical modeling will understand
that!</p>

<p>And this is why Open Data is so important in chemistry. So, the next time Joe
(Organic) Chemist bitches about computers and cheminformatics, tell him it is
his own fault: he should have released his data out in the Open.</p>

<p>Anyway. Tautomerism was a curation issue in the first(!!!) entry I was curating.
The sixth had the more well-known problem, I think. I may be blind, but I would
say <a href="http://www.chemspider.com/Chemical-Structure.2060.html">this drug</a> has
a stereocenter:</p>

<p><img src="/blog/assets/images/depict2060.png" alt="" /></p>

<p>But none of the databases I checked so far (including ChemSpider) defines the
stereochemistry! I thought we settled that some decades ago? Stereochemistry
of drugs matter. What is going on here? I guess I have to browse some primary
literature and access some experimental data today then. If I can afford it.</p>]]></content><author><name>Egon Willighagen</name></author><category term="chemistry" /><category term="chemspider" /><category term="inchi" /><category term="opendata" /><category term="qsar" /><category term="justdoi:10.1007/s10822-010-9335-7" /><category term="inchikey:ROBVIMPUHSLWNV-UHFFFAOYSA-N" /><summary type="html"><![CDATA[The readers of Antony’s blog know enough about the problem. And many in the QSAR community know it too (and many other do not). Chemical structure data is noisy. I haven’t recently created a new local data set for analysis, so I have not taken time to blog about it much, but the ambiguity in chemical databases is enormous. Just yesterday, Antony and I had a good discussion about tautomers and in particular how things are linked together.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://egonw.github.io/blog/blog/assets/images/depict2060.png" /><media:content medium="image" url="http://egonw.github.io/blog/blog/assets/images/depict2060.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Why you have not heard me much about chemometrics recently…</title><link href="http://egonw.github.io/blog/2010/11/20/why-you-have-not-heard-me-much-about.html" rel="alternate" type="text/html" title="Why you have not heard me much about chemometrics recently…" /><published>2010-11-20T00:00:00+00:00</published><updated>2010-11-20T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2010/11/20/why-you-have-not-heard-me-much-about</id><content type="html" xml:base="http://egonw.github.io/blog/2010/11/20/why-you-have-not-heard-me-much-about.html"><![CDATA[<p>A casual reader my not know the background of the title of my blog. A bit over
five years ago, when I started this blog, <a href="http://chem-bla-ics.blogspot.com/2005/10/chem-bla-ics.html">I defined chemblaics</a>:</p>

<blockquote>
  <p>Chemblaics (pronounced chem-bla-ics) is the science that uses computers to address and possibly
solve problems in the area of chemistry, biochemistry and related fields. The general denomiter
seems to be molecules, but I might be wrong there. The big difference between chemblaics and
areas as cheminformatics, chemoinformatics, chemometrics, proteochemometrics, etc, is that
chemblaic only uses open source software, making experimental results reproducable and validatable.
And this is a big difference with how research in these areas is now often done.</p>
</blockquote>

<p>Later, I also identified <em>molecular chemometrics</em> (doi:<a href="http://dx.doi.org/10.1080/10408340600969601">10.1080/10408340600969601</a>)
when I reviewed important innovation in the field, which has, IMHO, a strong
overlap with chemblaics. Any reader of my blog will understand that I see semantic
technologies play a very important role here, as Open Standard for communication
Open Data between the bench chemist and the data analyst using Open Source allowing
others to reproduce, validate, and extend that work. Some have identified the
possibilities the internet brings over 10 years ago, while the use of semantic
computing goes back even further.</p>

<p>And what have the big publishers done? Nothing much yet. Not the old, not the
new. There are project ongoing, and there is a tendency (BioMed Central starts
delivering Open Data, Beilstein Institute spits RDF for a few years now, Royal
Society of Chemistry has Project Prospect), but most publishers are too late,
and not investing enough with respect to their yearly turn over. This is particularly
clear if you realize that <em>citizen and hobby scientists</em> can innovate publishing
more effectively than those projects (really!). Anyway, I do not want to talk
about publishing now, but it is just so relevant: I am not a publisher, but
publications are the primary source of knowledge (not implying at all that I
think that is the best way; it is not).</p>

<p>Instead, I am a data analyst, a chemometrician, a statistician, a cheminformatics
dude, or a (pharmaceutical) bioinformatician, depending on your field of expertise.
Really, I am a chemblaics guy: I apply and develop informatics and statistics
methods to understand chemistry (and biology) better.</p>

<p>During my PhD it became painfully clear that current science is horribly failing,
in many ways:</p>

<ul>
  <li>Firstly, we are hiring the wrong people because we care more about a co-authored
pipetting paper in Nature, than ground-breaking work in the J. Chem. Inf.
Mod. (what journal?! Exactly my point!).</li>
  <li>Secondly, we have our most bright scientists (the full time professors, assuming
that some have been hired for the right reasons) spend most of their time
on administrative work (like proposal writing, administrating big national/EU
projects).</li>
  <li>Thirdly, we spent million (in whatever currency) on large projects which end
in useless political discussions instead of getting science done.</li>
  <li>Finally, all knowledge from laborious, hard work is placed in PDF hamburgers
and lost to society (unless you spend multibucks to extract it again).</li>
</ul>

<p>There are likely several more, but these three are the most important to me
right now.</p>

<p>So, in the past years after finishing my PhD research which was on data mining
and modeling molecular data, I have spend much of my time on improving methods
in chem- and bioinformatics to handle. Hardly anyone else was doing it (several
Blue Obelisk community un-members as prominent exceptions), but someone has.</p>

<p>Why I have been doing this? Well, without good, curated data sources it is impossible
to decide why my (or others) predictive models are not working (as good as we
want them to be). Is this relevant? I would say so, yes! The field is riddled
with irreproducible studies of which one has no clue how useful they are. Trust
the authors who wrote the paper? No, thank you, but I rather verify: I am a
scientist and not a cleric. Weirdly, one would have expected this to be the
default in cheminformatics, where most stuff is electronic and reproducing results
should be cheap. Well, another fail for science, I guess.</p>

<p>So, that explains why I have not recently done so much in chemometrics. Will
I return? Surely! Right about now. There is already a paper <em>in press</em> where
we link the semantic web to (proteo)chemometrics, and more is to follow soon.</p>

<p>One example, interestingly, is pKa prediction, which has seen quite a few publications
recently, yet experimental pKa data is not available as Open Data. Why?? Let
me know if you have any clue. Yet, pKa prediction seems to be important to drug
discovery, as it gets an awful lot of attention (400+ papers in the past 10
year, of which 50+ in 2010!). But this is about to change. Samuel and I are
finishing a project that greatly simplifies knowledge aggregation and curation,
as input to statistical modeling. We now have the tools ready to do this fast
and efficiently. Right now, I am entering curated data at a speed of about 3
chemical structures a minute. That means, given I need a break now and then,
that I enter create a data set of reasonable size in a few days. Crowd-sourcing
this, the a small community can liberate data from literature in a few days.</p>

<p>This will have a huge impact on the cheminformatics and QSAR communities. They
will no longer have any excuse for making their data not available. There is
no argument anymore that curation is expensive. This will also have a huge impact
on cheminformatics and chemical data vendors. Where Open Source only had moderate
impact so far (several software vendors have already joined the Open Source
cheminformatics community), this will force them to rethink their business model.
Where they could hide behind curation where it came to text mining initiatives
(like Oscar, on which I am currently working), with cheap, expert curation knowledge
building at hand, they will be forced to rethink their added value.</p>

<p>The impact on the CDK should be clear too. We no longer depend on published
models for ALogP, XLogP, pKa, etc, predictions. Within a year, you can expect
the CDK project to release the tools to train your own models, and make choices
suitable for your user base. For example, you can make more precise models around
the structures your lab works on, or more generic models with large screening
projects. Importantly, the community will provide an Open Data knowledge base
to start from. Using our Open Standards, you can plug in your own confidential
data and make mixed, targeted models.</p>

<p>Is this possible with the cheminformatics of the past 30 years? No, and that’s
the reason why I have been away from chemometrics for a while.</p>]]></content><author><name>Egon Willighagen</name></author><category term="cheminf" /><category term="chemometrics" /><category term="odosos" /><category term="opendata" /><category term="qsar" /><category term="doi:10.1080/10408340600969601" /><summary type="html"><![CDATA[A casual reader my not know the background of the title of my blog. A bit over five years ago, when I started this blog, I defined chemblaics:]]></summary></entry><entry><title type="html">Calculating molecular descriptors with OpenTox</title><link href="http://egonw.github.io/blog/2010/10/30/calculating-molecular-descriptors-with.html" rel="alternate" type="text/html" title="Calculating molecular descriptors with OpenTox" /><published>2010-10-30T00:10:00+00:00</published><updated>2010-10-30T00:10:00+00:00</updated><id>http://egonw.github.io/blog/2010/10/30/calculating-molecular-descriptors-with</id><content type="html" xml:base="http://egonw.github.io/blog/2010/10/30/calculating-molecular-descriptors-with.html"><![CDATA[<p>While working during <em>office hours</em> on <a href="http://chem-bla-ics.blogspot.com/2010/10/oscar4-java-api-chemical-name.html">Oscar</a>,
I am also trying to finish up some work left from Uppsala. One such thing is
the Bioclipse-OpenTox project (see <a href="http://chem-bla-ics.blogspot.com/2010/08/using-bioclipse-to-upload-data-to.html">Using Bioclipse to upload data to an OpenTox
server</a>
and <a href="http://chem-bla-ics.blogspot.com/2010/03/oxford-august-2010-echeminfo-predictive.html">Oxford, August 2010: eCheminfo Predictive ADME &amp; Toxicology 2010 Workshop</a>).
Today I finished calculating molecular descriptor values with OpenTox servers:</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// requires an unspecified Bioclipse</span>
<span class="c1">// development version</span>
<span class="nx">bioclipse</span><span class="p">.</span><span class="nf">requireVersion</span><span class="p">(</span><span class="dl">"</span><span class="s2">2.6</span><span class="dl">"</span><span class="p">)</span>

<span class="nx">service</span> <span class="o">=</span>
  <span class="dl">"</span><span class="s2">http://apps.ideaconsult.net:8080/ambit2/</span><span class="dl">"</span><span class="p">;</span>
<span class="nx">serviceSPARQL</span> <span class="o">=</span>
  <span class="dl">"</span><span class="s2">http://apps.ideaconsult.net:8080/ontology/</span><span class="dl">"</span><span class="p">;</span>

<span class="nx">stringMat</span> <span class="o">=</span> <span class="nx">opentox</span><span class="p">.</span><span class="nf">listDescriptors</span><span class="p">(</span><span class="nx">serviceSPARQL</span><span class="p">);</span>
<span class="nx">stringMat</span><span class="p">.</span><span class="nf">getColumn</span><span class="p">(</span><span class="dl">"</span><span class="s2">algo</span><span class="dl">"</span><span class="p">);</span>
<span class="nx">stringMat</span><span class="p">.</span><span class="nf">getColumn</span><span class="p">(</span><span class="dl">"</span><span class="s2">desc</span><span class="dl">"</span><span class="p">);</span>

<span class="c1">// pick any descriptor</span>
<span class="nx">descriptor</span> <span class="o">=</span> <span class="nx">stringMat</span><span class="p">.</span><span class="nf">get</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>

<span class="nx">opentox</span><span class="p">.</span><span class="nf">calculateDescriptor</span><span class="p">(</span>
  <span class="nx">service</span><span class="p">,</span> <span class="nx">descriptor</span><span class="p">,</span>
  <span class="nx">cdk</span><span class="p">.</span><span class="nf">fromSMILES</span><span class="p">(</span><span class="dl">"</span><span class="s2">CCC</span><span class="dl">"</span><span class="p">)</span>
<span class="p">)</span>
</code></pre></div></div>

<p>The first descriptor happens to be a model for predicting the pKa (see <a href="http://chem-bla-ics.blogspot.com/2010/10/algorithm-or-model-opentox-api-quiz.html">Algorithm
or Model: OpenTox API quiz</a>).</p>]]></content><author><name>Egon Willighagen</name></author><category term="bioclipse" /><category term="cdk" /><category term="opentox" /><category term="qsar" /><summary type="html"><![CDATA[While working during office hours on Oscar, I am also trying to finish up some work left from Uppsala. One such thing is the Bioclipse-OpenTox project (see Using Bioclipse to upload data to an OpenTox server and Oxford, August 2010: eCheminfo Predictive ADME &amp; Toxicology 2010 Workshop). Today I finished calculating molecular descriptor values with OpenTox servers:]]></summary></entry><entry><title type="html">Looking at your statistical models…</title><link href="http://egonw.github.io/blog/2010/06/20/looking-at-your-statistical-models.html" rel="alternate" type="text/html" title="Looking at your statistical models…" /><published>2010-06-20T00:10:00+00:00</published><updated>2010-06-20T00:10:00+00:00</updated><id>http://egonw.github.io/blog/2010/06/20/looking-at-your-statistical-models</id><content type="html" xml:base="http://egonw.github.io/blog/2010/06/20/looking-at-your-statistical-models.html"><![CDATA[<p>I do not think I have ever blogged the paper that played an important role in my thesis (doi:<a href="http://dx.doi.org/10.1021/ci990038z">10.1021/ci990038z</a>);
research of one of the papers in my thesis, started with the hypothesis proposed therein. The paper had a really good idea; but, unfortunately, it did
not contain the data to support the hypothesis. That gets me to one important lesson I learned: <strong>a QSAR data set of less than 100 molecules is not enough
to make untargeted statistical models.</strong></p>

<p>The paper reads quite nicely, and the results are clear: by combining spectral types, the RMSEP goes down. Good! Lower prediction errors;
that’s what we all want. So, a M.Sc. student of mine set off, but after about half a year, he was still unable to make statistically good models.
He used bootstrapping to ‘prove’ it was not his fault: there was not enough data for the method to learn the underlying patters. Hence my above lesson.
My student went on with larger data sets, and laid out the foundation of what later became the paper on using NMR spectra in QSPR modeling
(doi:<a href="https://doi.org/10.1021/ci050282s">10.1021/ci050282s</a>). Now you understand why QSAR is missing.</p>

<p>So, if those results are so clear, then why does it not work? As said, the data set was too small for pattern recognition methods to see what was going
on. The RMSEP numbers just came out nicely; however, if we had only made the below plot, if would have warned. But I failed to do that at the time. Lesson
learned: <strong>do not just look at the data, but also look at the model.</strong> And look really means looking with your eyes at graphical representations of that model.
The plot:</p>

<p><img src="/blog/assets/images/badModel.png" alt="" /></p>

<p>The numbers in this plot are hidden in tables in the paper. The RMSEP values earlier mentioned are calculated from those. From the plot, you can see
that the test data consisted of 5 compounds; the training set contained 37 compounds; all are congenerics, and do not span a high diversity. Now, the
plot shows five models: black is COMFA; orange is based on experimental IR spectra; red, green, and blue are models where two types of representations
are combined. From the RMSEP values it can be seen that combining representation improves the RMSEP values. That’s what you want, and sort of makes
sense.</p>

<p>Now, I did not make this plot until I started writing up the paper, and tried to figure out why the QSAR data set did not work. My eyes opened wide when
I saw the orange dots! Anti-correlation! WTF?!?! I mean, we are looking at a plot visualizing the predicted versus the experimental activity… Actually,
the others are not really convincing either, are they? Looking at the predictions for compounds with experimental values around 1.0-1.5 (if you really
want to know the unit, read the article), the pattern is pretty much anti-correlated too. Thinking about it, it seems the RMSEP is mainly reflecting the
error of the left most compound, the one with a experimental activity of about 0.3.</p>

<p>Clearly, the orange model is hopeless, but the others are not really better. Now, the paper actually makes statements comparing the various combinations
of representations, but, in retrospect and looking at this plot, I wonder if the green model is really different from the blue or red models.</p>

<p>Since then, I always make these kind of plots, just to see what my model is like. Since then, I distrust papers that only show RMSEP, Q², or other
quality statistics. Now, the tricky part is, you need those statistics if you want to automate model selection; the variance on those model quality
statistics is actually so high (see also <a href="http://chem-bla-ics.blogspot.com/2010/06/qspr-modeling-with-signatures.html">my other post today</a>),
that you must carefully validate that model selection too, visually of course.</p>

<p>I have been long thinking what to do with these observations. I did not dare publish them in my thesis; I did not dare write a letter to the editor.
Perhaps I should. But even writing up this blog makes me feel uncomfortable. Besides the fact that I might be wrong, I also do not like to point out
mistakes (IMHO); particularly, when those are published in a respectable journal. I was fooled by the statistics too (and was already well trained),
so I cannot comment on the authors overlooking the issue. Or the reviewers! Or the community at large. Also, I do not know what the fate of this
paper should be. The idea is quite interesting, even though the published results do not support it. Not shown here, but the bootstrapping results
show that the apparent slight improvement is merely a numerical artifact, just happening by chance, based on luckily selecting the test compounds;
the data is just insufficient in size to draw any conclusion.</p>]]></content><author><name>Egon Willighagen</name></author><category term="chemometrics" /><category term="justdoi:10.1021/ci990038z" /><category term="doi:10.1021/CI050282S" /><category term="qsar" /><summary type="html"><![CDATA[I do not think I have ever blogged the paper that played an important role in my thesis (doi:10.1021/ci990038z); research of one of the papers in my thesis, started with the hypothesis proposed therein. The paper had a really good idea; but, unfortunately, it did not contain the data to support the hypothesis. That gets me to one important lesson I learned: a QSAR data set of less than 100 molecules is not enough to make untargeted statistical models.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://egonw.github.io/blog/blog/assets/images/badModel.png" /><media:content medium="image" url="http://egonw.github.io/blog/blog/assets/images/badModel.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Oxford, August 2010: eCheminfo Predictive ADME &amp;amp; Toxicology 2010 Workshop</title><link href="http://egonw.github.io/blog/2010/03/22/oxford-august-2010-echeminfo-predictive.html" rel="alternate" type="text/html" title="Oxford, August 2010: eCheminfo Predictive ADME &amp;amp; Toxicology 2010 Workshop" /><published>2010-03-22T00:00:00+00:00</published><updated>2010-03-22T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2010/03/22/oxford-august-2010-echeminfo-predictive</id><content type="html" xml:base="http://egonw.github.io/blog/2010/03/22/oxford-august-2010-echeminfo-predictive.html"><![CDATA[<p>The first week of August I will attend the <a href="http://echeminfo.com/COMTY_oxfordadmet10">eCheminfo Predictive ADME &amp; Toxicology Workshop</a>
(<a href="http://events.linkedin.com/eCheminfo-Predictive-ADME-Toxicology/pub/271590">LinkedIn Event</a>) for which I received a
<a href="http://barryhardy.blogs.com/cheminfostream/2010/02/bursary-award-applications-echeminfo-oxford-2010-workshops.html">Bursary Award</a>.
It will be my first time in Oxford, and I am very much looking forward to it!</p>

<p>The meeting is also bound to be fun. I have not done much in the area of toxicology other than the more general QSAR/QSPR model
building with chemometrics. But I have been recently taking to Nina and other of the <a href="http://www.opentox.org/">OpenTox</a> community,
and started to play a bit with the data and computation API they are developing.</p>

<p><img src="/blog/assets/images/bioclipseOpenTox.png" alt="" /></p>

<p>I started a Bioclipse plugin recently (see screenshot), and placed the source code in <a href="http://gitorious.org/bioclipse-opentox/bioclipse-opentox">this bioclipse-opentox</a>
Git repository on <a href="http://gitorious.org/">Gitorious</a> (<a href="http://github.com/egonw">my GitHub account</a> is already over the formal limit).
The functionality is still quite limited, and the manager currently only provides methods to download data sets
(<a href="http://www.myexperiment.org/workflows/1192">myexperiment:1192</a>):</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// query a service using the OpenTox API 1.1</span>
<span class="c1">// See: http://www.opentox.org/dev/apis/api-1.1</span>

<span class="kd">var</span> <span class="nx">service</span> <span class="o">=</span> <span class="dl">"</span><span class="s2">http://apps.ideaconsult.net:8180/ambit2/</span><span class="dl">"</span><span class="p">;</span>

<span class="kd">var</span> <span class="nx">datasets</span> <span class="o">=</span> <span class="nx">opentox</span><span class="p">.</span><span class="nf">listDataSets</span><span class="p">(</span><span class="nx">service</span><span class="p">);</span>
<span class="k">for </span><span class="p">(</span><span class="kd">set</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="kd">set</span><span class="o">&lt;</span><span class="nx">datasets</span><span class="p">.</span><span class="nf">size</span><span class="p">();</span> <span class="kd">set</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
  <span class="kd">var</span> <span class="nx">dataset</span> <span class="o">=</span> <span class="nx">datasets</span><span class="p">.</span><span class="nf">get</span><span class="p">(</span><span class="kd">set</span><span class="p">);</span>
  <span class="nx">js</span><span class="p">.</span><span class="nf">say</span><span class="p">(</span><span class="dl">"</span><span class="s2">Downloading set: </span><span class="dl">"</span> <span class="o">+</span> <span class="nx">dataset</span><span class="p">);</span>
  <span class="nx">ui</span><span class="p">.</span><span class="nf">open</span><span class="p">(</span>
    <span class="nx">opentox</span><span class="p">.</span><span class="nf">downloadDataSetAsMDLSDfile</span><span class="p">(</span>
       <span class="nx">service</span><span class="p">,</span> <span class="nx">dataset</span><span class="p">,</span> <span class="dl">"</span><span class="s2">/OpenTox/ambit</span><span class="dl">"</span> <span class="o">+</span> <span class="nx">dataset</span> <span class="o">+</span> <span class="dl">"</span><span class="s2">.sdf</span><span class="dl">"</span>
    <span class="p">)</span>
  <span class="p">)</span>
<span class="p">}</span>
</code></pre></div></div>

<p>Behind this plugin is again the RDF plugin, as OpenTox uses RDF too, a few simple SPARQL queries was all that needed to be defined.
And <a href="http://chem-bla-ics.blogspot.com/2010/03/rdf-powered-qsar-wizard-sparql-end.html">again</a>, the Bioclipse pluigin
code base is pretty small.</p>]]></content><author><name>Egon Willighagen</name></author><category term="bioclipse" /><category term="qsar" /><category term="toxicology" /><category term="opentox" /><category term="ambit" /><summary type="html"><![CDATA[The first week of August I will attend the eCheminfo Predictive ADME &amp; Toxicology Workshop (LinkedIn Event) for which I received a Bursary Award. It will be my first time in Oxford, and I am very much looking forward to it!]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://egonw.github.io/blog/blog/assets/images/bioclipseOpenTox.png" /><media:content medium="image" url="http://egonw.github.io/blog/blog/assets/images/bioclipseOpenTox.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">RDF-powered QSAR wizard: SPARQL end points providing wizard content</title><link href="http://egonw.github.io/blog/2010/03/15/rdf-powered-qsar-wizard-sparql-end.html" rel="alternate" type="text/html" title="RDF-powered QSAR wizard: SPARQL end points providing wizard content" /><published>2010-03-15T00:00:00+00:00</published><updated>2010-03-15T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2010/03/15/rdf-powered-qsar-wizard-sparql-end</id><content type="html" xml:base="http://egonw.github.io/blog/2010/03/15/rdf-powered-qsar-wizard-sparql-end.html"><![CDATA[<p>As you <a href="http://chem-bla-ics.blogspot.com/2010/03/rdf-jena-bioclipse-eclipse-zest-2-icons.html">know</a> from my blog, one of
the things I am working on is to push RDF functionality in <a href="http://www.bioclipse.net/">Bioclipse</a>, as I believe it to be the
missing link between <a href="http://chem-bla-ics.blogspot.com/2008/03/todo-april-2nd-defend-my-phd-work.html">molecular chemometrics</a>
and literature, databases, and other non-numerical information sources.</p>

<p>As part of the submission for the <a href="http://chem-bla-ics.blogspot.com/2009/11/swat4ls-wrapping-up-1.html">SWAT4LS</a> special
issue in the new <a href="http://chem-bla-ics.blogspot.com/2008/03/todo-april-2nd-defend-my-phd-work.html">Journal of Biomedical Semantics</a>,
<a href="http://bioclipse.blogspot.com/">Ola</a> hacked up a cool wizard that sets up a new <a href="http://wiki.bioclipse.net/index.php?title=QSAR_Project_with_automated_builds">QSAR Project</a>
by downloading data directly from our <a href="http://chem-bla-ics.blogspot.com/2010/02/chembl-rdf-1sparql-end-point.html">RDF node for the chEMBL data using SPARQL</a>.
The paper is based on the <a href="http://chem-bla-ics.blogspot.com/2009/11/swat4ls-linking-open-drug-data-to.html">SWAT4LS talk</a> I
gave, and the <a href="http://www.citeulike.org/user/egonw/article/6582022">proceedings paper</a> that recently appeared. But with more
cool stuff, such as this <a href="http://chem-bla-ics.blogspot.com/2010/03/rdf-jena-bioclipse-eclipse-zest-2-icons.html">cool RDF graph</a>
browser that allows you to open up molecules from the RDF graph in a JChemPaint editor.</p>

<p>Well, this really nice New QSAR Project wizard was cool enough to trigger a I-want-more reaction, so I just had to hack it
up with some additional SPARQL functionality. So, the next version does not only use RDF and SPARQL to aggregate the QSAR
data set, it also uses SPARQL to make the wizard interactive. While the user is typing a target ID, the wizard will check
the SPARQL end point in the background and download the target’s type, title and organism, as well as update the list of
activities the user can select depending on what the chEMBL database has for that target:</p>

<p><img src="/blog/assets/images/chemblQSARwizard.png" alt="" /></p>

<p>The actual code base is pretty small, and that’s what happens when you mash up the right technologies :)</p>]]></content><author><name>Egon Willighagen</name></author><category term="rdf" /><category term="chembl" /><category term="sparql" /><category term="bioclipse" /><category term="qsar" /><summary type="html"><![CDATA[As you know from my blog, one of the things I am working on is to push RDF functionality in Bioclipse, as I believe it to be the missing link between molecular chemometrics and literature, databases, and other non-numerical information sources.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://egonw.github.io/blog/blog/assets/images/chemblQSARwizard.png" /><media:content medium="image" url="http://egonw.github.io/blog/blog/assets/images/chemblQSARwizard.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Dear Advisory Board: which QSAR descriptors would you like to see implemented in the CDK?</title><link href="http://egonw.github.io/blog/2009/08/05/dear-advisory-board-which-qsar.html" rel="alternate" type="text/html" title="Dear Advisory Board: which QSAR descriptors would you like to see implemented in the CDK?" /><published>2009-08-05T00:10:00+00:00</published><updated>2009-08-05T00:10:00+00:00</updated><id>http://egonw.github.io/blog/2009/08/05/dear-advisory-board-which-qsar</id><content type="html" xml:base="http://egonw.github.io/blog/2009/08/05/dear-advisory-board-which-qsar.html"><![CDATA[<blockquote>
  <p>Dear Advisory Board,</p>

  <p>Ola Spjuth has recently been working on a extensive QSAR environment in <a href="http://www.bioclipse.net/">Bioclipse</a>, and molecular descriptors are
provided using remote services but also using the <a href="http://cdk.sf.net/">CDK</a>. The CDK has a relatively large collection of QSAR descriptors,
but certainly not the full list discussed in the <a href="http://www.moleculardescriptors.eu/books/handbook.htm">Handbook of Molecular Descriptor</a>.</p>

  <p>I’m sure everyone would appreciate a few more descriptors, and I am wondering which ones you would assign priority to. So:</p>

  <p>which QSAR descriptors would you like to see implemented in the CDK?</p>

  <p>Looking forward to hearing from you, preferable as comment in this blog, or via email to <a href="http://sourceforge.net/mailarchive/forum.php?forum_name=cdk-user">cdk-user</a>
mailing list or directly to me otherwise. Make sure to include a full reference to the paper that describes the algorithm.</p>

  <p>Kind regards,</p>

  <p>Egon</p>
</blockquote>]]></content><author><name>Egon Willighagen</name></author><category term="cdk" /><category term="qsar" /><category term="bioclipse" /><summary type="html"><![CDATA[Dear Advisory Board, Ola Spjuth has recently been working on a extensive QSAR environment in Bioclipse, and molecular descriptors are provided using remote services but also using the CDK. The CDK has a relatively large collection of QSAR descriptors, but certainly not the full list discussed in the Handbook of Molecular Descriptor. I’m sure everyone would appreciate a few more descriptors, and I am wondering which ones you would assign priority to. So: which QSAR descriptors would you like to see implemented in the CDK? Looking forward to hearing from you, preferable as comment in this blog, or via email to cdk-user mailing list or directly to me otherwise. Make sure to include a full reference to the paper that describes the algorithm. Kind regards, Egon]]></summary></entry><entry><title type="html">Commercial QSAR modeling? Sorry, already patented…</title><link href="http://egonw.github.io/blog/2008/07/23/commercial-qsar-modeling-sorry-already.html" rel="alternate" type="text/html" title="Commercial QSAR modeling? Sorry, already patented…" /><published>2008-07-23T00:00:00+00:00</published><updated>2008-07-23T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2008/07/23/commercial-qsar-modeling-sorry-already</id><content type="html" xml:base="http://egonw.github.io/blog/2008/07/23/commercial-qsar-modeling-sorry-already.html"><![CDATA[<p><a href="http://www.freepatentsonline.com/y2001/0049585.html">QSAR has been patented</a> in 2001 (US patent 20010049585).</p>

<p>Claim 1:</p>

<blockquote>
  <p>A method for predicting a set of chemical, physical or biological features related to chemical substances or
related to interactions of chemical substances using a system comprising a plurality of prediction means, the
method comprising using at least 16 different individual prediction means, thereby providing an individual
prediction of the set of features for each of the individual prediction means and predicting the set of features
on the basis of combining the individual predictions, the combining being performed in such a manner that the
combined prediction is more accurate on a test set than substantially any of the predictions of the individual
prediction means.</p>
</blockquote>

<p>They use averaging or weighted averaging of the individual predictions (claim 2). Oh, and just in case you think
you are clever and you use 17, 32, etc individual predictions. Sorry, no luck either; you have to use way beyond
1M individual predictions according to the following claim ;)</p>

<p>Claim 2:</p>

<blockquote>
  <p>A method according to claim 1, wherein the number of different predictions means is at least 20, such as at least
30, such as at least 40, 50, 75, 100, 200, 400, 600, 800, 1000, 1200, 1400, 1600, 1800, 2000, 2500, 3000, 4000, 5000,
6000, 7000, 8000, 9000, 10,000, 15,000, 20,000, 30,000, 40,000, 50,000, 100,000, 200,000, 500,000, 1,000,000.</p>
</blockquote>

<p>What can I say about this? Please leave your opinion in the comments…</p>]]></content><author><name>Egon Willighagen</name></author><category term="qsar" /><summary type="html"><![CDATA[QSAR has been patented in 2001 (US patent 20010049585).]]></summary></entry><entry><title type="html">Molecular QSAR descriptors in the CDK</title><link href="http://egonw.github.io/blog/2008/07/23/molecular-qsar-descriptors-in-cdk.html" rel="alternate" type="text/html" title="Molecular QSAR descriptors in the CDK" /><published>2008-07-23T00:00:00+00:00</published><updated>2008-07-23T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2008/07/23/molecular-qsar-descriptors-in-cdk</id><content type="html" xml:base="http://egonw.github.io/blog/2008/07/23/molecular-qsar-descriptors-in-cdk.html"><![CDATA[<p>Rajarshi has patched trunk last night with his work to address a few practical issues in the molecular descriptor
module of the <a href="http://cdk.sf.net/">CDK</a> (and I <a href="http://chem-bla-ics.blogspot.com/2008/07/commercial-qsar-modeling-sorry-already.html">peer reviewed this work yesterday</a>).
One major change is that the <a href="http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/api/org/openscience/cdk/qsar/IMolecularDescriptor.html">IMolecularDescriptor</a>
<code class="language-plaintext highlighter-rouge">calculate()</code> method no longer throws an <code class="language-plaintext highlighter-rouge">Exception</code>, but returns <code class="language-plaintext highlighter-rouge">Double.NaN</code> instead. The Exception is stored in the <code class="language-plaintext highlighter-rouge">DescriptorValue</code> for convenience.
This simplifies the QSAR descriptor calculation considerably, and, importantly, makes it more robust to the input. Though only by propagating errors into
descriptor matrix. <em>Just make sure your molecular structures have explicit hydrogens and 3D coordinates, and you’re fine.</em></p>

<p>Anyway, Rajarshi also added a new page to <a href="http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/">CDK Nightly</a>
to <a href="http://cheminfo.informatics.indiana.edu/~rguha/code/java/nightly/dnames.html">list the available descriptors</a>:</p>

<p><img src="/blog/assets/images/descNames.png" alt="" /></p>]]></content><author><name>Egon Willighagen</name></author><category term="cdk" /><category term="qsar" /><summary type="html"><![CDATA[Rajarshi has patched trunk last night with his work to address a few practical issues in the molecular descriptor module of the CDK (and I peer reviewed this work yesterday). One major change is that the IMolecularDescriptor calculate() method no longer throws an Exception, but returns Double.NaN instead. The Exception is stored in the DescriptorValue for convenience. This simplifies the QSAR descriptor calculation considerably, and, importantly, makes it more robust to the input. Though only by propagating errors into descriptor matrix. Just make sure your molecular structures have explicit hydrogens and 3D coordinates, and you’re fine.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://egonw.github.io/blog/blog/assets/images/descNames.png" /><media:content medium="image" url="http://egonw.github.io/blog/blog/assets/images/descNames.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Finding differences between IChemObjects #2</title><link href="http://egonw.github.io/blog/2008/06/03/finding-differences-between_03.html" rel="alternate" type="text/html" title="Finding differences between IChemObjects #2" /><published>2008-06-03T00:00:00+00:00</published><updated>2008-06-03T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2008/06/03/finding-differences-between_03</id><content type="html" xml:base="http://egonw.github.io/blog/2008/06/03/finding-differences-between_03.html"><![CDATA[<p><a href="http://cdk.sf.net/">CDK</a> QSAR descriptors are not allowed to change the input [molecule|atom|bond], and I
recently added a unit tests (rev <a href="http://cdk.svn.sourceforge.net/viewvc/cdk?view=rev&amp;revision=11138">11138</a>) for that to the
abstract class <a href="http://cdk.svn.sourceforge.net/viewvc/cdk/cdk/trunk/src/test/org/openscience/cdk/qsar/descriptors/atomic/AtomicDescriptorTest.java?view=log">AtomicDescriptorTest</a>.</p>

<p>After some code clean up of the diff module code earlier this morning (in anticipation of the rain stopping), I applied this patch
(rev <a href="http://cdk.svn.sourceforge.net/viewvc/cdk?view=rev&amp;revision=11269">11269</a>) that <code class="language-plaintext highlighter-rouge">noModification</code> unit test:</p>

<div class="language-diff highlighter-rouge"><div class="highlight"><pre class="highlight"><code> public void testCalculate_NoModifications() throws Exception {
   IAtomContainer mol = someoneBringMeSomeWater();
   IAtom atom = mol.getAtom(1);
<span class="gd">-  String priorString = atom.toString();
</span><span class="gi">+  IAtom clone = (IAtom)mol.getAtom(1).clone();
</span>   descriptor.calculate(atom, mol);
<span class="gd">-  String afterString = atom.toString();
</span><span class="gi">+  String diff = AtomDiff.diff(clone, atom);
</span>   assertEquals(
<span class="gd">-    "The descriptor must not change the passed bond in any respect.",
-    priorString, afterString
</span><span class="gi">+    "The descriptor must not change the passed bond in any respect, but found this diff: " + diff,
+    0, diff.length()
</span>   );
 }
</code></pre></div></div>

<p>This is a nice example of where the new <a href="http://chem-bla-ics.blogspot.com/2008/06/finding-differences-between.html">diff module</a>
is useful. Instead of dumping to long IAtom.toString()s, the output now gives output like:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>AtomDiff(AtomTypeDiff(, NULL/H, NC:0/1, V:0/1))
</code></pre></div></div>

<p>This indicates (yes, a bit cryptic) that the formal neighbor count (NC) and the valence (V) fields have been modified, in addition
to that first field, which I don’t know what it refers too. Indeed, the output still needs a bit more tuning :)</p>]]></content><author><name>Egon Willighagen</name></author><category term="cdk" /><category term="qsar" /><summary type="html"><![CDATA[CDK QSAR descriptors are not allowed to change the input [molecule|atom|bond], and I recently added a unit tests (rev 11138) for that to the abstract class AtomicDescriptorTest.]]></summary></entry></feed>