OpenStructure
Public Member Functions | Data Fields | Static Public Attributes
HHblits Class Reference

Public Member Functions

def __init__ (self, query, hhsuite_root, hhblits_bin=None, working_dir=None)
 
def BuildQueryMSA (self, nrdb, options={}, a3m_file=None)
 
def A3MToProfile (self, a3m_file, hhm_file=None)
 
def A3MToCS (self, a3m_file, cs_file=None, options={})
 
def Cleanup (self)
 
def CleanupFailed (self)
 
def Search (self, a3m_file, database, options={}, prefix='')
 

Data Fields

 query
 
 hhsuite_root
 
 bin_dir
 
 hhblits_bin
 
 hhlib_dir
 
 needs_cleanup
 
 working_dir
 
 filename
 

Static Public Attributes

string OUTPUT_PREFIX = 'query_hhblits'
 

Detailed Description

Initialise a new HHblits "search" for the given query. Query may either
be a :class:`~ost.seq.SequenceHandle` or a string. In the former case, the
query is the actual query sequence, in the latter case, the query is the
filename to the file containing the query.

:param query: Query sequence as file or sequence.
:type query: :class:`~ost.seq.SequenceHandle` or :class:`str`
:param hhsuite_root: Path to the top-level directory of your hhsuite
                     installation.
:type hhsuite_root: :class:`str`
:param hhblits_bin: Name of the hhblits binary. Will only be used if
                    :attr:`hhsuite_root`:file:`/bin/hhblits` does not exist.
:type hhblits_bin: :class:`str`
:param working_dir: Directory for temporary files. Will be created if not
                    present but **not** automatically deleted.
:type working_dir: :class:`str`

Definition at line 458 of file hhblits2.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  query,
  hhsuite_root,
  hhblits_bin = None,
  working_dir = None 
)

Definition at line 478 of file hhblits2.py.

Member Function Documentation

◆ A3MToCS()

def A3MToCS (   self,
  a3m_file,
  cs_file = None,
  options = {} 
)
Converts the A3M alignment file to a column state sequence file. If
cs_file is not given, the output file will be set to
<:attr:`a3m_file`-basename>.seq219.

If the file was already produced, the existing file path is returned
without recomputing it.

:param a3m_file: Path to input MSA as produced by :meth:`BuildQueryMSA`
:type a3m_file: :class:`str`

:param cs_file: Output file name (may be omitted)
:type cs_file: :class:`str`

:param options: Dictionary of options to *cstranslate*, one "-" is added
                in front of every key. Boolean True values add flag
                without value.
:type options: :class:`dict`

:return: Path to the column state sequence file
:rtype: :class:`str`

Definition at line 641 of file hhblits2.py.

◆ A3MToProfile()

def A3MToProfile (   self,
  a3m_file,
  hhm_file = None 
)
Converts the A3M alignment file to a hhm profile. If hhm_file is not
given, the output file will be set to <:attr:`a3m_file`-basename>.hhm.

The produced HHM file can be parsed by :func:`ParseHHM`.

If the file was already produced, the existing file path is returned
without recomputing it.

:param a3m_file: Path to input MSA as produced by :meth:`BuildQueryMSA`
:type a3m_file: :class:`str`

:param hhm_file: Desired output file name 
:type hhm_file: :class:`str`

:return: Path to the profile file
:rtype: :class:`str`

Definition at line 601 of file hhblits2.py.

◆ BuildQueryMSA()

def BuildQueryMSA (   self,
  nrdb,
  options = {},
  a3m_file = None 
)
Builds the MSA for the query sequence.

This function directly uses hhblits of hhtools. While in theory it would
be possible to do this by PSI-blasting on our own, hhblits is supposed
to be faster. Also it is supposed to prevent alignment corruption. The
alignment corruption is caused by low-scoring terminal alignments that
draw the sequences found by PSI-blast away from the optimum. By removing
these low scoring ends, part of the alignment corruption can be
suppressed.

hhblits does **not** call PSIPRED on the MSA to predict the secondary
structure of the query sequence. This is done by addss.pl of hhtools.
The predicted secondary structure is stored together with the sequences
identified by hhblits.

The produced A3M file can be parsed by :func:`ParseA3M`. If the file was
already produced, hhblits is not called again and the existing file path
is returned.

:param nrdb: Database to be align against; has to be an hhblits database
:type nrdb: :class:`str`

:param options: Dictionary of options to *hhblits*, one "-" is added in
                front of every key. Boolean True values add flag without
                value. Merged with default options {'cpu': 1, 'n': 1},
                where 'n' defines the number of iterations.
:type options: :class:`dict`

:param a3m_file: a path of a3m_file to be used, optional
:type a3m_file: :class:`str`

:return: The path to the A3M file containing the MSA
:rtype: :class:`str`

Definition at line 517 of file hhblits2.py.

◆ Cleanup()

def Cleanup (   self)
Delete temporary data.

Delete temporary data if no working dir was given. Controlled by
:attr:`needs_cleanup`.

Definition at line 685 of file hhblits2.py.

◆ CleanupFailed()

def CleanupFailed (   self)
In case something went wrong, call to make sure everything is clean.

This will delete the working dir independently of :attr:`needs_cleanup`.

Definition at line 694 of file hhblits2.py.

◆ Search()

def Search (   self,
  a3m_file,
  database,
  options = {},
  prefix = '' 
)
Searches for templates in the given database. Before running the search,
the hhm file is copied. This makes it possible to launch several hhblits
instances at once. Upon success, the filename of the result file is
returned. This file may be parsed with :func:`ParseHHblitsOutput`.

:param a3m_file: Path to input MSA as produced by :meth:`BuildQueryMSA`
:type a3m_file: :class:`str`

:param database: Search database, needs to be the common prefix of the
                 database files
:type database: :class:`str`

:param options: Dictionary of options to *hhblits*, one "-" is added in
                front of every key. Boolean True values add flag without
                value. Merged with default options {'cpu': 1, 'n': 1},
                where 'n' defines the number of iterations.
:type options: :class:`dict`

:param prefix: Prefix to the result file
:type prefix: :class:`str`

:return: The path to the result file
:rtype: :class:`str`

Definition at line 704 of file hhblits2.py.

Field Documentation

◆ bin_dir

bin_dir

Definition at line 482 of file hhblits2.py.

◆ filename

filename

Definition at line 497 of file hhblits2.py.

◆ hhblits_bin

hhblits_bin

Definition at line 483 of file hhblits2.py.

◆ hhlib_dir

hhlib_dir

Definition at line 490 of file hhblits2.py.

◆ hhsuite_root

hhsuite_root

Definition at line 480 of file hhblits2.py.

◆ needs_cleanup

needs_cleanup

Definition at line 492 of file hhblits2.py.

◆ OUTPUT_PREFIX

string OUTPUT_PREFIX = 'query_hhblits'
static

Definition at line 477 of file hhblits2.py.

◆ query

query

Definition at line 479 of file hhblits2.py.

◆ working_dir

working_dir

Definition at line 493 of file hhblits2.py.


The documentation for this class was generated from the following file: