ebi-eva-common-pyutils 0.6.16__py3-none-any.whl → 0.7.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ebi_eva_common_pyutils/assembly/assembly.py +7 -3
- ebi_eva_common_pyutils/biosamples_communicators.py +1 -14
- ebi_eva_common_pyutils/spreadsheet/__init__.py +0 -0
- ebi_eva_common_pyutils/spreadsheet/metadata_xlsx_utils.py +15 -0
- {ebi_eva_common_pyutils-0.6.16.dist-info → ebi_eva_common_pyutils-0.7.0.dist-info}/METADATA +1 -1
- {ebi_eva_common_pyutils-0.6.16.dist-info → ebi_eva_common_pyutils-0.7.0.dist-info}/RECORD +10 -8
- {ebi_eva_common_pyutils-0.6.16.data → ebi_eva_common_pyutils-0.7.0.data}/scripts/archive_directory.py +0 -0
- {ebi_eva_common_pyutils-0.6.16.dist-info → ebi_eva_common_pyutils-0.7.0.dist-info}/LICENSE +0 -0
- {ebi_eva_common_pyutils-0.6.16.dist-info → ebi_eva_common_pyutils-0.7.0.dist-info}/WHEEL +0 -0
- {ebi_eva_common_pyutils-0.6.16.dist-info → ebi_eva_common_pyutils-0.7.0.dist-info}/top_level.txt +0 -0
|
@@ -47,14 +47,18 @@ def get_taxonomy_to_assembly_mapping_from_ensembl_rapid_release():
|
|
|
47
47
|
strain = asm_data['strain']
|
|
48
48
|
release_date = datetime.strptime(asm_data['release_date'], '%Y-%m-%d')
|
|
49
49
|
|
|
50
|
+
# Skip alternate haplotype assemblies
|
|
51
|
+
if strain and strain.lower() == 'alternate haplotype':
|
|
52
|
+
continue
|
|
53
|
+
# Skip non GCA accession
|
|
54
|
+
if not asm_accession.startswith('GCA_'):
|
|
55
|
+
continue
|
|
56
|
+
|
|
50
57
|
# If we haven't seen this taxonomy before, just use this assembly
|
|
51
58
|
if tax_id not in results:
|
|
52
59
|
results[tax_id] = (asm_accession, release_date)
|
|
53
60
|
continue
|
|
54
61
|
|
|
55
|
-
# Skip alternate haplotype assemblies
|
|
56
|
-
if strain and strain.lower() == 'alternate haplotype':
|
|
57
|
-
continue
|
|
58
62
|
current_assembly, current_date = results[tax_id]
|
|
59
63
|
# Keep the more recent assembly, or the lexicographically last one if release dates are equal
|
|
60
64
|
if current_date < release_date or (current_date == release_date and asm_accession > current_assembly):
|
|
@@ -50,7 +50,7 @@ class HALCommunicator(AppLogger):
|
|
|
50
50
|
|
|
51
51
|
@cached_property
|
|
52
52
|
def token(self):
|
|
53
|
-
"""Retrieve the token from the
|
|
53
|
+
"""Retrieve the token from the REST API then cache it for further querying"""
|
|
54
54
|
response = requests.get(self.auth_url, auth=(self.username, self.password))
|
|
55
55
|
self._validate_response(response)
|
|
56
56
|
return response.text
|
|
@@ -144,19 +144,6 @@ class HALCommunicator(AppLogger):
|
|
|
144
144
|
def communicator_attributes(self):
|
|
145
145
|
raise NotImplementedError
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
class AAPHALCommunicator(HALCommunicator):
|
|
149
|
-
"""Class to navigate BioSamples API using AAP authentication."""
|
|
150
|
-
|
|
151
|
-
def __init__(self, auth_url, bsd_url, username, password, domain=None):
|
|
152
|
-
super(AAPHALCommunicator, self).__init__(auth_url, bsd_url, username, password)
|
|
153
|
-
self.domain = domain
|
|
154
|
-
|
|
155
|
-
@property
|
|
156
|
-
def communicator_attributes(self):
|
|
157
|
-
return {'domain': self.domain}
|
|
158
|
-
|
|
159
|
-
|
|
160
147
|
class WebinHALCommunicator(HALCommunicator):
|
|
161
148
|
"""Class to navigate BioSamples API using Webin authentication."""
|
|
162
149
|
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from openpyxl.reader.excel import load_workbook
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def metadata_xlsx_version(metadata_xlsx):
|
|
7
|
+
workbook = load_workbook(metadata_xlsx)
|
|
8
|
+
try:
|
|
9
|
+
instructions_sheet = workbook['PLEASE READ FIRST']
|
|
10
|
+
xlsx_sheet_version_value = instructions_sheet[3][0].value
|
|
11
|
+
match = re.search(r'(\d+\.\d+\.\d+)', '' if xlsx_sheet_version_value is None else xlsx_sheet_version_value)
|
|
12
|
+
xlsx_version = match.group(1) if match else None
|
|
13
|
+
except (KeyError, IndexError):
|
|
14
|
+
xlsx_version = None
|
|
15
|
+
return xlsx_version
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
ebi_eva_common_pyutils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
ebi_eva_common_pyutils/assembly_utils.py,sha256=CklyCGlCjlFp0e9pugg6kSsh5L0xfCe2qPvA2eLVtn0,4187
|
|
3
|
-
ebi_eva_common_pyutils/biosamples_communicators.py,sha256=
|
|
3
|
+
ebi_eva_common_pyutils/biosamples_communicators.py,sha256=VdOVFJeNcPHGXTMiQGrMCGytKPW1RnAJ41-s6ui3eY4,7410
|
|
4
4
|
ebi_eva_common_pyutils/command_utils.py,sha256=PtelWWqcC0eOwIVesjwBw3F9KaXRzEE_uAUJhQFZ4l8,2340
|
|
5
5
|
ebi_eva_common_pyutils/common_utils.py,sha256=ty_glvfRa3VGhnpAht4qtVkNNmv-IYfVtO958mY-BaA,1192
|
|
6
6
|
ebi_eva_common_pyutils/config.py,sha256=PtD2SgHf96kk21OA9tVIjEgsDXEFuAU-INy_kfQdoPw,4828
|
|
@@ -10,17 +10,19 @@ ebi_eva_common_pyutils/logger.py,sha256=hT20ktN_oGeB_5ofVfd_aGXB6xYOe0Y5b3EVRYCu
|
|
|
10
10
|
ebi_eva_common_pyutils/ncbi_utils.py,sha256=AKuNKv4ue7l-6rwuDDGubWEHGuscXWfv-Gg6o_x1hT0,5005
|
|
11
11
|
ebi_eva_common_pyutils/network_utils.py,sha256=iJjs5PPzT1V4CceZnCHOTs711AmpwlDo59wb1XHdTak,2648
|
|
12
12
|
ebi_eva_common_pyutils/assembly/__init__.py,sha256=KSWPwBY5nZj00odxWFntk8Sqg_rw273xH8S5D6Jo-T4,67
|
|
13
|
-
ebi_eva_common_pyutils/assembly/assembly.py,sha256=
|
|
13
|
+
ebi_eva_common_pyutils/assembly/assembly.py,sha256=Lf-3Gs4E8hReqQA0roGLiT6nEaz679aKWbwNWoBoJhs,3246
|
|
14
14
|
ebi_eva_common_pyutils/contig_alias/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
ebi_eva_common_pyutils/contig_alias/contig_alias.py,sha256=7tQXljEJtRCMs_JPrglYvTEZ-fJvzl8txwnCvqRB3Ck,5214
|
|
16
16
|
ebi_eva_common_pyutils/reference/__init__.py,sha256=NsDjGCu2H2CZLOPaEL6GCoZo5ND_EA9RFmbzGfpSXRQ,134
|
|
17
17
|
ebi_eva_common_pyutils/reference/assembly.py,sha256=FK4zsvg4_GDeKd9z2z5ZeM9R84TsusgQYdMOGuggQU0,12162
|
|
18
18
|
ebi_eva_common_pyutils/reference/sequence.py,sha256=bg96QcuB-oytQYpaUkV10OzM_RIFhxsy6t3PQOg2Gy0,3911
|
|
19
|
+
ebi_eva_common_pyutils/spreadsheet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
ebi_eva_common_pyutils/spreadsheet/metadata_xlsx_utils.py,sha256=0yOoV5rfLc5IWPAShSClaAOmaGfJuGZjJOnREfZBtFQ,540
|
|
19
21
|
ebi_eva_common_pyutils/taxonomy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
22
|
ebi_eva_common_pyutils/taxonomy/taxonomy.py,sha256=aXmRQ3NAaJotwmmOA2-u2XtcUT6iih-0_e-3QOxynoA,2578
|
|
21
23
|
ebi_eva_common_pyutils/variation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
24
|
ebi_eva_common_pyutils/variation/contig_utils.py,sha256=kMNEW_P2yPnd8Xx1tep19hy5ee7ojxz6ZOO1grTQsRQ,5230
|
|
23
|
-
ebi_eva_common_pyutils-0.
|
|
25
|
+
ebi_eva_common_pyutils-0.7.0.data/scripts/archive_directory.py,sha256=0lWJ0ju_AB2ni7lMnJXPFx6U2OdTGbe-WoQs-4BfKOM,4976
|
|
24
26
|
ebi_eva_internal_pyutils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
27
|
ebi_eva_internal_pyutils/archive_directory.py,sha256=IxVEfh_gaCiT652k0Q_-58fonRusy1yzXu7BCO8yVLo,4989
|
|
26
28
|
ebi_eva_internal_pyutils/config_utils.py,sha256=EGRC5rsmU_ug7OY9-t1UW1XZXRsauSyZB9xPcBux8ts,7909
|
|
@@ -32,8 +34,8 @@ ebi_eva_internal_pyutils/mongodb/__init__.py,sha256=0oyTlkYZCV7udlPl09Zl-sDyE3c9
|
|
|
32
34
|
ebi_eva_internal_pyutils/mongodb/mongo_database.py,sha256=kesaJaaxYFeF_uYZBgL8tbufGKUXll7bXb4WlOS9vKM,9596
|
|
33
35
|
ebi_eva_internal_pyutils/nextflow/__init__.py,sha256=OOiJS8jZOz98q0t77NNog7aI_fFrVxi4kGmiSskuAqM,122
|
|
34
36
|
ebi_eva_internal_pyutils/nextflow/nextflow_pipeline.py,sha256=ew623hhK8jmFLQjJwLZbgBmW9RTiJBEULVqHfIUv_dc,10114
|
|
35
|
-
ebi_eva_common_pyutils-0.
|
|
36
|
-
ebi_eva_common_pyutils-0.
|
|
37
|
-
ebi_eva_common_pyutils-0.
|
|
38
|
-
ebi_eva_common_pyutils-0.
|
|
39
|
-
ebi_eva_common_pyutils-0.
|
|
37
|
+
ebi_eva_common_pyutils-0.7.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
38
|
+
ebi_eva_common_pyutils-0.7.0.dist-info/METADATA,sha256=5VMbdT4gEyEIvgeXhixwWNfJRMsvuLjED4fZrdcY0pc,908
|
|
39
|
+
ebi_eva_common_pyutils-0.7.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
40
|
+
ebi_eva_common_pyutils-0.7.0.dist-info/top_level.txt,sha256=sXoiqiGU8vlMQpFWDlKrekxhlusk06AhkOH3kSvDT6c,48
|
|
41
|
+
ebi_eva_common_pyutils-0.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ebi_eva_common_pyutils-0.6.16.dist-info → ebi_eva_common_pyutils-0.7.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|