Skip to content

ryneches/raygun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

I got very tired of invoking formatdb and blastall from the command
line and parsing the results. So I wrote this very simple wrapper to
do it. This is not intended to be an efficient way of using BLAST.

It's dumb but quick. It's point-and-shoot, like a raygun should be.

INSPIRATIONAL QUOTE
-------------------

It's a poor blaster that doesn't point both ways.
    - Isaac Asimov


INSTALLING
----------

Do the usual python thing.

    $ cd raygun
    $ python setup.py install --prefix=/someplace/PYTHONPATH/knows/about


TESTS
-----

Tests are designed to be used with nose. 

    http://somethingaboutorange.com/mrl/projects/nose/

The tests (stupidly) depend on hard-coded paths to find the test data
files, so you have to run nosetests from the main module directory
(i.e., the one that has setup.py in it).

    $ cd raygun
    $ nosetests


USAGE
-----

    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.function_of_amazingness( hit[ 'subject' ] ) )
    
    hits = rg.blastseq( 'aaaggtttttagtccatcgacccta' )
    
    for hit in hits :
        results.append( cleverness.gee_wiz( hit[ 'length' ] ) )

    cleverness.output_phd_thesis( results )


FIELDS
------
    
    These are the dictionary keys for each hit result returned.
    
    query       : query record identifier
    subject     : subject record identifier
    percent_id  : percent identity
    length      : alignment length
    missmatches : number of mismatches
    gaps        : number of gaps
    qstart      : query sequence alignment start coordinate
    qend        : query sequence alignemnt end coordinate
    sstart      : subject sequence alignment start coordinate
    send        : subject sequence alingment end coordinate
    e           : e-value
    bit         : bit score


LEGAL STUFF
-----------

Copyright (c) 2010, Russell Neches
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

    * Redistributions of source code must retain the above copyright 
      notice, this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in 
      the documentation and/or other materials provided with the 
      distribution.

    * Neither the name of the University of California, Davis nor the 
      names of its contributors may be used to endorse or promote 
      products derived from this software without specific prior 
      written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

About

A simple python wrapper for NCBI BLAST.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages