Back to index

python-biopython  1.60
Classes | Functions
Bio.Blast.NCBIStandalone Namespace Reference

Classes

class  LowQualityBlastError
class  ShortQueryBlastError
class  _Scanner
class  BlastParser
class  PSIBlastParser
class  _HeaderConsumer
class  _DescriptionConsumer
class  _AlignmentConsumer
class  _HSPConsumer
class  _DatabaseReportConsumer
class  _ParametersConsumer
class  _BlastConsumer
class  _PSIBlastConsumer
class  Iterator
class  _BlastErrorConsumer
class  BlastErrorParser

Functions

def blastall
def blastpgp
def rpsblast
def _re_search
def _get_cols
def _safe_int
def _safe_float
def _invoke_blast
def _security_check_parameters

Class Documentation

class Bio::Blast::NCBIStandalone::LowQualityBlastError
Error caused by running a low quality sequence through BLAST.

When low quality sequences (like GenBank entries containing only
stretches of a single nucleotide) are BLASTed, they will result in
BLAST generating an error and not being able to perform the BLAST.
search. This error should be raised for the BLAST reports produced
in this case.

Definition at line 64 of file NCBIStandalone.py.

class Bio::Blast::NCBIStandalone::ShortQueryBlastError
Error caused by running a short query sequence through BLAST.

If the query sequence is too short, BLAST outputs warnings and errors:
Searching[blastall] WARNING:  [000.000]  AT1G08320: SetUpBlastSearch failed.
[blastall] ERROR:  [000.000]  AT1G08320: Blast: 
[blastall] ERROR:  [000.000]  AT1G08320: Blast: Query must be at least wordsize
done

This exception is raised when that condition is detected.

Definition at line 75 of file NCBIStandalone.py.


Function Documentation

def Bio.Blast.NCBIStandalone._get_cols (   line,
  cols_to_get,
  ncols = None,
  expected = {} 
) [private]

Definition at line 2021 of file NCBIStandalone.py.

02021 
02022 def _get_cols(line, cols_to_get, ncols=None, expected={}):
02023     cols = line.split()
02024 
02025     # Check to make sure number of columns is correct
02026     if ncols is not None and len(cols) != ncols:
02027         raise ValueError("I expected %d columns (got %d) in line\n%s" \
02028                          % (ncols, len(cols), line))
02029 
02030     # Check to make sure columns contain the correct data
02031     for k in expected:
02032         if cols[k] != expected[k]:
02033             raise ValueError("I expected '%s' in column %d in line\n%s" \
02034                              % (expected[k], k, line))
02035 
02036     # Construct the answer tuple
02037     results = []
02038     for c in cols_to_get:
02039         results.append(cols[c])
02040     return tuple(results)
02041 

Here is the caller graph for this function:

def Bio.Blast.NCBIStandalone._invoke_blast (   cline) [private]
Start BLAST and returns handles for stdout and stderr (PRIVATE).

Expects a command line wrapper object from Bio.Blast.Applications

Definition at line 2080 of file NCBIStandalone.py.

02080 
02081 def _invoke_blast(cline):
02082     """Start BLAST and returns handles for stdout and stderr (PRIVATE).
02083 
02084     Expects a command line wrapper object from Bio.Blast.Applications
02085     """
02086     import subprocess, sys
02087     blast_cmd = cline.program_name
02088     if not os.path.exists(blast_cmd):
02089         raise ValueError("BLAST executable does not exist at %s" % blast_cmd)
02090     #We don't need to supply any piped input, but we setup the
02091     #standard input pipe anyway as a work around for a python
02092     #bug if this is called from a Windows GUI program.  For
02093     #details, see http://bugs.python.org/issue1124861
02094     blast_process = subprocess.Popen(str(cline),
02095                                      stdin=subprocess.PIPE,
02096                                      stdout=subprocess.PIPE,
02097                                      stderr=subprocess.PIPE,
02098                                      universal_newlines=True,
02099                                      shell=(sys.platform!="win32"))
02100     blast_process.stdin.close()
02101     return blast_process.stdout, blast_process.stderr
02102 

Here is the caller graph for this function:

def Bio.Blast.NCBIStandalone._re_search (   regex,
  line,
  error_msg 
) [private]

Definition at line 2015 of file NCBIStandalone.py.

02015 
02016 def _re_search(regex, line, error_msg):
02017     m = re.search(regex, line)
02018     if not m:
02019         raise ValueError(error_msg)
02020     return m.groups()

Here is the caller graph for this function:

def Bio.Blast.NCBIStandalone._safe_float (   str) [private]

Definition at line 2063 of file NCBIStandalone.py.

02063 
02064 def _safe_float(str):
02065     # Thomas Rosleff Soerensen (rosleff@mpiz-koeln.mpg.de) noted that
02066     # float('e-172') does not produce an error on his platform.  Thus,
02067     # we need to check the string for this condition.
02068     
02069     # Sometimes BLAST leaves of the '1' in front of an exponent.
02070     if str and str[0] in ['E', 'e']:
02071         str = '1' + str
02072     try:
02073         return float(str)
02074     except ValueError:
02075         # Remove all commas from the string
02076         str = str.replace(',', '')
02077     # try again.
02078     return float(str)
02079 

Here is the caller graph for this function:

def Bio.Blast.NCBIStandalone._safe_int (   str) [private]

Definition at line 2042 of file NCBIStandalone.py.

02042 
02043 def _safe_int(str):
02044     try:
02045         return int(str)
02046     except ValueError:
02047         # Something went wrong.  Try to clean up the string.
02048         # Remove all commas from the string
02049         str = str.replace(',', '')
02050     # try again after removing commas.
02051     # Note int() will return a long rather than overflow
02052     try:
02053         return int(str)
02054     except ValueError:
02055         pass
02056     # Call float to handle things like "54.3", note could lose precision, e.g.
02057     # >>> int("5399354557888517312")
02058     # 5399354557888517312
02059     # >>> int(float("5399354557888517312"))
02060     # 5399354557888517120
02061     return int(float(str))
02062 

Here is the caller graph for this function:

Look for any attempt to insert a command into a parameter.

e.g. blastall(..., matrix='IDENTITY -F 0; rm -rf /etc/passwd')

Looks for ";" or "&&" in the strings (Unix and Windows syntax
for appending a command line), or ">", "<" or "|" (redirection)
and if any are found raises an exception.

Definition at line 2103 of file NCBIStandalone.py.

02103 
02104 def _security_check_parameters(param_dict):
02105     """Look for any attempt to insert a command into a parameter.
02106 
02107     e.g. blastall(..., matrix='IDENTITY -F 0; rm -rf /etc/passwd')
02108 
02109     Looks for ";" or "&&" in the strings (Unix and Windows syntax
02110     for appending a command line), or ">", "<" or "|" (redirection)
02111     and if any are found raises an exception.
02112     """
02113     for key, value in param_dict.iteritems():
02114         str_value = str(value) # Could easily be an int or a float
02115         for bad_str in [";", "&&", ">", "<", "|"]:
02116             if bad_str in str_value:
02117                 raise ValueError("Rejecting suspicious argument for %s" % key)

Here is the caller graph for this function:

def Bio.Blast.NCBIStandalone.blastall (   blastcmd,
  program,
  database,
  infile,
  align_view = '7',
  keywds 
)
Execute and retrieve data from standalone BLASTPALL as handles (OBSOLETE).

NOTE - This function is obsolete, you are encouraged to the command
line wrapper Bio.Blast.Applications.BlastallCommandline instead.

Execute and retrieve data from blastall.  blastcmd is the command
used to launch the 'blastall' executable.  program is the blast program
to use, e.g. 'blastp', 'blastn', etc.  database is the path to the database
to search against.  infile is the path to the file containing
the sequence to search with.

The return values are two handles, for standard output and standard error.

You may pass more parameters to **keywds to change the behavior of
the search.  Otherwise, optional values will be chosen by blastall.
The Blast output is by default in XML format. Use the align_view keyword
for output in a different format.

    Scoring
matrix              Matrix to use.
gap_open            Gap open penalty.
gap_extend          Gap extension penalty.
nuc_match           Nucleotide match reward.  (BLASTN)
nuc_mismatch        Nucleotide mismatch penalty.  (BLASTN)
query_genetic_code  Genetic code for Query.
db_genetic_code     Genetic code for database.  (TBLAST[NX])

    Algorithm
gapped              Whether to do a gapped alignment. T/F (not for TBLASTX)
expectation         Expectation value cutoff.
wordsize            Word size.
strands             Query strands to search against database.([T]BLAST[NX])
keep_hits           Number of best hits from a region to keep.
xdrop               Dropoff value (bits) for gapped alignments.
hit_extend          Threshold for extending hits.
region_length       Length of region used to judge hits.
db_length           Effective database length.
search_length       Effective length of search space.

    Processing
filter              Filter query sequence for low complexity (with SEG)?  T/F
believe_query       Believe the query defline.  T/F
restrict_gi         Restrict search to these GI's.
nprocessors         Number of processors to use.
oldengine           Force use of old engine T/F

    Formatting
html                Produce HTML output?  T/F
descriptions        Number of one-line descriptions.
alignments          Number of alignments.
align_view          Alignment view.  Integer 0-11,
                    passed as a string or integer.
show_gi             Show GI's in deflines?  T/F
seqalign_file       seqalign file to output.
outfile             Output file for report.  Filename to write to, if
                    ommitted standard output is used (which you can access
                    from the returned handles).

Definition at line 1667 of file NCBIStandalone.py.

01667 
01668 def blastall(blastcmd, program, database, infile, align_view='7', **keywds):
01669     """Execute and retrieve data from standalone BLASTPALL as handles (OBSOLETE).
01670     
01671     NOTE - This function is obsolete, you are encouraged to the command
01672     line wrapper Bio.Blast.Applications.BlastallCommandline instead.
01673 
01674     Execute and retrieve data from blastall.  blastcmd is the command
01675     used to launch the 'blastall' executable.  program is the blast program
01676     to use, e.g. 'blastp', 'blastn', etc.  database is the path to the database
01677     to search against.  infile is the path to the file containing
01678     the sequence to search with.
01679 
01680     The return values are two handles, for standard output and standard error.
01681 
01682     You may pass more parameters to **keywds to change the behavior of
01683     the search.  Otherwise, optional values will be chosen by blastall.
01684     The Blast output is by default in XML format. Use the align_view keyword
01685     for output in a different format.
01686     
01687         Scoring
01688     matrix              Matrix to use.
01689     gap_open            Gap open penalty.
01690     gap_extend          Gap extension penalty.
01691     nuc_match           Nucleotide match reward.  (BLASTN)
01692     nuc_mismatch        Nucleotide mismatch penalty.  (BLASTN)
01693     query_genetic_code  Genetic code for Query.
01694     db_genetic_code     Genetic code for database.  (TBLAST[NX])
01695 
01696         Algorithm
01697     gapped              Whether to do a gapped alignment. T/F (not for TBLASTX)
01698     expectation         Expectation value cutoff.
01699     wordsize            Word size.
01700     strands             Query strands to search against database.([T]BLAST[NX])
01701     keep_hits           Number of best hits from a region to keep.
01702     xdrop               Dropoff value (bits) for gapped alignments.
01703     hit_extend          Threshold for extending hits.
01704     region_length       Length of region used to judge hits.
01705     db_length           Effective database length.
01706     search_length       Effective length of search space.
01707 
01708         Processing
01709     filter              Filter query sequence for low complexity (with SEG)?  T/F
01710     believe_query       Believe the query defline.  T/F
01711     restrict_gi         Restrict search to these GI's.
01712     nprocessors         Number of processors to use.
01713     oldengine           Force use of old engine T/F
01714 
01715         Formatting
01716     html                Produce HTML output?  T/F
01717     descriptions        Number of one-line descriptions.
01718     alignments          Number of alignments.
01719     align_view          Alignment view.  Integer 0-11,
01720                         passed as a string or integer.
01721     show_gi             Show GI's in deflines?  T/F
01722     seqalign_file       seqalign file to output.
01723     outfile             Output file for report.  Filename to write to, if
01724                         ommitted standard output is used (which you can access
01725                         from the returned handles).
01726     """
01727 
01728     _security_check_parameters(keywds)
01729 
01730     att2param = {
01731         'matrix' : '-M',
01732         'gap_open' : '-G',
01733         'gap_extend' : '-E',
01734         'nuc_match' : '-r',
01735         'nuc_mismatch' : '-q',
01736         'query_genetic_code' : '-Q',
01737         'db_genetic_code' : '-D',
01738 
01739         'gapped' : '-g',
01740         'expectation' : '-e',
01741         'wordsize' : '-W',
01742         'strands' : '-S',
01743         'keep_hits' : '-K',
01744         'xdrop' : '-X',
01745         'hit_extend' : '-f',
01746         'region_length' : '-L',
01747         'db_length' : '-z',
01748         'search_length' : '-Y',
01749         
01750         'program' : '-p',
01751         'database' : '-d',
01752         'infile' : '-i',
01753         'filter' : '-F',
01754         'believe_query' : '-J',
01755         'restrict_gi' : '-l',
01756         'nprocessors' : '-a',
01757         'oldengine' : '-V',
01758 
01759         'html' : '-T',
01760         'descriptions' : '-v',
01761         'alignments' : '-b',
01762         'align_view' : '-m',
01763         'show_gi' : '-I',
01764         'seqalign_file' : '-O',
01765         'outfile' : '-o',
01766         }
01767     import warnings
01768     warnings.warn("This function is obsolete, you are encouraged to the command line wrapper Bio.Blast.Applications.BlastallCommandline instead.", PendingDeprecationWarning)
01769     from Applications import BlastallCommandline
01770     cline = BlastallCommandline(blastcmd)
01771     cline.set_parameter(att2param['program'], program)
01772     cline.set_parameter(att2param['database'], database)
01773     cline.set_parameter(att2param['infile'], infile)
01774     cline.set_parameter(att2param['align_view'], str(align_view))
01775     for key, value in keywds.iteritems():
01776         cline.set_parameter(att2param[key], str(value))
01777     return _invoke_blast(cline)
01778 

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone.blastpgp (   blastcmd,
  database,
  infile,
  align_view = '7',
  keywds 
)
Execute and retrieve data from standalone BLASTPGP as handles (OBSOLETE).

NOTE - This function is obsolete, you are encouraged to the command
line wrapper Bio.Blast.Applications.BlastpgpCommandline instead.

Execute and retrieve data from blastpgp.  blastcmd is the command
used to launch the 'blastpgp' executable.  database is the path to the
database to search against.  infile is the path to the file containing
the sequence to search with.

The return values are two handles, for standard output and standard error.

You may pass more parameters to **keywds to change the behavior of
the search.  Otherwise, optional values will be chosen by blastpgp.
The Blast output is by default in XML format. Use the align_view keyword
for output in a different format.

    Scoring
matrix              Matrix to use.
gap_open            Gap open penalty.
gap_extend          Gap extension penalty.
window_size         Multiple hits window size.
npasses             Number of passes.
passes              Hits/passes.  Integer 0-2.

    Algorithm
gapped              Whether to do a gapped alignment.  T/F
expectation         Expectation value cutoff.
wordsize            Word size.
keep_hits           Number of beset hits from a region to keep.
xdrop               Dropoff value (bits) for gapped alignments.
hit_extend          Threshold for extending hits.
region_length       Length of region used to judge hits.
db_length           Effective database length.
search_length       Effective length of search space.
nbits_gapping       Number of bits to trigger gapping.
pseudocounts        Pseudocounts constants for multiple passes.
xdrop_final         X dropoff for final gapped alignment.
xdrop_extension     Dropoff for blast extensions.
model_threshold     E-value threshold to include in multipass model.
required_start      Start of required region in query.
required_end        End of required region in query.

    Processing
XXX should document default values
program             The blast program to use. (PHI-BLAST)
filter              Filter query sequence  for low complexity (with SEG)?  T/F
believe_query       Believe the query defline?  T/F
nprocessors         Number of processors to use.

    Formatting
html                Produce HTML output?  T/F
descriptions        Number of one-line descriptions.
alignments          Number of alignments.
align_view          Alignment view.  Integer 0-11,
                    passed as a string or integer.
show_gi             Show GI's in deflines?  T/F
seqalign_file       seqalign file to output.
align_outfile       Output file for alignment.
checkpoint_outfile  Output file for PSI-BLAST checkpointing.
restart_infile      Input file for PSI-BLAST restart.
hit_infile          Hit file for PHI-BLAST.
matrix_outfile      Output file for PSI-BLAST matrix in ASCII.
align_outfile       Output file for alignment.  Filename to write to, if
                    ommitted standard output is used (which you can access
                    from the returned handles).

align_infile        Input alignment file for PSI-BLAST restart.

