RITA

From Bioinformatics Software
Revision as of 13:33, 5 March 2012 by Dparks (talk | contribs)
Jump to navigationJump to search

Rapid identification of taxonomic assignments (RITA)

This program executes and combines the results of several BLAST algorithms with those produced by the composition-based Naive Bayes algorithm. Sequences that are classified early in the pipeline are not executed with later algorithms which greatly reduced the total runtime.

This work has been submitted for publication:

MacDonald NJ, Parks DH, and Beiko RG. Rapid identification of taxonomic assignments. Submitted 2011.

If you have any questions or bug reports, please let us know at <beiko@cs.dal.ca>.

Web Server

For smaller datasets, taxonomic attributions can be obtained with the RITA web server.

License

RITA is released under the Creative Commons Share-Alike Attribution 3.0 License.

Downloads

Rank-specific Setup

Prerequisites: You must have BLAST+ 2.2.21 or higher installed.

  • Unzip RITA:
 > unzip RITA_v1_0_0.zip
  • Download, unzip, and run FCP install (FCP_install.py) with '--protein ncbi_genomes.faa' flag:
 > unzip FCP_1_0_3.zip -d ./FCP
 > cd FCP
 > python FCP_install.py --protein ncbi_genomes.faa
  • Concatenate the files in the training/sequences folder of FCP into a single input nucleotide file (e.g. ncbi_genomes.fna):
 > cat ./training/sequences/*.fasta > ncbi_genomes.fna
  • RITA is designed to run over multiple BLAST databases in order to reduce memory consumption. Therefore, you should split both the nucleotide and protein files into X pieces using the splitfasta.py script in the

scripts directory (X can be 1 if you do not wish to split the files, we recommend X=10):

 > cd ../rita
 > mv ../FCP/ncbi_genomes.faa .
 > mv ../FCP/ncbi_genomes.fna . 
 > cd scripts
 > python splitfasta.py ../ncbi_genomes.fna 10
 > python splitfasta.py ../ncbi_genomes.faa 10
  • Create a nucleotide database with makeblastdb BLAST+ for each input ncbi_genomes.p*.fna:
 > makeblastdb -in "ncbi_genomes.p1.fna" -dbtype nucl
 > makeblastdb -in "ncbi_genomes.p2.fna" -dbtype nucl
 > ...
 > makeblastdb -in "ncbi_genomes.pX.fna" -dbtype nucl
  • Create a protein database with makeblastdb BLAST+ for each input ncbi_genomes.p*.faa.
 > makeblastdb -in "ncbi_genomes.p1.faa" -dbtype prot
 > makeblastdb -in "ncbi_genomes.p2.faa" -dbtype prot
 > ...
 > makeblastdb -in "ncbi_genomes.pX.faa" -dbtype prot
  • Set BLASTDB_PARTS to X in globalconfig.cfg and the name of the database to

<database_name>.p%%d (e.g. ncbi_genomes.p%%d.fna if this was your output BLAST database name) %%d is the placeholder for the database number identifier, 1..X.

  • Configure globalsettings.cfg appropriately for the above installation directories.
  • To use the UBLASTX classifier, you must also obtain a licensed copy of usearch and set up the configuration file appropriately.

Rank-specific example usage

 python rita.py --rank PHYLUM --pipeline NB_DCMEGABLAST,DCMEGABLAST_RATIO,NB_RATIO,NB_ML --query fragments.fasta --out results.txt

Note: Use the --jobid flag with a unique job identifier if running rita in parallel to ensure intermediate temporary files are not overwritten.

The above command will classify the fragments in 'fragments.fasta' at the rank of PHYLUM, using a pipeline that starts with the consensus of Naive Bayes and DCMEGABLAST, then the most confident DCMEGABLAST results, then the most confident Naive Bayes results and finally with the maximum likelihood NB prediction. Note that fragments are not attempted to be classified at a given step in the pipeline if they have already been classified at an earlier step (the order matters). See the Pipeline Components section below.

Rank-flexible setup

Prerequisites:

  • Install BioPython (needed for tree manipulation).
  • Install MOTHUR for 16S DNA alignments.
  • Install FastTree for building 16S trees.

To configure RITA for rank-flexible classifications follow these steps:

  • Follow the instructions for a rank-specific RITA installation given above.
  • Update globalsettings.cfg appropriately for the installation paths of MOTHUR and FastTree.
  • Build a trusted BLAST database of 16S sequences. We recommend using the hand-curated sequences from RDP.
 > makeblastdb -in "ncbi_genomes.pX.fna" -dbtype nucl
  • BLAST the complete genomes against the 16S database:
 > 
  • Use the get16s.py script to extract a single 16S sequence from each genome based on the best BLAST match:
 >
  • Align the 16S sequences with MOTHUR:
 >
  • Update the MOTHUR_16S_ALIGNMENT setting in globalsettings.cfg.

You can now use rank-flexible RITA.

Rank-flexible example usage

To run rank-flexible RITA, you must first generate a proxy file:

 python rita.py --buildproxy <sample_16s_fragments.fasta> --out proxy.txt

Then run rank-flexible RITA in the same way as rank-specific RITA, but specify the proxy file and the rank as FLEXIBLE

 python rita.py --proxy proxy.txt--rank FLEXIBLE --pipeline NB_DCMEGABLAST,DCMEGABLAST_RATIO,NB_RATIO,NB_ML --query fragments.fasta --out results.txt

For more information on how rank-flexible RITA works, please see the publication.

Pipeline Components

Included pipeline components (labellers) (specify with --pipeline A,B,C,...)

 NB_DCMEGABLAST     - labels fragments that agree at rank X for NB and DCMEGABLAST
 NB_BLASTN          - labels fragments that agree at rank X for NB and BLASTN
 NB_BLASTX          - labels fragments that agree at rank X for NB and BLASTX
 DCMEGABLAST_RATIO  - labels fragments that where the best DCMEGABLAST match evalue is at least Y times greater than the next best
 BLASTN_RATIO       - labels fragments that where the best BLASTN match evalue is at least Y times greater than the next best
 BLASTX_RATIO       - labels fragments that where the best BLASTX match evalue is at least Y times greater than the next best
 NB_RATIO           - labels fragments that where the best NB match likelihood is at least Y times greater than the next best
 NB_ML              - labels fragments that with the best NB match (if there are no ties)
 NULL_LABELLER      - labels all remaining fragments with NONE (this should only ever be the last step in the pipeline).

Contact Information

Suggestions, comments, and bug reports can be sent to Rob Beiko (beiko [at] cs.dal.ca). If reporting a bug, please provide as much information as possible and a simplified version of the data set which causes the bug. This will allow us to quickly resolve the issue.

Funding

The development and deployment of RITA has been supported by several organizations: