-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03_run_mesh2pmid.py
More file actions
39 lines (27 loc) · 937 Bytes
/
03_run_mesh2pmid.py
File metadata and controls
39 lines (27 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'''
The purpose of this file is to map MeSH Terms (metadata) to PMIDs
'''
from caseolap._03_mesh2pmid import *
'''
Parameters
'''
### Input
parsed_data_inputfile = "./data/pubmed.json"
### Output
mesh2pmid_outputfile = "./data/mesh2pmid.json" # {"MeSH Term":[PMID1,...], ...}
mesh2pmid_statfile = "./data/mesh2pmid_stat.json" # {"MeSH Term": #PMIDs, ...}
logFilePath = "./log/mesh2pmid_log.txt" # Logs mapping progress
'''
Main Code
'''
if __name__ == '__main__':
# Open log file
logfile = open(logFilePath, "w")
# Initialize class
mesh2PMID = MeSH2PMID()
# Map MeSH to PMID
mesh2PMID.mesh2pmid_mapping(parsed_data_inputfile,mesh2pmid_outputfile,logfile)
# Map MeSH to #PMIDs
mesh2PMID.mesh2pmid_mapping_stat(mesh2pmid_statfile,logfile)
# Close log file
logfile.close()