<?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/javascript.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/javascript.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">Accessing Google Spreadsheets from Bioclipse</title><link href="http://egonw.github.io/blog/2011/02/02/accessing-google-spreadsheets-from.html" rel="alternate" type="text/html" title="Accessing Google Spreadsheets from Bioclipse" /><published>2011-02-02T00:30:00+00:00</published><updated>2011-02-02T00:30:00+00:00</updated><id>http://egonw.github.io/blog/2011/02/02/accessing-google-spreadsheets-from</id><content type="html" xml:base="http://egonw.github.io/blog/2011/02/02/accessing-google-spreadsheets-from.html"><![CDATA[<p> </p>

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

<p>I am almost done refactoring two year old code for the <a href="http://onschallenge.wikispaces.com/">Open Notebook Science
Solubility</a> project, which converted its
data from the <a href="https://spreadsheets.google.com/ccc?key=plwwufp30hfq0udnEmRD1aQ#gid=0">Google Spreadsheet</a>
<a href="http://chem-bla-ics.blogspot.com/2009/11/open-notebook-science-solubility-sparql.html">into RDF</a>,
for the Beautiful Data book chapter.</p>]]></content><author><name>Egon Willighagen</name></author><category term="bioclipse" /><category term="eclipse" /><category term="google" /><category term="javascript" /><summary type="html"><![CDATA[ ]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://egonw.github.io/blog/blog/assets/images/bcGoogle.png" /><media:content medium="image" url="http://egonw.github.io/blog/blog/assets/images/bcGoogle.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">The Molecular Chemometrics Principles #3: stand on shoulders</title><link href="http://egonw.github.io/blog/2010/08/14/molecular-chemometrics-principles-3.html" rel="alternate" type="text/html" title="The Molecular Chemometrics Principles #3: stand on shoulders" /><published>2010-08-14T00:00:00+00:00</published><updated>2010-08-14T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2010/08/14/molecular-chemometrics-principles-3</id><content type="html" xml:base="http://egonw.github.io/blog/2010/08/14/molecular-chemometrics-principles-3.html"><![CDATA[<p>I have blogged about two Molecular Chemometrics principles so far:</p>

<ul>
  <li><a href="https://chem-bla-ics.linkedchemistry.info/2010/08/09/molecular-chemometrics-principles-1.html">McPrinciple #1: access to data</a></li>
  <li><a href="https://chem-bla-ics.linkedchemistry.info/2010/08/12/molecular-chemometrics-principles-2-be.html">McPrinciple #2: be clear in what you mean</a></li>
</ul>

<p>Peter’s post <a href="https://doi.org/10.59350/hphjc-qgr72">#solo10: Green Chain Reaction; where to store the data? DSR? IR? BioTorrent, OKF or ??? <i class="fa-solid fa-recycle fa-xs"></i></a>
gives me enough basis to write up a third principle:</p>

<p><strong>Molecular Chemometrics Principles #3</strong>: We make scientific progress if we build on past achievements.</p>

<p>Sounds logical, right? Practically, the way we share our cheminformatics knowledge makes this standing on shoulders pretty difficult.
But there is one particular aspect I would like to ask your attention for: you can contribute by making clear what shoulders
you would like to stand on. That is, where do you prefer to put your effort, and what message would you like to give to your user community.</p>

<p>In the aforelinked post, Peter asks where he should upload his data, and he suggest <a href="http://www.biotorrents.net/">BioTorrent</a> (see my review
<a href="https://chem-bla-ics.linkedchemistry.info/2010/04/18/bittorrents-for-science.html">BitTorrents for Science <i class="fa-solid fa-recycle fa-xs"></i></a>), DSpace, and <a href="http://www.ckan.net/">CKAN</a>.
Now, his <a href="http://www.google.se/search?sourceid=chrome&amp;client=ubuntu&amp;channel=cs&amp;ie=UTF-8&amp;q=%22Green+Chain+Reaction%22">Green Chain Reaction</a>
is picked up (see <a href="http://researchremix.wordpress.com/2010/08/11/green-chain-reaction-project-putting-my-minutes-where-my-mouth-is/">these</a>
<a href="http://scienceonlinelondon.wikidot.com/topics:green-chain-reaction">few</a> <a href="https://doi.org/10.59350/h2jq5-3np88">blog <i class="fa-solid fa-recycle fa-xs"></i></a> posts),
and the resulting data should be distributed as much as possible. The exact location does not really matter…</p>

<p>But…</p>

<p>By picking where you upload, you make a statement to your community: “<em>Look guys, we are distributing our data via Foo, because we believe those guys are doing good work! Perhaps you can support them too.</em>”.</p>

<p>This principle does not only apply to data, it applies to things too. For example, when
<a href="http://www.chemspider.com/blog/ichemlabs-and-rsc-chemspider-announce-partnership.html">iChemLabs and RSC ChemSpider Announce Partnership</a>
they do not just improve the user experience of ChemSpider (which I certainly won’t object against), but they also imply
“<em>Look dudes, your product is just not good enough and we do not want to help you improve it either</em>”.
Of course, ChemSpider has every right, and for them to succeed it is crucial to make decisions like this. Fortunately,
<a href="http://web.chemdoodle.com/installation.php">ChemDoodle is GPL</a>.</p>

<p>Every project with a user base has the opportunity to support shoulders, if they only visibly stand on them. By merely discussion the
<em>Green Chain Reaction</em>, I show to support this social web experiment. You can too. Use these powers wisely. May the McPrinciples be with you.</p>]]></content><author><name>Egon Willighagen</name></author><category term="mcprinciples" /><category term="solo10" /><category term="chemdoodle" /><category term="chemspider" /><category term="javascript" /><category term="justdoi:10.59350/hphjc-qgr72" /><category term="justdoi:10.59350/h2jq5-3np88" /><summary type="html"><![CDATA[I have blogged about two Molecular Chemometrics principles so far:]]></summary></entry><entry><title type="html">New FriendFeed layout, but there is a fix…</title><link href="http://egonw.github.io/blog/2009/04/30/new-friendfeed-layout-but-there-is-fix.html" rel="alternate" type="text/html" title="New FriendFeed layout, but there is a fix…" /><published>2009-04-30T00:00:00+00:00</published><updated>2009-04-30T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2009/04/30/new-friendfeed-layout-but-there-is-fix</id><content type="html" xml:base="http://egonw.github.io/blog/2009/04/30/new-friendfeed-layout-but-there-is-fix.html"><![CDATA[<p><a href="http://friendfeed.com/">FriendFeed</a> is the missing link between social [bookmarking|news|…] and <a href="http://en.wikipedia.org/wiki/Internet_Relay_Chat">IRC</a>
(#cdk on <a href="http://www.freenode.net/">irc.freenode.net</a>); I quite like it. Anyway, as of today, they have a new layout, and that I do not like. No more
icons for feed types, and big avatar photo’s. Really, I <em>know</em> what my fellow blogger look like (even met many of them
<a href="http://chem-bla-ics.blogspot.com/2008/08/science-blogging-2008-london-was-cool.html">in London last year</a>). The rest of
the layout is a bit too colourful for my taste.</p>

<p>Fortunately, <a href="http://nsaunders.wordpress.com/">Neil</a> posted <a href="http://friendfeed.com/neilfws/3c83a2e5/my-beta-ff-greasemonkey-suite-is-complete">three very useful</a>
<a href="http://en.wikipedia.org/wiki/Greasemonkey">GreaseMonkey</a> script to clean stuff (and since I use those to link science databases and resources anyway, see
<a href="http://chem-bla-ics.blogspot.com/2007/12/christmas-presents.html">Christmas Presents</a> and
DOI:<a href="http://dx.doi.org/10.1186/1471-2105-8-487">10.1186/1471-2105-8-487</a>): <a href="http://userscripts.org/scripts/show/46187#">FriendFeed Service Icons</a>,
<a href="http://userstyles.org/styles/16747">Cleaner FriendFeed</a>, and <a href="http://userstyles.org/styles/16763">Remove avatars from Friendfeed beta</a>.
The last may require the script target websites to no longer point to the beta server, but the real thing. However, by the time you read this,
the script may already be updated.</p>

<p>After installing these, my FriendFeed page looks better again:</p>

<p><img src="/blog/assets/images/cleanFF.png" alt="" /></p>]]></content><author><name>Egon Willighagen</name></author><category term="frienfeed" /><category term="javascript" /><category term="doi:10.1186/1471-2105-8-487" /><summary type="html"><![CDATA[FriendFeed is the missing link between social [bookmarking|news|…] and IRC (#cdk on irc.freenode.net); I quite like it. Anyway, as of today, they have a new layout, and that I do not like. No more icons for feed types, and big avatar photo’s. Really, I know what my fellow blogger look like (even met many of them in London last year). The rest of the layout is a bit too colourful for my taste.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://egonw.github.io/blog/blog/assets/images/cleanFF.png" /><media:content medium="image" url="http://egonw.github.io/blog/blog/assets/images/cleanFF.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Bioclipse2 Scripting #2: searching PubChem</title><link href="http://egonw.github.io/blog/2009/02/21/bioclipse2-scripting-2-searching.html" rel="alternate" type="text/html" title="Bioclipse2 Scripting #2: searching PubChem" /><published>2009-02-21T00:00:00+00:00</published><updated>2009-02-21T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2009/02/21/bioclipse2-scripting-2-searching</id><content type="html" xml:base="http://egonw.github.io/blog/2009/02/21/bioclipse2-scripting-2-searching.html"><![CDATA[<p>This week I have been porting the PubChem plugin for <a href="http://www.bioclipse.net/">Bioclipse</a> 1.2 to the new manager-based architecture. While still working on the Wizards,
you can run the following JavaScript in Bioclipse2 from SVN and from the next beta (*):</p>

<script src="https://gist.github.com/67462.js"></script>

<p>*) There was some confusion on the <em>two</em> beta Bioclipse2 releases so far. Some people expected a release without any bugs left. That release is what we planned to call a
<em>Release Candidate</em>. We agree that the first two betas at least turned out to be more alpha than we actually hoped, and we thank everyone who has given these releases a
go. Those who tried several development releases of Bioclipse2 saw a lot of ongoing development, and we are fixing
<a href="http://bugs.bioclipse.net/">any bug reported</a> on these releases. So, do not hesitate in reporting bugs!</p>

<p>Earlier in this series:</p>

<ul>
  <li><a href="http://chem-bla-ics.blogspot.com/2008/10/bioclipse2-scripting-1-from-smiles-to.html">Bioclipse2 Scripting #1: from SMILES to a UFF optimized structure in Jmol</a></li>
  <li><a href="http://chem-bla-ics.blogspot.com/2008/11/next-generation-asynchronous.html">Next generation asynchronous webservices #2</a></li>
  <li><a href="http://chem-bla-ics.blogspot.com/2008/11/scripting-jchempaint.html">Scripting JChemPaint</a></li>
  <li><a href="http://chem-bla-ics.blogspot.com/2009/02/bioclipse-for-cdk-developers-1.html">Bioclipse for CDK Developers #1</a></li>
</ul>]]></content><author><name>Egon Willighagen</name></author><category term="bioclipse" /><category term="pubchem" /><category term="javascript" /><summary type="html"><![CDATA[This week I have been porting the PubChem plugin for Bioclipse 1.2 to the new manager-based architecture. While still working on the Wizards, you can run the following JavaScript in Bioclipse2 from SVN and from the next beta (*):]]></summary></entry><entry><title type="html">Ubiquity fun: entering semantic markup as easy as running a Ubiquity command</title><link href="http://egonw.github.io/blog/2008/09/01/ubiquity-fun-entering-semantic-markup.html" rel="alternate" type="text/html" title="Ubiquity fun: entering semantic markup as easy as running a Ubiquity command" /><published>2008-09-01T00:10:00+00:00</published><updated>2008-09-01T00:10:00+00:00</updated><id>http://egonw.github.io/blog/2008/09/01/ubiquity-fun-entering-semantic-markup</id><content type="html" xml:base="http://egonw.github.io/blog/2008/09/01/ubiquity-fun-entering-semantic-markup.html"><![CDATA[<p>Now, the <a href="http://chem-bla-ics.blogspot.com/2008/09/ubiquity-fun-resolving-dois.html">DOI ubiquity scripts</a> I just blogged about,
was just the beginning of things. Me exploring the environment and learning the JavaScript language.</p>

<p>I start to become really interesting when we use these technologies to improve things. I am still not sure people will like the
command line nature, but at least I will be a happy user. This is the setting: I’m blogging about some chemistry, like to add an
InChI (or InChIKey) and add that <a href="http://chem-bla-ics.blogspot.com/2006/12/including-smiles-cml-and-inchi-in.html">cool sechemtic markup</a>
people have been blogging about, but I do not know (or want to know) the HTML details for that.</p>

<p>Well, no worries, no more. Here comes <em>sechemtic-inchi</em> (<a href="http://blueobelisk.sourceforge.net/people/egonw/sechemtic-inchi.html">installer here</a>)!</p>

<h2 id="step-1">Step 1</h2>

<p>I type in the InChI I want in my blog (example showing that of <a href="http://en.wikipedia.org/wiki/Methane">methane</a>):</p>

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

<p>And, I select the InChI:</p>

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

<p>After which I hit the Ubiquity shortcut (ALT-SPACE on Linux) and I type <em>sechemtic-inchi</em>:</p>

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

<p>And, viola, there is my RDFa HTML code for chemistry:</p>

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

<p>Now, with only minor amounts of fantasy, you can imagine where this is going: SMILES, InChiKey, etc, etc. Hook it up with
<a href="http://rguha.wordpress.com/2008/08/30/ubiquity-and-chemical-information/">chemistry webservices</a> to autoconvert
SMILES to InChIKeys, and Bob’s your uncle.</p>]]></content><author><name>Egon Willighagen</name></author><category term="rdf" /><category term="javascript" /><category term="web" /><category term="ubiquity" /><category term="rdfa" /><summary type="html"><![CDATA[Now, the DOI ubiquity scripts I just blogged about, was just the beginning of things. Me exploring the environment and learning the JavaScript language.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://egonw.github.io/blog/blog/assets/images/ubiSechemticStep1.5.png" /><media:content medium="image" url="http://egonw.github.io/blog/blog/assets/images/ubiSechemticStep1.5.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Ubiquity fun: resolving DOIs</title><link href="http://egonw.github.io/blog/2008/09/01/ubiquity-fun-resolving-dois.html" rel="alternate" type="text/html" title="Ubiquity fun: resolving DOIs" /><published>2008-09-01T00:00:00+00:00</published><updated>2008-09-01T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2008/09/01/ubiquity-fun-resolving-dois</id><content type="html" xml:base="http://egonw.github.io/blog/2008/09/01/ubiquity-fun-resolving-dois.html"><![CDATA[<p>Now, I’m really after something else, but here’s my first <a href="https://wiki.mozilla.org/Labs/Ubiquity">Ubiquity</a>
<a href="http://blueobelisk.sourceforge.net/people/egonw/ubiquity.html">scripts</a>. It allow you to select a DOI on any
web page (which really only makes sense if it is not already a hyperlink), you hit ALT-SPACE (Linux), CTRL-SPACE (Windows),
or whatever the shortcut is on your operating system, and type <em>resolve-doi</em> and it will automatically convert the DOI
into a hyperlink to look up the paper.</p>

<p>What I am actually interested in, is being able to use this command in a blog editing environment; however, I
have not managed to get that working in one command. And because I am apparently not able to put in two ubiquity
commands in blog items, you need to go to <a href="http://blueobelisk.sourceforge.net/people/egonw/ubiquity.html">this page</a>.</p>

<p>Second warning. I have only tried them with Ubiquity 0.1, not 0.1.1, or even later.</p>

<p>For the curious, the script looks like:</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">CmdUtils</span><span class="p">.</span><span class="nc">CreateCommand</span><span class="p">({</span>
  <span class="na">name</span><span class="p">:</span> <span class="dl">"</span><span class="s2">resolve-doi</span><span class="dl">"</span><span class="p">,</span>
  <span class="na">homepage</span><span class="p">:</span> <span class="dl">"</span><span class="s2">http://chem-bla-ics.blogspot.com/</span><span class="dl">"</span><span class="p">,</span>
  <span class="na">author</span><span class="p">:</span> <span class="p">{</span> <span class="na">name</span><span class="p">:</span> <span class="dl">"</span><span class="s2">Egon Willighagen</span><span class="dl">"</span><span class="p">,</span> <span class="na">email</span><span class="p">:</span> <span class="dl">"</span><span class="s2">egon.willighagen@gmail.com</span><span class="dl">"</span><span class="p">},</span>
  <span class="na">description</span><span class="p">:</span> <span class="dl">"</span><span class="s2">Resolves a DOI into a URL</span><span class="dl">"</span><span class="p">,</span>
  <span class="na">license</span><span class="p">:</span> <span class="dl">"</span><span class="s2">GPL</span><span class="dl">"</span><span class="p">,</span>
  <span class="na">takes</span><span class="p">:</span> <span class="p">{</span><span class="dl">"</span><span class="s2">doi</span><span class="dl">"</span><span class="p">:</span> <span class="nx">noun_arb_text</span><span class="p">},</span>

  <span class="na">preview</span><span class="p">:</span> <span class="kd">function</span><span class="p">(</span> <span class="nx">pblock</span><span class="p">,</span> <span class="nx">doi</span> <span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">msg</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">Inserts a URL for the DOI: ${doi}</span><span class="dl">'</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">doi</span><span class="p">.</span><span class="nx">text</span> <span class="o">||</span> <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">getSelection</span><span class="p">();</span>
    <span class="nx">pblock</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">renderTemplate</span><span class="p">(</span><span class="nx">msg</span><span class="p">,</span> <span class="p">{</span><span class="na">doi</span><span class="p">:</span> <span class="nx">d</span><span class="p">});</span>
  <span class="p">},</span>

  <span class="na">execute</span><span class="p">:</span> <span class="kd">function</span><span class="p">(</span> <span class="nx">doi</span> <span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">msg</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">&lt;a href="http://dx.doi.org/${doi}"&gt;${doi}&lt;/a&gt;</span><span class="dl">'</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">d</span> <span class="o">=</span> <span class="nx">doi</span><span class="p">.</span><span class="nx">text</span> <span class="o">||</span> <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">getSelection</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">newText</span> <span class="o">=</span> <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">renderTemplate</span><span class="p">(</span><span class="nx">msg</span><span class="p">,</span> <span class="p">{</span><span class="na">doi</span><span class="p">:</span> <span class="nx">d</span><span class="p">});</span>
    <span class="nx">CmdUtils</span><span class="p">.</span><span class="nf">setSelection</span><span class="p">(</span><span class="nx">newText</span><span class="p">);</span>
  <span class="p">}</span>
<span class="p">})</span>
</code></pre></div></div>

