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/ :-)