Giter Site home page Giter Site logo

alignments's Introduction

alignments

This repository contains a collection of python scripts for managing the results of Blast searches.

blast.py is a simple script for running blast searches. There may be problems with limiting a search by taxonomy id.

seqdbutils.py contains several handy functions:

  • gi2taxid is function to search the file gi_taxid_prot.dmp for a gi identifier, and find the taxonomic ID. (integer -> integer)

  • taxid2name is a function to search the BioSQL database for the name of a taxon, given its integer identifier (integer -> string).

  • genInfo2fasta is a function that retrieves the fasta sequence for any integer gi number (integer -> text).

  • getparenttaxid retrieves the taxon id of the parent of the provided taxon, to enable traversing the taxonomic tree (integer -> integer).

  • blast2fasta extracts gi numbers from XML blast output, and retrieves the fasta-formatted sequence info for each gi number (XML file -> FASTA file).

  • taxid2rank retrieves the rank of a taxon (eg. kingdom, order, genus, species, superfamily, parvorder, subspieces, etc.) (integer -> string)

  • taxid2cladename(taxid,level) traverses the taxonomic tree to find the taxonomic name of a particular rank level. (int,string -> string) taxid2clade(9606,'genus') -> Homo taxid2cladename(9606,'superkingdom') -> Eukaryota

  • browsetaxonomy(taxid) traverses the taxonomic tree to find the names of all the clades containing this taxon (int -> string)

  • filterFastaColumnsByFirstSeq(infile,outfile,startres,endres) removes columns from a multiple sequence alignment, preserving only those corresponding to a given residue range in the first sequence.

To do:

Parse CSV of blast output Calculate %coverage from q.start and q.end fields: query id, subject ids, % identity, % positives, alignment length, mismatches, gap opens, q. start, q. end, s. start, s. end, evalue, bit score somehow parse subject IDs to determine whether you've seen that species before. (gi2taxid helps) If so, compare coverage to prior sequence from same species. If coverage is more, replace prior sequence in dictionary keyed by species.

Useful links: [1] ftp://ftp.ncbi.nih.gov/pub/taxonomy/

http://www.mathworks.com/help/bioinfo/examples/performing-a-metagenomic-analysis-of-a-sargasso-sea-sample.html

alignments's People

Contributors

betainverse avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.