Definition at line 1779 of file NCBIStandalone.py.

01779 
01780 def blastpgp(blastcmd, database, infile, align_view='7', **keywds):
01781     """Execute and retrieve data from standalone BLASTPGP as handles (OBSOLETE).
01782 
01783     NOTE - This function is obsolete, you are encouraged to the command
01784     line wrapper Bio.Blast.Applications.BlastpgpCommandline instead.
01785     
01786     Execute and retrieve data from blastpgp.  blastcmd is the command
01787     used to launch the 'blastpgp' executable.  database is the path to the
01788     database to search against.  infile is the path to the file containing
01789     the sequence to search with.
01790 
01791     The return values are two handles, for standard output and standard error.
01792 
01793     You may pass more parameters to **keywds to change the behavior of
01794     the search.  Otherwise, optional values will be chosen by blastpgp.
01795     The Blast output is by default in XML format. Use the align_view keyword
01796     for output in a different format.
01797 
01798         Scoring
01799     matrix              Matrix to use.
01800     gap_open            Gap open penalty.
01801     gap_extend          Gap extension penalty.
01802     window_size         Multiple hits window size.
01803     npasses             Number of passes.
01804     passes              Hits/passes.  Integer 0-2.
01805 
01806         Algorithm
01807     gapped              Whether to do a gapped alignment.  T/F
01808     expectation         Expectation value cutoff.
01809     wordsize            Word size.
01810     keep_hits           Number of beset hits from a region to keep.
01811     xdrop               Dropoff value (bits) for gapped alignments.
01812     hit_extend          Threshold for extending hits.
01813     region_length       Length of region used to judge hits.
01814     db_length           Effective database length.
01815     search_length       Effective length of search space.
01816     nbits_gapping       Number of bits to trigger gapping.
01817     pseudocounts        Pseudocounts constants for multiple passes.
01818     xdrop_final         X dropoff for final gapped alignment.
01819     xdrop_extension     Dropoff for blast extensions.
01820     model_threshold     E-value threshold to include in multipass model.
01821     required_start      Start of required region in query.
01822     required_end        End of required region in query.
01823 
01824         Processing
01825     XXX should document default values
01826     program             The blast program to use. (PHI-BLAST)
01827     filter              Filter query sequence  for low complexity (with SEG)?  T/F
01828     believe_query       Believe the query defline?  T/F
01829     nprocessors         Number of processors to use.
01830 
01831         Formatting
01832     html                Produce HTML output?  T/F
01833     descriptions        Number of one-line descriptions.
01834     alignments          Number of alignments.
01835     align_view          Alignment view.  Integer 0-11,
01836                         passed as a string or integer.
01837     show_gi             Show GI's in deflines?  T/F
01838     seqalign_file       seqalign file to output.
01839     align_outfile       Output file for alignment.
01840     checkpoint_outfile  Output file for PSI-BLAST checkpointing.
01841     restart_infile      Input file for PSI-BLAST restart.
01842     hit_infile          Hit file for PHI-BLAST.
01843     matrix_outfile      Output file for PSI-BLAST matrix in ASCII.
01844     align_outfile       Output file for alignment.  Filename to write to, if
01845                         ommitted standard output is used (which you can access
01846                         from the returned handles).
01847 
01848     align_infile        Input alignment file for PSI-BLAST restart.
01849     
01850     """
01851 
01852     import warnings
01853     warnings.warn("This function is obsolete, you are encouraged to the command line wrapper Bio.Blast.Applications.BlastpgpCommandline instead.", PendingDeprecationWarning)
01854     _security_check_parameters(keywds)
01855 
01856     att2param = {
01857         'matrix' : '-M',
01858         'gap_open' : '-G',
01859         'gap_extend' : '-E',
01860         'window_size' : '-A',
01861         'npasses' : '-j',
01862         'passes' : '-P',
01863 
01864         'gapped' : '-g',
01865         'expectation' : '-e',
01866         'wordsize' : '-W',
01867         'keep_hits' : '-K',
01868         'xdrop' : '-X',
01869         'hit_extend' : '-f',
01870         'region_length' : '-L',
01871         'db_length' : '-Z',
01872         'search_length' : '-Y',
01873         'nbits_gapping' : '-N',
01874         'pseudocounts' : '-c',
01875         'xdrop_final' : '-Z',
01876         'xdrop_extension' : '-y',
01877         'model_threshold' : '-h',
01878         'required_start' : '-S',
01879         'required_end' : '-H',
01880 
01881         'program' : '-p',
01882         'database' : '-d',
01883         'infile' : '-i',
01884         'filter' : '-F',
01885         'believe_query' : '-J',
01886         'nprocessors' : '-a',
01887 
01888         'html' : '-T',
01889         'descriptions' : '-v',
01890         'alignments' : '-b',
01891         'align_view' : '-m',
01892         'show_gi' : '-I',
01893         'seqalign_file' : '-O',
01894         'align_outfile' : '-o',
01895         'checkpoint_outfile' : '-C',
01896         'restart_infile' : '-R',
01897         'hit_infile' : '-k',
01898         'matrix_outfile' : '-Q',
01899         'align_infile' : '-B',
01900         }
01901     from Applications import BlastpgpCommandline
01902     cline = BlastpgpCommandline(blastcmd)
01903     cline.set_parameter(att2param['database'], database)
01904     cline.set_parameter(att2param['infile'], infile)
01905     cline.set_parameter(att2param['align_view'], str(align_view))
01906     for key, value in keywds.iteritems():
01907         cline.set_parameter(att2param[key], str(value))
01908     return _invoke_blast(cline)
01909 

Here is the call graph for this function:

def Bio.Blast.NCBIStandalone.rpsblast (   blastcmd,
  database,
  infile,
  align_view = "7",
  keywds 
)
Execute and retrieve data from standalone RPS-BLAST as handles (OBSOLETE).

NOTE - This function is obsolete, you are encouraged to the command
line wrapper Bio.Blast.Applications.RpsBlastCommandline instead.

Execute and retrieve data from standalone RPS-BLAST.  blastcmd is the
command used to launch the 'rpsblast' executable.  database is the path
to the database to search against.  infile is the path to the file
containing the sequence to search with.

The return values are two handles, for standard output and standard error.

You may pass more parameters to **keywds to change the behavior of
the search.  Otherwise, optional values will be chosen by rpsblast.

Please note that this function will give XML output by default, by
setting align_view to seven (i.e. command line option -m 7).
You should use the NCBIXML.parse() function to read the resulting output.
This is because NCBIStandalone.BlastParser() does not understand the
plain text output format from rpsblast.

WARNING - The following text and associated parameter handling has not
received extensive testing.  Please report any errors we might have made...

    Algorithm/Scoring
gapped              Whether to do a gapped alignment.  T/F
multihit            0 for multiple hit (default), 1 for single hit
expectation         Expectation value cutoff.
range_restriction   Range restriction on query sequence (Format: start,stop) blastp only
                    0 in 'start' refers to the beginning of the sequence
                    0 in 'stop' refers to the end of the sequence
                    Default = 0,0
xdrop               Dropoff value (bits) for gapped alignments.
xdrop_final         X dropoff for final gapped alignment (in bits).
xdrop_extension     Dropoff for blast extensions (in bits).
search_length       Effective length of search space.
nbits_gapping       Number of bits to trigger gapping.
protein             Query sequence is protein.  T/F
db_length           Effective database length.

    Processing
filter              Filter query sequence for low complexity?  T/F
case_filter         Use lower case filtering of FASTA sequence T/F, default F
believe_query       Believe the query defline.  T/F
nprocessors         Number of processors to use.
logfile             Name of log file to use, default rpsblast.log

    Formatting
html                Produce HTML output?  T/F
descriptions        Number of one-line descriptions.
alignments          Number of alignments.
align_view          Alignment view.  Integer 0-11,
                    passed as a string or integer.
show_gi             Show GI's in deflines?  T/F
seqalign_file       seqalign file to output.
align_outfile       Output file for alignment.  Filename to write to, if
                    ommitted standard output is used (which you can access
                    from the returned handles).

Definition at line 1910 of file NCBIStandalone.py.