<p>Comments on this code most welcome! It’s <a href="http://www.gnu.org/copyleft/gpl.html">GPL</a>. Details can be found in
<a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_0.1_Author_Tutorial">this tutorial</a> and examples in
<a href="http://rguha.wordpress.com/2008/08/30/ubiquity-and-chemical-information/">Rajarshi’s blog</a>.</p>]]></content><author><name>Egon Willighagen</name></author><category term="javascript" /><category term="web" /><category term="doi" /><category term="ubiquity" /><summary type="html"><![CDATA[Now, I’m really after something else, but here’s my first Ubiquity scripts. It allow you to select a DOI on any web page (which really only makes sense if it is not already a hyperlink), you hit ALT-SPACE (Linux), CTRL-SPACE (Windows), or whatever the shortcut is on your operating system, and type resolve-doi and it will automatically convert the DOI into a hyperlink to look up the paper.]]></summary></entry><entry><title type="html">Glueing BioMoby services together with JavaScript in Bioclipse</title><link href="http://egonw.github.io/blog/2007/11/05/glueing-biomoby-services-together-with.html" rel="alternate" type="text/html" title="Glueing BioMoby services together with JavaScript in Bioclipse" /><published>2007-11-05T00:00:00+00:00</published><updated>2007-11-05T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2007/11/05/glueing-biomoby-services-together-with</id><content type="html" xml:base="http://egonw.github.io/blog/2007/11/05/glueing-biomoby-services-together-with.html"><![CDATA[<p><a href="http://www.blogger.com/profile/10379047094508592338">Ola</a> has been doing a good job of integrating
<a href="http://biomoby.org/">BioMoby</a> support into Bioclipse. Earlier he completed a GUI for running BioMOBY
services, and added more recently <a href="http://bioclipse.blogspot.com/2007/11/scripting-biomoby-in-bioclipse.html">a JavaScript wrapper too</a>,
using the <a href="http://wiki.bioclipse.net/index.php?title=Bc_rhino">Rhino plugin</a> developed by Johannes.</p>

<p>For example:</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">console</span> <span class="o">=</span> <span class="nb">Packages</span><span class="p">.</span><span class="nx">net</span><span class="p">.</span><span class="nx">bioclipse</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">BioclipseConsole</span><span class="p">;</span>
<span class="nx">moby</span> <span class="o">=</span> <span class="nb">Packages</span><span class="p">.</span><span class="nx">net</span><span class="p">.</span><span class="nx">bioclipse</span><span class="p">.</span><span class="nx">biomoby</span><span class="p">.</span><span class="nx">ui</span><span class="p">.</span><span class="nx">scripts</span><span class="p">.</span><span class="nx">MobyServiceScripting</span><span class="p">;</span>
<span class="nx">biojava</span> <span class="o">=</span> <span class="nb">Packages</span><span class="p">.</span><span class="nx">net</span><span class="p">.</span><span class="nx">bioclipse</span><span class="p">.</span><span class="nx">biojava</span><span class="p">.</span><span class="nx">scripts</span><span class="p">.</span><span class="nx">BioJavaScripting</span><span class="p">;</span>

<span class="nx">prot</span><span class="o">=</span><span class="nx">moby</span><span class="p">.</span><span class="nf">downloadGenbank</span><span class="p">(</span><span class="dl">"</span><span class="s2">NCBI_GI</span><span class="dl">"</span><span class="p">,</span><span class="dl">"</span><span class="s2">111076</span><span class="dl">"</span><span class="p">);</span>
<span class="nx">seq</span><span class="o">=</span><span class="nx">biojava</span><span class="p">.</span><span class="nf">parseString</span><span class="p">(</span><span class="nx">prot</span><span class="p">);</span>
<span class="nx">fasta</span><span class="o">=</span><span class="nx">biojava</span><span class="p">.</span><span class="nf">toFasta</span><span class="p">(</span><span class="nx">seq</span><span class="p">);</span>

<span class="nx">console</span><span class="p">.</span><span class="nf">writeToConsole</span><span class="p">(</span><span class="nx">fasta</span><span class="p">);</span>
</code></pre></div></div>

<p>Today, he explained <a href="http://bioclipse.blogspot.com/2007/11/adding-scripting-commands-to-bioclipse.html">how to create convenience JavaScript shortcuts</a>,
to reduce the typing.</p>

<p>Screenshots and status of the Bioclipse-BioMoby work is <a href="http://wiki.bioclipse.net/index.php?title=BioMoby_plugin">available from the wiki</a>.</p>]]></content><author><name>Egon Willighagen</name></author><category term="bioclipse" /><category term="javascript" /><summary type="html"><![CDATA[Ola has been doing a good job of integrating BioMoby support into Bioclipse. Earlier he completed a GUI for running BioMOBY services, and added more recently a JavaScript wrapper too, using the Rhino plugin developed by Johannes.]]></summary></entry><entry><title type="html">Chemistry in HTML: JavaScript from the server</title><link href="http://egonw.github.io/blog/2007/01/02/chemistry-in-html-javascript-from.html" rel="alternate" type="text/html" title="Chemistry in HTML: JavaScript from the server" /><published>2007-01-02T00:00:00+00:00</published><updated>2007-01-02T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2007/01/02/chemistry-in-html-javascript-from</id><content type="html" xml:base="http://egonw.github.io/blog/2007/01/02/chemistry-in-html-javascript-from.html"><![CDATA[<p>Recently I blogged about <a href="http://chem-bla-ics.blogspot.com/2006/12/smiles-cas-and-inchi-in-blogs.html">a Greasemonkey script</a>
to take advantage of <a href="http://chem-bla-ics.blogspot.com/2006/12/including-smiles-cml-and-inchi-in.html">semantic markup of chemistry in blogs</a>
(and HTML in general), and later made <a href="http://chem-bla-ics.blogspot.com/2006/12/chemistry-in-html-greasemonkey-again.html">some plans how this can be
extended</a>.
One of the ideas was to make this userscript available from the server, instead
of having people need to install <a href="http://greasemonkey.mozdev.org/">Greasemonkey</a>
and the script separately. So, here it is.</p>

<h2 id="sechemticjs">sechemtic.js</h2>

<p>Consider this (X)HTML:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;html</span> <span class="na">xmlns=</span><span class="s">"http://www.w3.org/1999/xhtml"</span>
      <span class="na">xmlns:chem=</span><span class="s">"http://www.blueobelisk.org/chemistryblogs/"</span><span class="nt">&gt;</span>

<span class="nt">&lt;head&gt;</span>
 <span class="nt">&lt;title&gt;</span>m1<span class="nt">&lt;/title&gt;</span>
 <span class="nt">&lt;script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"sechemtic.js"</span> <span class="nt">/&gt;</span>
<span class="o">&lt;</span><span class="sr">/head</span><span class="err">&gt;
</span>
<span class="o">&lt;</span><span class="nx">body</span> <span class="nx">onload</span><span class="o">=</span><span class="dl">"</span><span class="s2">addGoogleAndPubChemLinks(1,1)</span><span class="dl">"</span><span class="o">&gt;</span>
  <span class="o">&lt;</span><span class="nx">h1</span><span class="o">&gt;</span><span class="nx">The</span> <span class="nx">Output</span><span class="o">&lt;</span><span class="sr">/h1</span><span class="err">&gt;
</span>  <span class="o">&lt;</span><span class="nx">p</span><span class="o">&gt;</span><span class="nx">This</span> <span class="nx">article</span> <span class="nx">is</span> <span class="nx">about</span> <span class="o">&lt;</span><span class="nx">span</span> <span class="kd">class</span><span class="o">=</span><span class="dl">"</span><span class="s2">chem:compound</span><span class="dl">"</span><span class="o">&gt;</span><span class="nx">m1</span><span class="o">&lt;</span><span class="sr">/span&gt;</span><span class="err"> 
</span>  <span class="p">(</span><span class="nx">SMILES</span><span class="p">:</span><span class="o">&lt;</span><span class="nx">span</span> <span class="kd">class</span><span class="o">=</span><span class="dl">"</span><span class="s2">chem:smiles</span><span class="dl">"</span><span class="o">&gt;</span><span class="nx">CCCOC</span><span class="o">&lt;</span><span class="sr">/span&gt;</span><span class="se">)</span><span class="sr">.&lt;/</span><span class="nx">p</span><span class="o">&gt;</span>

<span class="o">&lt;</span><span class="sr">/body</span><span class="err">&gt;
</span>
<span class="o">&lt;</span><span class="sr">/html</span><span class="err">&gt;
</span></code></pre></div></div>

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

<p>I think the above example shows the simple setup of the Sechemtic Web script (please
forgive me my habit to use bad linguistic mashups ;). Just load the script in the
HTML <code class="language-plaintext highlighter-rouge">&lt;head&gt;</code>, and add in the <code class="language-plaintext highlighter-rouge">onload="addGoogleAndPubChemLinks(1,1)"</code> attribute to
the <code class="language-plaintext highlighter-rouge">&lt;body&gt;</code> element. With blogs these bits would be part of the template, and,
therefore, need to be installed once. From then on, just use the <a href="http://chem-bla-ics.blogspot.com/2006/12/including-smiles-cml-and-inchi-in.html">semantic markup as
explained earlier</a>.
Both the microformat and the RDFa method are supported. In
case of the latter, I recommend to define the chem namespace in the template of
webpages too, instead of in the <code class="language-plaintext highlighter-rouge">&lt;span&gt;</code> elements.</p>

<p>Currently, the Sechemtic Web script only has one functionality: to add links to
<a href="http://pubchem.ncbi.nlm.nih.gov/">PubChem</a> and <a href="http://www.google.com/">Google</a>,
with the <code class="language-plaintext highlighter-rouge">addGoogleAndPubChemLinks(int, int)</code> method. The
first parameter determines (0 or 1) if links to Google should be made, and the
second parameter does the same for links to PubChem.</p>

<h2 id="download">Download</h2>

<p>For now, the script can be downloaded <a href="http://wiki.cubic.uni-koeln.de/cb/sechemtic.js">here</a>.
It is licensed with the GPL version 2.0.</p>

<h2 id="microformats">Microformats</h2>

<p>Here’s the same example using <a href="http://microformats.org/">microformats</a>
instead of RDFa:</p>

<div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;html&gt;</span>

<span class="nt">&lt;head&gt;</span>
 <span class="nt">&lt;title&gt;</span>m1<span class="nt">&lt;/title&gt;</span>
 <span class="nt">&lt;script </span><span class="na">type=</span><span class="s">"text/javascript"</span> <span class="na">src=</span><span class="s">"sechemtic.js"</span> <span class="nt">/&gt;</span>
<span class="o">&lt;</span><span class="sr">/head</span><span class="err">&gt;
</span>
<span class="o">&lt;</span><span class="nx">body</span> <span class="nx">onload</span><span class="o">=</span><span class="dl">"</span><span class="s2">addGoogleAndPubChemLinks(1,1)</span><span class="dl">"</span><span class="o">&gt;</span>
  <span class="o">&lt;</span><span class="nx">h1</span><span class="o">&gt;</span><span class="nx">The</span> <span class="nx">Output</span><span class="o">&lt;</span><span class="sr">/h1</span><span class="err">&gt;
</span>  <span class="o">&lt;</span><span class="nx">p</span><span class="o">&gt;</span><span class="nx">This</span> <span class="nx">article</span> <span class="nx">is</span> <span class="nx">about</span> <span class="o">&lt;</span><span class="nx">span</span> <span class="kd">class</span><span class="o">=</span><span class="dl">"</span><span class="s2">compound</span><span class="dl">"</span><span class="o">&gt;</span><span class="nx">m1</span><span class="o">&lt;</span><span class="sr">/span&gt;</span><span class="err"> 
</span>  <span class="p">(</span><span class="nx">SMILES</span><span class="p">:</span><span class="o">&lt;</span><span class="nx">span</span> <span class="kd">class</span><span class="o">=</span><span class="dl">"</span><span class="s2">smiles</span><span class="dl">"</span><span class="o">&gt;</span><span class="nx">CCCOC</span><span class="o">&lt;</span><span class="sr">/span&gt;</span><span class="se">)</span><span class="sr">.&lt;/</span><span class="nx">p</span><span class="o">&gt;</span>

<span class="o">&lt;</span><span class="sr">/body</span><span class="err">&gt;
</span>
<span class="o">&lt;</span><span class="sr">/html</span><span class="err">&gt;
</span></code></pre></div></div>]]></content><author><name>Egon Willighagen</name></author><category term="html" /><category term="javascript" /><category term="userscript" /><category term="rdfa" /><summary type="html"><![CDATA[Recently I blogged about a Greasemonkey script to take advantage of semantic markup of chemistry in blogs (and HTML in general), and later made some plans how this can be extended. One of the ideas was to make this userscript available from the server, instead of having people need to install Greasemonkey and the script separately. So, here it is.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://egonw.github.io/blog/blog/assets/images/sechemticJSOutput.png" /><media:content medium="image" url="http://egonw.github.io/blog/blog/assets/images/sechemticJSOutput.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Bioclipse Workshop: short but productive</title><link href="http://egonw.github.io/blog/2006/11/03/bioclipse-workshop-short-but.html" rel="alternate" type="text/html" title="Bioclipse Workshop: short but productive" /><published>2006-11-03T00:00:00+00:00</published><updated>2006-11-03T00:00:00+00:00</updated><id>http://egonw.github.io/blog/2006/11/03/bioclipse-workshop-short-but</id><content type="html" xml:base="http://egonw.github.io/blog/2006/11/03/bioclipse-workshop-short-but.html"><![CDATA[<p>The <a href="http://www.bioclipse.net/">Bioclipse</a> <a href="http://wiki.bioclipse.net/index.php?title=Bioclipse_Workshop_Oct/Nov_2006">Workshop</a>
has ended and, for just three days, turned out <a href="http://wiki.bioclipse.net/index.php?title=Outcome_of_the_Bioclipse_autumn_workshop_2006">quite productive</a>.
We have first bits of scripting support for JavaScript using <a href="http://www.mozilla.org/rhino/">Rhino</a>. At this moment the
scripting plugin needs to explicit depend on plugins to be able to access their classpath, but we plan to solve that.
An example script:</p>

<div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// to have short identifiers</span>
<span class="nb">Array</span> <span class="o">=</span> <span class="nb">Packages</span><span class="p">.</span><span class="nx">java</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">reflect</span><span class="p">.</span><span class="nb">Array</span><span class="p">;</span>
<span class="nb">String</span> <span class="o">=</span> <span class="nb">Packages</span><span class="p">.</span><span class="nx">java</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nb">String</span><span class="p">;</span>
<span class="nx">msgBox</span> <span class="o">=</span> <span class="nb">Packages</span><span class="p">.</span><span class="nx">net</span><span class="p">.</span><span class="nx">bioclipse</span><span class="p">.</span><span class="nx">plugins</span><span class="p">.</span><span class="nx">bc_rhino</span><span class="p">.</span><span class="nx">ShowBcMsgBox</span><span class="p">;</span>
<span class="nx">DbfetchServiceServiceLocator</span> <span class="o">=</span>
  <span class="nb">Packages</span><span class="p">.</span><span class="nx">uk</span><span class="p">.</span><span class="nx">ac</span><span class="p">.</span><span class="nx">ebi</span><span class="p">.</span><span class="nx">www</span><span class="p">.</span><span class="nx">ws</span><span class="p">.</span><span class="nx">services</span><span class="p">.</span><span class="nx">urn</span><span class="p">.</span><span class="nx">Dbfetch</span><span class="p">.</span><span class="nx">DbfetchServiceServiceLocator</span><span class="p">;</span>

<span class="c1">// get data</span>
<span class="nx">service</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">DbfetchServiceServiceLocator</span><span class="p">();</span>
<span class="nx">strarray</span> <span class="o">=</span> <span class="nx">service</span><span class="p">.</span><span class="nf">getUrnDbfetch</span><span class="p">().</span><span class="nf">fetchData</span><span class="p">(</span><span class="dl">"</span><span class="s2">refseq:NM_210721</span><span class="dl">"</span><span class="p">,</span> <span class="dl">"</span><span class="s2">refseq</span><span class="dl">"</span><span class="p">,</span> <span class="dl">"</span><span class="s2">raw</span><span class="dl">"</span><span class="p">);</span>

<span class="c1">// make readable</span>
<span class="nx">str</span> <span class="o">=</span> <span class="k">new</span> <span class="nc">String</span><span class="p">();</span>
<span class="k">for </span><span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nb">Array</span><span class="p">.</span><span class="nf">getLength</span><span class="p">(</span><span class="nx">strarray</span><span class="p">);</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
  <span class="k">if </span><span class="p">(</span><span class="nx">i</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">)</span>
  <span class="nx">str</span> <span class="o">=</span> <span class="nx">str</span> <span class="o">+</span> <span class="p">(</span><span class="dl">"</span><span class="se">\n</span><span class="dl">"</span><span class="p">);</span>
  <span class="nx">str</span> <span class="o">=</span> <span class="nx">str</span> <span class="o">+</span> <span class="nx">strarray</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
<span class="p">}</span>

<span class="c1">// show</span>
<span class="nx">msgBox</span><span class="p">.</span><span class="nc">ShowStatic</span><span class="p">(</span><span class="nx">str</span><span class="p">);</span>
</code></pre></div></div>

<p>It’s just a short example that uses webservice technology in Bioclipse to fetch a sequence.</p>

<h1 id="qsar-support">QSAR support</h1>

<p>QSAR support is getting along too, with a new DescriptorProvider extension point in <a href="http://svn.sourceforge.net/viewvc/bioclipse/trunk/">trunk/</a>
and work is progressing on a wizard that allows selecting descriptors and a CDK backend. The output of the wizard is a matrix resource, for
which we already have a rich editor. A <a href="http://www-ra.informatik.uni-tuebingen.de/software/joelib/">JOELib</a> plugin has been suggested,
as it has a good deal of QSAR descriptors too; <a href="http://miningdrugs.blogspot.com/">Jörg</a>, interested in doing a tiny bit of Bioclipse hacking?</p>

<p>A full proceedings is available <a href="http://wiki.bioclipse.net/index.php?title=Outcome_of_the_Bioclipse_autumn_workshop_2006">online</a>.</p>]]></content><author><name>Egon Willighagen</name></author><category term="bioclipse" /><category term="qsar" /><category term="javascript" /><summary type="html"><![CDATA[The Bioclipse Workshop has ended and, for just three days, turned out quite productive. We have first bits of scripting support for JavaScript using Rhino. At this moment the scripting plugin needs to explicit depend on plugins to be able to access their classpath, but we plan to solve that. An example script:]]></summary></entry></feed>