10 June 2011

Vectorial drawing with the UCSC Genome browser and inkscape

Select a view in the UCSC genome browser. Export it (top menu) it as Encapsulated Postscript (EPS)



Import the EPS file in inkscape


'Ungroup' the objects and have fun.


That's it.

Pierre

07 June 2011

Handling a BigWig file from Java+JNI : my notebook

In a previous post I've shown how to use a Java JNI interface to control a NCURSES panel from a java program.
I'll show here how to use java JNI to call the C methods developped by Jim Kent's team at UCSC to handle a BigWig file.

The Makefile for compiling the following sources is defined below:


Export the LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/path/to/current/directory


Download Jim Kent's sources from http://hgdownload.cse.ucsc.edu/admin/jksrc.zip. See the README file to compile jksrc/lib and jksrc/jkOwnLib.

The java source BigWig.java declares seven natives JNI methods. They will call the C methods for opening and closing the bigWig file, and getting the summaries in a given genomic range.


After compiling the java source, the following C header is generated with javah:


The C source implements the native methods defined in the java source. The code was inspired from ${JKENTSRC}/src/utils/bigWigSummary/bigWigSummary.c.


Download a bigwig file for a test: http://hgdownload.cse.ucsc.edu/goldenPath/hg19/encodeDCC/wgEncodeMapability/wgEncodeCrgMapabilityAlign100mer.bigWig.

The main method in BigWig.java contains.a test:
java BigWig wgEncodeCrgMapabilityAlign100mer.bigWig
0.394749239542279

And here is the original output of the utility 'bigWigSummary':
bigWigSummary wgEncodeCrgMapabilityAlign100mer.bigWig -type=mean chr1 1 1000000 1
0.394749


That's it,

Piere

04 June 2011

Pubmed: sorting the articles on the number of times they've been cited

In 2008 I used www.eigenfactor.org/ to sort a set of Pubmed articles on the impact factor of the journal. In the current post I will show I've used NCBI ELink to sort the articles on the number of times they've have been cited in some other articles in pubmed-central.

The NCBI ELink API checks for the existence of an external or Related Articles link from a list of one or more primary IDs. It can be used to retrieve the article in pubmed central citing a given PMID.
For example, the the following uri: http://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?retmode=xml&dbfrom=pubmed&id=19755503&cmd=neighbor returns the 3 articles that cited the Gene Wiki paper:

(...) <LinkSetDb>
<DbTo>pubmed</DbTo>
<LinkName>pubmed_pubmed_citedin</LinkName>
<Link>
<Id>21516242</Id>
</Link>
<Link>
<Id>21062808</Id>
</Link>
<Link>
<Id>20334642</Id>
</Link>
</LinkSetDb>
(...)
.

I wrote a java program using this resource to sort the articles on the number of time they have been cited. The program is available on github at: .

Example

Let's sort the articles published in the 2005 NAR-Database Issue:
java -jar dist/pubmedsortbycitations.jar -c -L ALL -e '"Nucleic Acids Res"[JOUR] "Database issue"[ISS] 2005[PDAT]' > sorted.xml
OR
java -jar dist/pubmedsortbycitations.jar -c -L ALL pubmed_result_saved_as.xml > sorted.xml

The output is a sorted set of XML pubmed records.
The most cited article (290 references) is The Universal Protein Resource (UniProt)..
Some articles have never been cited: e.g.: Metagrowth: a new resource for the building of metabolic hypotheses in microbiology.

The '-c' option in the command line enables the program to insert a new XML node containing the PMID of the articles citing one article:
(...)
<ArticleId IdType="pubmed">15608167</ArticleId>
<ArticleId IdType="pmc">PMC540024</ArticleId>
</ArticleIdList>
</PubmedData>
<CitedBy count="290">
<PMID>15608199</PMID>
<PMID>15608238</PMID>
<PMID>15608243</PMID>
<PMID>15769290</PMID>
<PMID>15888679</PMID>
<PMID>15980452</PMID>
(...)
<PMID>21450054</PMID>
<PMID>21453542</PMID>
<PMID>21544166</PMID>
</CitedBy>
</PubmedArticle>



That's it,

Pierre