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数据库的类。

表示JASPAR5DB的类。其中的方法松散地基于Perl TFBS::DB::JASPAR5模块。

注意:我们将只实现从数据库读取Jaspar主题。与Perl模块不同,我们现在不会尝试实现任何方法来存储Jaspar主题或创建新的数据库。

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

构造一个JASPAR5实例并连接到指定的DB。

参数:
  • Host-Jaspar DB服务器的主机名

  • Name-Jaspar数据库的名称

  • User-连接到Jaspar DB的用户名

  • 密码-Jaspar数据库密码

__str__()

返回表示JASPAR5DB连接的字符串。

fetch_motif_by_id(id)

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

示例ID‘MA0001.1’。

参数:
  • id-Jaspar矩阵ID。这可以是完全指定的ID,包括

    版本号(例如MA0049.2)或仅基本ID(例如MA0049)。如果仅提供基本ID,则返回最新版本。

退货:
  • 一个Bio.Motifs.jaspar.Motif对象

注: Perl TFBS模块允许您指定要返回的矩阵类型(PFM、PWM、ICM),但是矩阵总是作为PFM存储在Jaspar中,因此这并不真正属于这里。一旦获取了PFM,就可以调用PWM()和pssm()方法来返回标准化的对数赔率矩阵。

fetch_motifs_by_name(name)

按给定的TF名称从Jaspar DB获取Jaspar主题列表。

Arguments:Name-单个名称或名称列表返回:Bio.Motifs.jaspar.Motif对象列表

注意:名称不保证是唯一的。可能有多个主题具有相同的名称。因此,即使name指定了单个名称,也会返回一个主题列表。这只调用self.fetch_Motifs(COLLECTION=NONE,TF_NAME=NAME)。

此行为与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.Record(列表)使用选择标准的主题。

参数::

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.
退货:
  • A Bio.Motifs.jaspar.Record(列表)主题。