Source code for prody.apps.evol_apps.evol_search

"""Pfam search application."""

__author__ = 'Ahmet Bakan, Anindita Dutta'

from ..apptools import DevelApp

__all__ = ['evol_search']

APP = DevelApp('search', 'search Pfam with given query')

APP.addGroup('sequence', 'sequence search options')
APP.addGroup('output', 'output options')

APP.addArgument('query',
    help='protein UniProt ID or sequence, a PDB identifier, or a sequence '
         'file, where sequence have no gaps and 12 or more characters')
APP.addArgument('-b', '--searchBs',
    dest='search_b',
    help='search Pfam-B families',
    default=False,
    action='store_true',
    group='sequence')

APP.addArgument('-s', '--skipAs',
    dest='skip_a',
    help='do not search Pfam-A families',
    default=False,
    action='store_true',
    group='sequence')
APP.addArgument('-g', '--ga',
    dest='ga',
    help='use gathering threshold',
    default=False,
    action='store_true',
    group='sequence')
APP.addArgument('-e', '--evalue',
    dest='evalue',
    help='e-value cutoff, must be less than 10.0',
    default=None,
    type=float,
    metavar='FLOAT',
    group='sequence')
APP.addArgument('-t', '--timeout',
    dest='timeout',
    help='timeout in seconds for blocking connection attempt',
    default=60,
    type=int,
    metavar='INT',
    group='sequence')
APP.addArgument('-o', '--outname',
    dest='outname',
    help='name for output file, default is standard output',
    type=str,
    metavar='STR',
    group='output')
APP.addArgument('-d', '--delimiter',
    dest='delimiter',
    type=str,
    default='\t',
    metavar='STR',
    help='delimiter for output data columns',
    group='output')

APP.setExample(
"""Search Pfam database with a UniProt ID or protein sequence.
Sequence input can be parsed from a FASTA or Selex.  Minimum length
of query sequence should be 16 characters and should not contain gaps.
If output name is specified, results will be written in a file.
Otherwise, or the output will be directed to standard output.

Search Pfam with PDB and chain identifier and output results to screen:

  $ evol search 1mkpA

Search Pfam with UniProt ID and write output into a file:

  $ evol search P08581 --outname families.txt

Search Pfam with a sequence and with some search options:

  $ evol search PMFIVNTNVPRASVPDGFLSELTQQLAQATGKPPQYIAVHVVPDQLMAFGGSSEPCALCS\
LHSIGKIGGAQNRSYSKLLCGLLAERLRISPDRVYINYYDMNAANVGWNNSTFA --evalue 2 \
--searchBs""", [0, 1])



APP.setFunction(evol_search)