26 April 2007

New Journal: Human Frontier Science Program Journal


The HFSP Journal aims to publish high quality, innovative interdisciplinary basic research at the frontier of biology over a wide range of organizational levels (from the molecular level to population biology) using principles strategies or technologies from the more quantitative disciplines (e.g. physics, chemistry, mathematics, engineering, or informatics).

http://hfspj.aip.org/

Pubmed2connotea updated for Pubmed Beta.


I've updated the greasemonkey script 'pubmed2connotea'. The script alters the content of NCBI pubmed by inserting somes hyperlinks to connotea and it now works for the new pubmed beta.
I also added a hyperlink to http://del.icio.us.

see:


Updated 2010-08-12 source code

// pubmed2connotea
// version 0.4 BETA!
// 2007-04-26
// Copyright (c) 2006, 2007, Pierre Lindenbaum PhD
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
// http://www.integragen.com
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.6.4 or later: http://greasemonkey.mozdev.org/
// and Firefox 1.5 : http://www.mozilla.com/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "pubmed2connotea", and click Uninstall.
//
// 2006-07: changed for abstract-plus
// 2007-04: pubmed beta
//
// --------------------------------------------------------------------

// ==UserScript==
// @name pubmed2connotea
// @namespace http://www.integragen.com
// @description insert a shortcut link used to add an entry in http://www.connotea.org or http://www.citeulike.org/ when browsing NCBI pubmed
// @include http://www.ncbi.nlm.nih.gov/entrez/*
// @include http://www.ncbi.nlm.nih.gov/sites/*
// @include http://www.ncbi.nlm.nih.gov/pubmed/*

// ==/UserScript==



function gm_xpath(expression,contextNode)
{
return document.evaluate(expression,contextNode,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);
}

function getParameter(url,parameter)
{
if(url==null) return null;
parameter=parameter.toLowerCase();
var a= url.indexOf("?");
if(a==-1) return null;
if(url.toLowerCase().indexOf(parameter+"=")==-1) return null;
var params= url.substring(a+1).split("&");
var i=0;
for(i=0;i<params.length;i++)
{
b= params[i].indexOf("=");
if(b==-1) continue;
var key = params[i].substring(0,b).toLowerCase();
if(key!=parameter) continue;
return params[i].substring(b+1);
}
return null;
}

function hasParameter(url,key,value)
{
var s= getParameter(url,key);
return (s!=null && s.toLowerCase() == value.toLowerCase() );
}

function escapeURL(url)
{
var s="";
var i=0;

for(i=0;i< url.length;++i)
{
var c=url.charAt(i)
switch( c )
{
case ':': s+= '%3A'; break;
case '/': s+= '%2F'; break;
case '?': s+= '%3F'; break;
case '=': s+= '%3D'; break;
case '&': s+= '%26'; break;
default : s+= c; break;
}
}
return s;
}


function insertAnchors()
{

if(document.getElementsByTagName)
{
//hack found at http://erik.eae.net/archives/2005/06/10/22.21.42/#comment-5337
var inputElements = document.getElementsByTagName("input");
var i=0;
for (i=0; inputElements[i]!=null; i++)
{
inputElements[i].setAttribute("autocomplete","off");
}
}
}

var prefix="http://www.ncbi.nlm.nih.gov/pubmed/";
var allAnchors = gm_xpath("//a[@href]",document);

var i=0;
var prev=0;

for(i=0; i<allAnchors.snapshotLength; i++)
{
a = allAnchors.snapshotItem(i);
if(a.parentNode==null) continue;
var href=a.href;

var index=href.indexOf(prefix);


var list_uids="null";
if(index==-1){
var templocation=href.indexOf("IdsFromResult");
if(templocation!=-1){
list_uids=getParameter(href,"IdsFromResult");
index=0;
}
}

if(index==-1) continue;

if(href.indexOf("id=Limits")!=-1||
href.indexOf("id=Preview/Index")!=-1||
href.indexOf("id=History")!=-1||
href.indexOf("id=Clipboard")!=-1||
href.indexOf("id=Details")!=-1||
href.indexOf("filter=review&")!=-1
) continue;

if(list_uids=="null"){

qlocation=href.indexOf("?");
if(qlocation!=-1){
list_uids=href.substring(35,qlocation);//pmid starts at 35
}
}

if(list_uids!=prev){

href= "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids="+list_uids;
//href= "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&list_uids="+list_uids;
prev=list_uids;

var newanchor = document.createElement("a");
newanchor.setAttribute("title","insert into www.connotea.org");
newanchor.setAttribute("target","connotea"+i+list_uids);
//addpopup?continue=confirm
//newanchor.setAttribute("href","http://www.connotea.org/addpopup?continue=confirm&uri="+escapeURL(href)+"&button=Look%20Up");
newanchor.setAttribute("href","http://www.connotea.org/addpopup?continue=confirm&uri="+escapeURL(href));

var img = document.createElement("img");
img.setAttribute("alt","insert into www.connotea.org");
img.setAttribute("src","http://www.connotea.org/connotea_icon.png");
img.setAttribute("border","0");

newanchor.appendChild(img);
//GM_log(a.href);
a.parentNode.insertBefore(newanchor,a);
a.parentNode.insertBefore(document.createTextNode(" "),a);

//now create link for citeulike

newanchor = document.createElement("a");
newanchor.setAttribute("title","insert into www.citeulike.org");
newanchor.setAttribute("target","citeulike"+i);
newanchor.setAttribute("href","http://www.citeulike.org/posturl?url="+escapeURL(href)+"&title=Entrez%20PubMed");

img = document.createElement("img");
img.setAttribute("alt","insert into www.citeulike.org");
img.setAttribute("src","http://static.citeulike.org/img/note.gif");
img.setAttribute("border","0");

newanchor.appendChild(img);
a.parentNode.insertBefore(newanchor,a);
a.parentNode.insertBefore(document.createTextNode(" "),a);


//now create link for del.icio.us

newanchor = document.createElement("a");
newanchor.setAttribute("title","insert into del.icio.us");
newanchor.setAttribute("target","delicious"+i);
newanchor.setAttribute("href","http://del.icio.us/post?url="+escapeURL(href));

img = document.createElement("img");
img.setAttribute("alt","insert into del.icio.us");
img.setAttribute("src","http://del.icio.us/favicon.ico");
img.setAttribute("border","0");

newanchor.appendChild(img);
a.parentNode.insertBefore(newanchor,a);
a.parentNode.insertBefore(document.createTextNode(" "),a);

}
}


window.addEventListener("load", insertAnchors, false);

22 April 2007

Freebase !

I finaly received my invitation to join freebase. Freebase ,which was previously introduced by Tim O'Reilly, is a structured semantic wiki. I tested it today: this is a great product. I consider the whole site as a RDF/RDFS editor where you can define classes , properties and create some instances. In consequence, Freebase is far more structured than wikipedia.

The site comes with a complete API (MQL Metaweb Query Language(looks like SPARQL)) which can be used to query freebase and to create your own application (e.g. see CineSpin).

Example: searching for physicists born between 1800 and 1900:


{
"query":[{
"/people/person/date_of_birth":null,
"/people/person/date_of_birth<":"1900",
"/people/person/date_of_birth>=":"1800",
"limit":35,
"name":null,
"type":"/science/physicist"
}]
}


Result:


{
"result":[{
"/people/person/date_of_birth":"1879-03-14",
"name":"Albert Einstein",
"type":"/science/physicist"
},{
"/people/person/date_of_birth":"1878",
"name":"Lise Meitner",
"type":"/science/physicist"
},{
"/people/person/date_of_birth":"1867",
"name":"Marie Curie",
"type":"/science/physicist"
},{
"/people/person/date_of_birth":"1844",
"name":"Ludwig Boltzmann",
"type":"/science/physicist"
}],
"status":"/mql/status/ok"
}


Considering bioinformatics many types could be created (I've no time to play with this at this time ! ): defining Molecular Interactions, Biologists, etc...

Pierre

12 April 2007

Web2.0 and Science: A Presentation using SLIDY

(via Sun)Slidy is a purely web based presentation tool that can be displayed in a modern browser. No need to mail slides around the world and clutter email boxes, no need for the recipient to download a huge binary: just send someone a URL to your slide..

I've tested Slidy tonight by writing a short presentation about my thoughts on the web2.0 and science. You can read this presentation at:



Pierre

11 April 2007

How blast works ?

A few years ago, I wondered how blast was implemented: was there a way to play the binary file where the sequences were indexed ? I had a glance at the NCBI C toolkit but I was a little bit lost with all that source code. I asked the question via usenet and I recieved a mail from M. Dumontier who suggested me to have a look at the SLRI toolkit:

The Samuel Lunenfeld Research Institute (SLRI) Toolkit is a cross-platform toolkit for manipulating biological information. The SLRI toolkit is based mainly in C and derives many functions from the NCBI toolkit. The SLRI toolkit was developed mainly for data pertaining to protein structure and function but can be used to manipulate other data such as gene sequences.

Last sunday, I added a new short entry into wikipedia about formatdb and I wondered again how the software was implemented: what is the format of those files ? how are packaged the protein , the degenerate nucleotides ? could I implement a reader/writer with another language (java ?) ? Just for my own curiosity I would be interested to have some more information about how blast was implemented. Feel free to add some more information about this subject in wikipedia.

Pierre


PS: The problem with wikipedia via http://xkcd.com/ :-)

21 March 2007

Geni, Graphiz, Dot & Family Tree.

Geni is a genealogy-related social networking website launched in beta mode in January 2007. Since yesterday, the family tree can now be exported as a gedcom-xml file (alpha version).

The following xslt stylesheet transforms the gedcom file into a Graphiz/DOT input which can be used to generate the family tree.

Family Tree



<?xml version='1.0' ?>
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
<xsl:output method='text' omit-xml-declaration="yes" />

<xsl:template match="GEDCOM">
digraph &quot;G&quot; {
<xsl:apply-templates select="FamilyRec"/>
<xsl:apply-templates select="IndividualRec"/>
}
</xsl:template>

<xsl:template match="IndividualRec">
<xsl:value-of select="@Id"/>[ shape=box, label=&quot;<xsl:value-of select="IndivName/GivenName"/><xsl:text> </xsl:text><xsl:value-of select="IndivName/SurName"/> <xsl:if test="DeathStatus=&apos;dead;&apos;">(d)</xsl:if>&quot;

<xsl:choose>
<xsl:when test="Gender=&apos;M&apos;">
,color=blue
</xsl:when>
<xsl:when test="Gender=&apos;F&apos;">
,color=pink
</xsl:when>
<xsl:otherwise>
,color=black
</xsl:otherwise>
</xsl:choose>


];
</xsl:template>

<xsl:template match="FamilyRec">
<xsl:variable name="famId"><xsl:value-of select="@Id"/></xsl:variable>

<xsl:value-of select="$famId"/>[shape=point];

<xsl:if test="HusbFath">
<xsl:value-of select="HusbFath/Link/@Ref"/>-&gt;<xsl:value-of select="$famId"/>;
</xsl:if>

<xsl:if test="WifeMoth">
<xsl:value-of select="WifeMoth/Link/@Ref"/>-&gt;<xsl:value-of select="$famId"/>;
</xsl:if>

<xsl:for-each select="Child">
<xsl:value-of select="$famId"/>-&gt;<xsl:value-of select="Link/@Ref"/>;
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>



Pierre

22 February 2007

A Brief History Of Sciences

(Introduction copied from DBPedia): Wikipedia is the by far largest available encyclopedia on the Web. Wikipedia has the problem that its search capabilities are limited to full-text search, which only allows very limited access to this valuable knowledge-base.Semantic Web technologies enable expressive queries against structured information on the Web. The Semantic Web has the problem that there is not much RDF data online yet and that up-to-date terms and ontologies are missing for many application domains. The DBPedia project approaches both problems by extracting structured information from Wikipedia and by making this information available on the Semantic Web. A major feature of DBPedia is to enable sophisticated queries against Wikipedia using SPARQL. Extracting structured information from Wikipedia leads to quite astonishing query answering possibilities.

In February, the dbpedia dataset was available for download.

For example, here are the N3 statements about Francis Crick that were extracted from wikipeda with dbpedia.

<http://en.wikipedia.org/wiki/Francis_Crick>      <http://3ba.se/wikipedia/attributes/name> "Francis Crick" .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/image> "FrancisHarryComptonCrick.jpg" .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/caption> "Francis Harry Compton Crick" .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/birth_date> "1916068"^^<http://www.w3.org/2001/XMLSchema#Date> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/birth_place> <http://en.wikipedia.org/wiki/Weston_Favell> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/birth_place> <http://en.wikipedia.org/wiki/Northamptonshire> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/birth_place> <http://en.wikipedia.org/wiki/UK> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/residence> <http://upload.wikimedia.org/wikipedia/commons/a/ae/Flag_of_the_United_Kingdom.svg> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/residence> <http://en.wikipedia.org/wiki/UK> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/residence> <http://upload.wikimedia.org/wikipedia/commons/a/a4/Flag_of_the_United_States.svg> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/residence> <http://en.wikipedia.org/wiki/USA> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/nationality> "[[Image:Flag_of_the_United_Kingdom.svg|20px|]] [[England|English]]" .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/death_date> "20040728"^^<http://www.w3.org/2001/XMLSchema#Date> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/death_place> <http://en.wikipedia.org/wiki/San_Diego> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/death_place> <http://en.wikipedia.org/wiki/California> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/death_place> <http://en.wikipedia.org/wiki/USA> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/field> <http://en.wikipedia.org/wiki/Biophysics> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/work_institution> <http://en.wikipedia.org/wiki/Salk_Institute> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/alma_mater> "[[University College London]][[University of Cambridge]]" .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/doctoral_advisor> <http://en.wikipedia.org/wiki/Max_Perutz> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/doctoral_students> "None" .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/known_for> "[[DNA|DNA structure]], [[consciousness]]" .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://3ba.se/wikipedia/attributes/prizes> "[[Image:Nobel.png|20px]] [[Nobel Prize for Physiology or Medicine|Nobel Prize]] (1962)" .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://en.wikipedia.org/wiki/Template:infobox_scientist> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://www.w3.org/1999/02/22-rdf-syntax-ns#label> "Francis Crick" .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://en.wikipedia.org/wiki/Category:Nobel_laureates_in_Physiology_or_Medicine> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://en.wikipedia.org/wiki/Category:English_neuroscientists> .
<http://en.wikipedia.org/wiki/Francis_Crick> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://en.wikipedia.org/wiki/Category:English_humanists> .


Iv' been playing with this source of data to build a dynamic timeline of scientists. The person choosen was the one where I could find a date of birth/death (some people didn't have this information or the date was not parseable (e.g. "[[March 11]], [[1922]] ([[Istanbul]], [[Turkey]])") ord I only used the predicates that could be used to find the date. For example here are a few predicates that could be used to find the date of birth:
http://3ba.se/wikipedia/attributes/birth_date
http://3ba.se/wikipedia/attributes/birthdate
http://3ba.se/wikipedia/attributes/Birthdate
http://3ba.se/wikipedia/attributes/date_birth
http://3ba.se/wikipedia/attributes/datebirth
http://3ba.se/wikipedia/attributes/date_of_birth
http://3ba.se/wikipedia/attributes/dateofbirth
http://3ba.se/wikipedia/attributes/DateOfBirth
http://3ba.se/wikipedia/attributes/DATE_OF_BIRTH
http://en.wikipedia.org/wiki/Category:1945_births>
(...)


I also used relationships between persons that could be found in the database. e.g.:


<http://en.wikipedia.org/wiki/Hermann_Joseph_Muller> <http://3ba.se/wikipedia/attributes/teachers> <http://en.wikipedia.org/wiki/Thomas_Hunt_Morgan> .


The result is a java application called WikiStory.
It requires JAVA Webstart 1.6. You can use the following command line:

javaws http://www.urbigene.com/wikistory/wikistory.jnlp



WikiStory



Selecting one or more category will select all the people that belong to it.
Clicking on a person in the timeline will load the page from wikipedia.


The timeline can also be saved as a SVG picture. If you're using Firefox, you can see an example Here
geneticists


See also:

http://www.wikitimescale.org/index.php
http://meta.wikimedia.org/wiki/EasyTimeline
http://www.futureswatch.org/Timeline.htm
http://www.todayinsci.com/
http://www.perseus.tufts.edu/
http://dandelife.com/
http://www.timelineindex.com/content/home.php








Pierre

15 February 2007

Tips: Sending Batch Invitations to Nature-Network.

A few minutes ago, I was looking for an quick method to send batch invitations to join Nature Network to my colleagues. I found a solution using the cURL utility.


  1. Open firefox


  2. log in to Nature Network


  3. the site stores a cookie called '_session_id' on your browser. Open your Cookie Panel: Tools -> Options -> Privacy -> Cookies". Note the value of the cookie _session_id associated to the site network.nature.com


  4. use cURL to send the form.

    curl -L -b '_session_id=THE_VALUE_OF_YOUR_COOKIE' -d 'referral[name]=Name' -d 'referral[email]=nobody.nowhere@mycompagny.com' -d 'referral[message]=this is an invitation to another social network' -d 'commit=send' 'http://network.nature.com/referrals/create?locality='


    the option -L is used to follow any http redirection, -b set a cookie, -d set a key/value from the original html form. You can automatize this process using a simple loop over your addresses.



This solution worked fine at the time I wrote this post.

Pierre

network.nature.com is alive

.
A quick post: it seems that the global scientific social network network.nature.com global (previously known as Nature Network Boston) is now alive. I created two groups Bioinformatics and Semantic Web for the Life Sciences.

Pierre

30 January 2007

New blog: Beginning Python for Bioinformatics

Beginning Python for Bioinformatics is a new blog about... (guess what). The author's aim is to convert the book Beginning Perl for Bioinformatics into pyhton.

See also: Python course in Bioinformatics

Pierre