Bio.motifs.jaspar.DB模块

提供对JASPAR5格式数据库的读访问。

此模块需要安装MySQLDb。

例如,将您的数据库凭据替换为:

    from Bio.motifs.jaspar.db import JASPAR5
    JASPAR_DB_HOST = "hostname.example.org"
    JASPAR_DB_NAME = "JASPAR2018"
    JASPAR_DB_USER = "guest"
    JASPAR_DB_PASS = "guest"

    jdb = JASPAR5(
        host=JASPAR_DB_HOST,
        name=JASPAR_DB_NAME,
        user=JASPAR_DB_USER,
        password=JASPAR_DB_PASS
    )
    ets1 = jdb.fetch_motif_by_id('MA0098')
    print(ets1)
TF name ETS1
Matrix ID   MA0098.3
Collection  CORE
TF class    ['Tryptophan cluster factors']
TF family   ['Ets-related factors']
Species 9606
Taxonomic group vertebrates
Accession   ['P14921']
Data type used  HT-SELEX
Medline 20517297
PAZAR ID    TF0000070
Comments    Data is from Taipale HTSELEX DBD (2013)
Matrix:
        0      1      2      3      4      5      6      7      8      9
A: 2683.00 180.00 425.00   0.00   0.00 2683.00 2683.00 1102.00  89.00 803.00
C: 210.00 2683.00 2683.00  21.00   0.00   0.00   9.00  21.00 712.00 401.00
G: 640.00 297.00   7.00 2683.00 2683.00   0.00  31.00 1580.00 124.00 1083.00
T: 241.00  22.00   0.00   0.00  12.00   0.00 909.00  12.00 1970.00 396.00

    motifs = jdb.fetch_motifs(
        collection = 'CORE',
        tax_group = ['vertebrates', 'insects'],
        tf_class = 'Homeo domain factors',
        tf_family = ['TALE-type homeo domain factors', 'POU domain factors'],
        min_ic = 12
    )
    for motif in motifs:
        pass # do something with the motif
class Bio.motifs.jaspar.db.JASPAR5(host=None, name=None, user=None, password=None)

基类:object

表示JASPAR5数据库的类。

代表JASPAR5 DB的类。其中的方法松散地基于perl TFBS::DB::JASPAR5模块。

注意:我们将仅实现从DB读取JASVAR图案。与Perl模块不同,我们目前不会尝试实现任何方法来存储JASPARmotifs或创建新的DB。

__init__(host=None, name=None, user=None, password=None)

构建JASPAR5实例并连接到指定的DB。

论点:
  • 主机-JASPARDB服务器的主机名

  • 名称-JASVAR数据库的名称

  • user -用于连接到JASPARDB的用户名

  • password - JASPAR DB密码

__str__()

返回JASPAR5 DB连接的字符串表示形式。

fetch_motif_by_id(id)

通过JASVAR矩阵ID从DB中获取单个JASVAR主题。

示例id“MA0001.1”。

论点:
  • id - JASPAR矩阵ID。这可以是完全指定的ID,包括

    版本号(例如MA 0049.2)或仅基本ID(例如MA 0049)。如果仅提供基本ID,则返回最新版本。

退货:
  • Bio.motifs.jaspar.Motif对象

NOTE: perl TFBS模块允许您指定要返回的矩阵类型(PFA、PM、ICM),但矩阵始终作为PFM存储在JASVAR中,因此这并不真正属于这里。获取PFA后,可以调用pwm()和pssm()方法来返回正规化和log赔率矩阵。

fetch_motifs_by_name(name)

按给定TF名称从JASPARDB中获取JASPARmotif列表。

参数:名称-单个名称或名称列表返回:Bio.motifs.jaspar.Motif对象列表

注意:并不保证名称是唯一的。可能有多个同名主题。因此,即使名称指定了单个名称,也会返回主题列表。这只是调用self.fetch_motifs(collection =无,tf_名称=名称)。

这种行为与TFBS perl模块的get_Matrix_by_Name()方法不同,后者总是返回单个矩阵,发出警告消息并返回在多个矩阵具有相同名称的情况下检索到的第一个矩阵。

fetch_motifs(collection=JASPAR_DFLT_COLLECTION, tf_name=None, tf_class=None, tf_family=None, matrix_id=None, tax_group=None, species=None, pazar_id=None, data_type=None, medline=None, min_ic=0, min_length=0, min_sites=0, all=False, all_versions=False)

获取jaspar。使用选择标准记录主题(列表)。

论点::

Except where obvious, all selection criteria arguments may be
specified as a single value or a list of values. Motifs must
meet ALL the specified selection criteria to be returned with
the precedent exceptions noted below.

all         - Takes precedent of all other selection criteria.
              Every motif is returned. If 'all_versions' is also
              specified, all versions of every motif are returned,
              otherwise just the latest version of every motif is
              returned.
matrix_id   - Takes precedence over all other selection criteria
              except 'all'.  Only motifs with the given JASPAR
              matrix ID(s) are returned. A matrix ID may be
              specified as just a base ID or full JASPAR IDs
              including version number. If only a base ID is
              provided for specific motif(s), then just the latest
              version of those motif(s) are returned unless
              'all_versions' is also specified.
collection  - Only motifs from the specified JASPAR collection(s)
              are returned. NOTE - if not specified, the collection
              defaults to CORE for all other selection criteria
              except 'all' and 'matrix_id'. To apply the other
              selection criteria across all JASPAR collections,
              explicitly set collection=None.
tf_name     - Only motifs with the given name(s) are returned.
tf_class    - Only motifs of the given TF class(es) are returned.
tf_family   - Only motifs from the given TF families are returned.
tax_group   - Only motifs belonging to the given taxonomic
              supergroups are returned (e.g. 'vertebrates',
              'insects', 'nematodes' etc.)
species     - Only motifs derived from the given species are
              returned.  Species are specified as taxonomy IDs.
data_type   - Only motifs generated with the given data type (e.g.
              ('ChIP-seq', 'PBM', 'SELEX' etc.) are returned.
              NOTE - must match exactly as stored in the database.
pazar_id    - Only motifs with the given PAZAR TF ID are returned.
medline     - Only motifs with the given medline (PubmMed IDs) are
              returned.
min_ic      - Only motifs whose profile matrices have at least this
              information content (specificty) are returned.
min_length  - Only motifs whose profiles are of at least this
              length are returned.
min_sites   - Only motifs compiled from at least these many binding
              sites are returned.
all_versions- Unless specified, just the latest version of motifs
              determined by the other selection criteria are
              returned. Otherwise all versions of the selected
              motifs are returned.
退货:
  • 生物。图案。jaspar。图案记录(列表)。

__firstlineno__ = 76
__static_attributes__ = ('dbh', 'host', 'name', 'password', 'user')