Skip to content

Instantly share code, notes, and snippets.

@pfaucon
Created December 28, 2013 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfaucon/8161308 to your computer and use it in GitHub Desktop.
Save pfaucon/8161308 to your computer and use it in GitHub Desktop.
wrapper for deltablast
...
Wrappers for the new NCBI BLAST+ tools (written in C++):
- NcbiblastpCommandline - Protein-Protein BLAST
- NcbideltablastCommandline - Protein-Protein domain enhanced lookup time accelerated blast
...
class NcbideltablastCommandline(_NcbiblastMain2SeqCommandline):
"""Create a commandline for the NCBI BLAST+ program deltablast (for proteins).
This is a wrapper for the deltablast command line command included in the NCBI BLAST+ software (not present in the original BLAST)
>>> from Bio.Blast.Applications import NcbideltablastCommandline
>>> cline = NcbideltablastCommandline(query="rosemary.pro", db="nr",
... evalue=0.001, remote=True, ungapped=True)
>>> cline
NcbideltablastCommandline(cmd='deltablast', query='rosemary.pro', db='nr', evalue=0.001, remote=True, ungapped=True)
>>> print(cline)
deltablast -query rosemary.pro -db nr -evalue 0.001 -remote -ungapped
You would typically run the command line with cline() or via the Python
subprocess module, as described in the Biopython tutorial.
"""
def __init__(self, cmd="deltablast", **kwargs):
self.parameters = [
#General search options:
_Option(["-task", "task"],
"Task to execute (string, or deltablast).",
checker_function=lambda value : value in ["deltablast"],
equate=False),
_Option(["-matrix", "matrix"],
"Scoring matrix name (default BLOSUM62)."),
_Option(["-threshold", "threshold"],
"Minimum word score such that the word is added to the "
"BLAST lookup table (float)",
equate=False),
_Option(["-comp_based_stats", "comp_based_stats"],
"""Use composition-based statistics (string, default 2, i.e. True).
0, F or f: no composition-based statistics
2, T or t, D or d : Composition-based score adjustment as in
Bioinformatics 21:902-911, 2005, conditioned on sequence properties
Note that tblastn also supports values of 1 and 3.""",
checker_function=lambda value : value in "0Ft2TtDd",
equate=False),
#Query filtering options:
_Option(["-seg", "seg"],
"""Filter query sequence with SEG (string).
Format: "yes", "window locut hicut", or "no" to disable.
Default is "12 2.2 2.5""",
equate=False),
#Extension options:
_Switch(["-ungapped", "ungapped"],
"Perform ungapped alignment only?"),
#Miscellaneous options: FIXME: these are probably not valid args
_Switch(["-use_sw_tback", "use_sw_tback"],
"Compute locally optimal Smith-Waterman alignments?"),
]
_NcbiblastMain2SeqCommandline.__init__(self, cmd, **kwargs)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment