Skip to content

Commit dd72c24

Browse files
committed
Started working on PMI-DB inputs_v2 module
1 parent 2094b80 commit dd72c24

1 file changed

Lines changed: 95 additions & 0 deletions

File tree

‎pypath/inputs_v2/pmidb.py‎

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
"""
2+
Parse PMI-DB data and emit Entity records.
3+
4+
This module converts protein-metabolite interaction information from PMI-DB into
5+
Entity records using the declarative schema pattern.
6+
"""
7+
8+
from __future__ import annotations
9+
10+
import pandas as pd
11+
12+
from pypath.inputs_v2.base import (
13+
ResourceConfig,
14+
Download,
15+
Resource,
16+
Dataset,
17+
ontology_entity_mapper,
18+
)
19+
from pypath.inputs_v2.parsers import brenda as _parsers
20+
from pypath.internals.tabular_builder import (
21+
AssociationBuilder,
22+
AssociationsBuilder,
23+
CV,
24+
EntityBuilder,
25+
FieldConfig,
26+
IdentifiersBuilder,
27+
)
28+
from pypath.internals.cv_terms import (
29+
EntityTypeCv,
30+
IdentifierNamespaceCv,
31+
LicenseCV,
32+
OntologyCv,
33+
UpdateCategoryCV,
34+
ResourceCv,
35+
)
36+
37+
# =================================== SET-UP ===================================
38+
39+
BASE_URL = 'http://easybioai.com/PMIDB/static/%s.txt'
40+
files = ['interaction', 'protein_infor', 'metabolites_infor']
41+
42+
config = ResourceConfig(
43+
id=ResourceCv.PMIDB,
44+
name='PMI-DB',
45+
url='http://easybioai.com/PMIDB/',
46+
license=LicenseCV.UNSPECIFIED,
47+
update_category=UpdateCategoryCV.IRREGULAR,
48+
pubmed='33554247',
49+
primary_category='intercell',
50+
description=(
51+
'PMIDB provides both interactions and non-interactions between protein '
52+
'and metabolite, which not only reduces the experimental cost for '
53+
'biological experimenters, but also facilitates the construction of '
54+
'more accurate algorithms for researchers using machine learning.'
55+
),
56+
)
57+
58+
download = {
59+
f: Download(
60+
url=BASE_URL % f,
61+
filename=f'{f}.txt',
62+
subfolder='PMIDB',
63+
large=True,
64+
ext='.txt',
65+
default_mode='r',
66+
)
67+
for f in files
68+
}
69+
70+
#def parser(opener, skiprows):
71+
72+
# =================================== SCHEMA ===================================
73+
74+
f = FieldConfig(
75+
extract={},
76+
map={},
77+
transform={},
78+
)
79+
80+
schema = EntityBuilder(
81+
#entity_type=EntityTypeCv.
82+
)
83+
84+
# ================================= RESOURCE ===================================
85+
86+
#resource = Resource(
87+
# config=config,
88+
# data=Dataset(
89+
# download=download,
90+
# mapper=schema,
91+
# raw_parser=parser,
92+
# ),
93+
#)
94+
95+
# ================================= REFERENCE ==================================

0 commit comments

Comments
 (0)