Gene search applet: suggestions and code review needed

2009 March 31
by Einar

In the past months I’ve always wanted to write a small Plasma applet to aid me in some boring tasks as a bioinformatician. One example (for the non-scientific crowd out there) is when I find a specific gene out of my analysis work which I want to take a look at. I am often lazy, so instead of firing up the browser to look at the online resources, I wanted to write something which could access said resources programmatically.

I found a way thanks to the Biopython project, which offers a Python module to access the resources of the National Center for Biotechnology Information (NCBI) by providing an interface to their EUtils. Since the back-end was already taken care of, almost, at least, I sought to write a small Plasma applet. Which is what I’m presenting today. It’s written in Python, and uses the Python ScriptEngine to work. Currently, it searches the “Gene” database at NCBI by inputting the “Entrez Gene IDs”, that are numerical IDs that uniquely identify a gene record, and returns name, official symbol, organism, and a description if it’s present. It does not support anything else (see below).

The code lives in a git repository at github. WARNING: The code may be a complete mess (I’m not too well versed in GUI stuff, I mostly do text file manipulation) If you are so daring, you can obtain and install it in a very simple manner:

git clone git://github.com/cswegger/plasma-genesearch.git
cd plasma-genesearch
zip -r ../plasma-genesearch.plasmoid *
plasmapkg -i ../plasma-genesearch.plasmoid

After that you will see an “Entrez Gene Searcher” in your add applets dialog. Once added, it’ll look like this:

Gene searcher image

Pretty horrible, isn’t it? Well, once you get past that, you can input an ID (only IDs will work for now) in the text field (which doesn’t clear the text: see further on) and push “Go!”. The following is an example with ID 10000, which corresponds to the human gene AKT3:

Gene search results image

“Search again” will bring you back to the search form.

Now, what has this to do with Planet KDE? Well, I’m asking for some code review from the community, if it’s possible, and suggestions to improve the horrid default look. I am especially interested in layouting, since I did not quite understand how it works, I mean, it should not work and it does….

Other things that need to be improved are:

  • The Plasma.TextEdit is not cleared upon clicking. Is there a signal I can catch for that, so I can connect it to clear()?
  • Proper searching. Bio.Entrez already does this: what I need is a way to display the records properly.
  • A way to link the names to URLs, and have them open in Konqueror.

That should be it. I hope to work on it some more next weekend….

3 Responses leave one →
  1. 2009 April 2
    Kristof Bal permalink

    Really cool to see a bioinformatician in the wild, and nice to see biology integrated into KDE ;)

    I’m currently in the proces of making a decision for me studies: it’s between Chemistry and Biochemistry (and in BiCh you get bioinformatics too).

  2. 2009 April 2

    @Kristof

    If you’re heading into bioinformatics, I would suggest to get a reasonable biological background and at the same time some good coding background. The biological background is important because even though you won’t be able to know everything, you will be able to grasp better where you could direct some analysis work.

  3. 2009 April 3
    Kristof Bal permalink

    I’m not really focusing on Bioinformatics, I’ll just have it as a subject during my studies. I do believe that biochemistry is ok for me – I like biology the most when it’s about genes, cells and chemistry in the cells. In chemistry, I prefer carbonchemistry. In the University of Antwerp, bioinformatics is a subject during biochemistry (and I guess also during Biology), so it’s interesting to see someone having it as his daily job.

    Cheers
    Kristof

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS