Russell's Blog

New. Improved. Stays crunchy in milk.

raygun : a simple NCBI BLAST wrapper for Python

Posted by Russell on October 25, 2010 at 11:42 a.m.
Things have been a little quiet on Vort.org for the last couple of weeks, but a lot of frantic activity has been going on behind the peaceful lack blog updates. When I returned from Kamchatka, Jonathan had a little present for me -- he took the DNA from the 2005 Uzon field season for Arkashin and Zavarzin hotsprings, and ran a whole lane of paired-end sequencing on one of our Illumina machines. Charlie made some really beautiful libraries, and the data is really, really excellent. For the last couple of weeks, I've been trying to do justice to it.

I'm not quite ready to talk about what I've been finding, but I thought I would take a moment to share a little tool I wrote along the way. It's made my life a lot easier, and maybe other people could get some use out of it.

It's called raygun, a very simple Python interface for running local NCBI BLAST queries. You initialize a RayGun object with a FASTA file containing your target sequences, and then you can query it with strings or other FASTA files. It parses the BLAST output into a list of dictionary objects, so that you can get right to work.

It doesn't take a lot of scripting chops to do this without an interface, of course, and there are other Python tools for running BLAST queries. The advantage of raygun over either the DIY approach or the BioPython approach is that raygun is extremely simple to use. I wanted something that would basically be point-and-shoot :

import raygun
import cleverness

rg = raygun.RayGun( 'ZOMG_DNA_OMG_OMG.fa' )

hits = rg.blastfile( 'very_clever_query.fa' )

results = []
for hit in hits :
    results.append( cleverness.good_idea( hit[ 'subject' ] ) )

cleverness.output_phd_thesis( results )
Unfortunately, you must furnish your own implementation of the cleverness module.

I designed raygun is with interactive use in mind, particularly with ipython (by the way, if you do a lot of work in python and you're not using ipython, you're being silly). The code is available on github.

Ema on May 13, 2013 at 4:08 p.m.

Per r4 l'assicurazione supplementare per gli articoli più costosi per essere coperti.

scfs on May 13, 2013 at 6:18 p.m.

Cool article it's really. Friend on mine has long been awaiting just for this content.
garcinia cambogia reviews

Huge Link Directory on May 14, 2013 at 4:29 p.m.

I'm not quite ready to talk about what I've been finding, but I thought I would take a moment to share a little tool I wrote along the way.
Huge Link Directory

phone detective on May 15, 2013 at 12:58 a.m.

They are a bit more pricey than poor ones but you can rest assured that they are likely to stick with you for extended. phone detective

Alexa on May 15, 2013 at 10:40 a.m.

I'm not quite ready to talk about what I've been finding, but I thought I would take a moment to share a little tool I wrote along the way. It's made my life a lot easier, and maybe other people could get some use out of it.

Affordable Logo Design

asdasd on May 16, 2013 at 3:48 p.m.

Nice knowledge gaining article. This post is really the best on this valuable topic.
restaurant in clarke quay

garcinia cambogia on May 16, 2013 at 10:11 p.m.

I stumbled onto your blog and read a few post. I like your style of writing...garcinia cambogia

kimm on May 19, 2013 at 2:29 p.m.

This is just the information I am finding everywhere. Thanks for your blog, I just subscribe your blog. This is a nice blog.. cute wedding stamps

coach outlet on May 19, 2013 at 9:26 p.m.

A blog is something that can Coach Factory only benefit you and not hurt you, most of Coach Factory Online air max the time that is. Once you establish a presence online via louis vuitton outlet blog you then create more potential followers for you and your business that you didn’t previously have. You see there is much to gain when you create a blog, so read through this article and see how blogging can help you.



Choose a domain name that immediately tells potential readers what your blog is about. coach outlet It’s not likely that you louboutin are going to ralph lauren be able to procure a name like but, your blog is more likely to be about some particular aspect Hogan of your subject. Incorporate that aspect into the domain name along with your louis vuitton Coach Factory Outlet overall focus.



Don’t be afraid to stretch out your louis vuitton hand and ask your reader for a donation. Your loyal readers, in particular, will be likely to donate some to coach outlet your cause. If your blog is valuable enough, people will realize it. They will also realize that, longchamp not Coach Factory louis vuitton outlet Online only does Coach Outlet it cost you money to produce your blog, your time is valuable.



Make sure that you have a blog mailing list started early. The sooner you get this started, the more time you coach outlet will have gucci to make that list larger. Once your blog is more established, this list will be used to bring in money, and you will be thankful that you already took care of this.

Ignore this field:
 optional; will not be displayed
Don't put anything in this field:
 optional
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p>.