01910 
01911 def rpsblast(blastcmd, database, infile, align_view="7", **keywds):
01912     """Execute and retrieve data from standalone RPS-BLAST as handles (OBSOLETE).
01913     
01914     NOTE - This function is obsolete, you are encouraged to the command
01915     line wrapper Bio.Blast.Applications.RpsBlastCommandline instead.
01916 
01917     Execute and retrieve data from standalone RPS-BLAST.  blastcmd is the
01918     command used to launch the 'rpsblast' executable.  database is the path
01919     to the database to search against.  infile is the path to the file
01920     containing the sequence to search with.
01921 
01922     The return values are two handles, for standard output and standard error.
01923 
01924     You may pass more parameters to **keywds to change the behavior of
01925     the search.  Otherwise, optional values will be chosen by rpsblast.
01926 
01927     Please note that this function will give XML output by default, by
01928     setting align_view to seven (i.e. command line option -m 7).
01929     You should use the NCBIXML.parse() function to read the resulting output.
01930     This is because NCBIStandalone.BlastParser() does not understand the
01931     plain text output format from rpsblast.
01932 
01933     WARNING - The following text and associated parameter handling has not
01934     received extensive testing.  Please report any errors we might have made...
01935 
01936         Algorithm/Scoring
01937     gapped              Whether to do a gapped alignment.  T/F
01938     multihit            0 for multiple hit (default), 1 for single hit
01939     expectation         Expectation value cutoff.
01940     range_restriction   Range restriction on query sequence (Format: start,stop) blastp only
01941                         0 in 'start' refers to the beginning of the sequence
01942                         0 in 'stop' refers to the end of the sequence
01943                         Default = 0,0
01944     xdrop               Dropoff value (bits) for gapped alignments.
01945     xdrop_final         X dropoff for final gapped alignment (in bits).
01946     xdrop_extension     Dropoff for blast extensions (in bits).
01947     search_length       Effective length of search space.
01948     nbits_gapping       Number of bits to trigger gapping.
01949     protein             Query sequence is protein.  T/F
01950     db_length           Effective database length.
01951 
01952         Processing
01953     filter              Filter query sequence for low complexity?  T/F
01954     case_filter         Use lower case filtering of FASTA sequence T/F, default F
01955     believe_query       Believe the query defline.  T/F
01956     nprocessors         Number of processors to use.
01957     logfile             Name of log file to use, default rpsblast.log
01958 
01959         Formatting
01960     html                Produce HTML output?  T/F
01961     descriptions        Number of one-line descriptions.
01962     alignments          Number of alignments.
01963     align_view          Alignment view.  Integer 0-11,
01964                         passed as a string or integer.
01965     show_gi             Show GI's in deflines?  T/F
01966     seqalign_file       seqalign file to output.
01967     align_outfile       Output file for alignment.  Filename to write to, if
01968                         ommitted standard output is used (which you can access
01969                         from the returned handles).
01970     """
01971 
01972     import warnings
01973     warnings.warn("This function is obsolete, you are encouraged to the command line wrapper Bio.Blast.Applications.BlastrpsCommandline instead.", PendingDeprecationWarning)
01974     _security_check_parameters(keywds)
01975     
01976     att2param = {
01977         'multihit' : '-P',
01978         'gapped' : '-g',
01979         'expectation' : '-e',
01980         'range_restriction' : '-L',
01981         'xdrop' : '-X',
01982         'xdrop_final' : '-Z',
01983         'xdrop_extension' : '-y',
01984         'search_length' : '-Y',
01985         'nbits_gapping' : '-N',
01986         'protein' : '-p',
01987         'db_length' : '-z',
01988 
01989         'database' : '-d',
01990         'infile' : '-i',
01991         'filter' : '-F',
01992         'case_filter' : '-U',
01993         'believe_query' : '-J',
01994         'nprocessors' : '-a',
01995         'logfile' : '-l',
01996 
01997         'html' : '-T',
01998         'descriptions' : '-v',
01999         'alignments' : '-b',
02000         'align_view' : '-m',
02001         'show_gi' : '-I',
02002         'seqalign_file' : '-O',
02003         'align_outfile' : '-o',
02004         }
02005 
02006     from Applications import RpsBlastCommandline
02007     cline = RpsBlastCommandline(blastcmd)
02008     cline.set_parameter(att2param['database'], database)
02009     cline.set_parameter(att2param['infile'], infile)
02010     cline.set_parameter(att2param['align_view'], str(align_view))
02011     for key, value in keywds.iteritems():
02012         cline.set_parameter(att2param[key], str(value))
02013     return _invoke_blast(cline)
02014 

Here is the call graph for this function: