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 資料庫的類別。其中的方法大致基於 perl TFBS::DB::JASPAR5 模組。

注意:我們只會實作從資料庫讀取 JASPAR motifs 的功能。與 perl 模組不同,我們目前不會嘗試實作任何儲存 JASPAR motifs 或建立新資料庫的方法。

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

建構 JASPAR5 實例並連接到指定的資料庫。

引數
  • host - JASPAR 資料庫伺服器的主機名稱

  • name - JASPAR 資料庫的名稱

  • user - 連接到 JASPAR 資料庫的使用者名稱

  • password - JASPAR 資料庫密碼

__str__()

傳回 JASPAR5 資料庫連線的字串表示。

fetch_motif_by_id(id)

從資料庫中根據其 JASPAR 矩陣 ID 擷取單個 JASPAR motif。

範例 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 資料庫中擷取 JASPAR motifs 的列表。

引數:name - 單個名稱或名稱列表。傳回:一個 Bio.motifs.jaspar.Motif 物件列表

注意:名稱不保證是唯一的。可能有多個具有相同名稱的 motif。因此,即使名稱指定單個名稱,也會傳回一個 motif 列表。這只會呼叫 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)

使用選擇條件擷取 motifs 的 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.
傳回
  • 一個 Bio.motifs.jaspar.Record (列表) 的 motifs。