-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathetl_ENA_REST.py
More file actions
44 lines (34 loc) · 2.14 KB
/
etl_ENA_REST.py
File metadata and controls
44 lines (34 loc) · 2.14 KB
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
40
41
42
43
44
import requests
import pandas as pd
from io import StringIO
import os
import sys
import json
from pyld import jsonld
from rdflib import Graph
import re
from defs import Tool_Pathogen_Name_from_Taxon_ID
from defs import ENA_tax_eq
def main() -> int:
taxon_list = [127906, 3052460, 3052462, 186537, 3052464, 138950, 3052310, 694009, 3046277, 3052518, 10244, 37124, 632, 5500,
5820, 4827, 1773, 620, 3048459, 2955291, 10255, 11676, 2509494, 498019, 746128, 5476, 5480, 5482, 5478, 5658, 5806,
5741, 5811, 3052480, 485, 3052225, 562, 59201, 1313, 3052676, 3052345, 139, 3048448, 2955465, 2955744, 2955935,
12092, 1392, 11292, 3048158, 470, 520, 197, 813, 573, 727, 1496, 3049954, 1314, 11036, 66527, 88456, 5759, 5722,
5690, 5763, 234, 1352, 287, 1280, 11974, 777, 3052465, 263, 3052499, 171, 1126011, 10566, 1311, 160, 630, 5036,
38946, 37769, 5207, 41688, 41687, 5506, 4909, 42068, 37727, 6029, 100816, 1489895, 1489897, 159075, 563466, 5502,
487, 362532, 126728, 107386, 31276, 32597, 109871, 1357716, 112090, 157072, 2748958, 6210, 6211, 670, 943, 3052302,
3052307, 2169991, 3052314, 3052303, 3052317, 3052303, 3052300, 3052328, 1674146, 47466, 13373, 28450, 83554, 1491,
1513, 1717, 544, 547, 3048170, 3048170, 3048233, 3048287, 3052468, 3048443, 1980456, 3052485, 446, 2846071, 581,
583, 10294, 3050294, 3052223, 2971765, 3052385, 3052390, 3052409, 3052429, 3051992, 3052684, 2748958, 3052686,
138948, 138949, 138951, 147711, 147712, 463676, 780, 6181, 10912, 11021, 59301, 2169701, 11034, 11039, 6333, 613,
3052346, 3050271, 2034996, 84677, 3048357, 1274402, 2560405, 100217, 10492, 65424, 3050290, 37629, 342409, 222557,
3050355, 55987, 3052615, 12110, 1980917, 696863, 1980916, 3048455, 40051, 40054, 3349490, 282786]
# taxon_list = [127906, 3052460, 3052462, 186537, 3052464, 138950]
call_limit = 100 # Set the number of max results to request
for index, taxon in enumerate(taxon_list, 1):
print(f"\nProcessing taxon {index}/{len(taxon_list)}: {taxon}")
ENA_tax_eq.serviceCallByTaxonID(taxon, call_limit)
return 0
if __name__ == "__main__":
import sys
sys.exit(main())