mtbls-mhd-integration 0.0.15__tar.gz → 0.0.17__tar.gz

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.
Files changed (28) hide show
  1. {mtbls_mhd_integration-0.0.15/mtbls_mhd_integration.egg-info → mtbls_mhd_integration-0.0.17}/PKG-INFO +2 -2
  2. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/__init__.py +1 -1
  3. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/v0_1/legacy/builder.py +21 -14
  4. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17/mtbls_mhd_integration.egg-info}/PKG-INFO +2 -2
  5. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls_mhd_integration.egg-info/requires.txt +1 -1
  6. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/pyproject.toml +3 -3
  7. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/LICENSE +0 -0
  8. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/README.md +0 -0
  9. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/commands/__init__.py +0 -0
  10. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/commands/cli.py +0 -0
  11. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/commands/create.py +0 -0
  12. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/commands/create_mhd_file.py +0 -0
  13. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/commands/validate.py +0 -0
  14. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/config.py +0 -0
  15. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/convertor_factory.py +0 -0
  16. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/v0_1/__init__.py +0 -0
  17. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/v0_1/legacy/__init__.py +0 -0
  18. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/v0_1/legacy/convertor.py +0 -0
  19. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/v0_1/legacy/db_metadata_collector.py +0 -0
  20. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/v0_1/legacy/folder_metadata_collector.py +0 -0
  21. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/v0_1/legacy/mtbls_study_schema.py +0 -0
  22. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/v0_1/ms/__init__.py +0 -0
  23. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls2mhd/v0_1/ms/convertor.py +0 -0
  24. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls_mhd_integration.egg-info/SOURCES.txt +0 -0
  25. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls_mhd_integration.egg-info/dependency_links.txt +0 -0
  26. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls_mhd_integration.egg-info/entry_points.txt +0 -0
  27. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/mtbls_mhd_integration.egg-info/top_level.txt +0 -0
  28. {mtbls_mhd_integration-0.0.15 → mtbls_mhd_integration-0.0.17}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mtbls-mhd-integration
3
- Version: 0.0.15
3
+ Version: 0.0.17
4
4
  Summary: MetaboLights - MetabolomicsHub Integration
5
5
  Author-email: MetaboLights Team <metabolights-help@ebi.ac.uk>
6
6
  License-Expression: Apache-2.0
@@ -9,7 +9,7 @@ Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
10
  Requires-Dist: asyncpg>=0.30.0
11
11
  Requires-Dist: metabolights-utils>=1.4.18
12
- Requires-Dist: mhd-model>=0.1.44
12
+ Requires-Dist: mhd-model>=0.1.46
13
13
  Requires-Dist: psycopg[binary,pool]>=3.3.2
14
14
  Requires-Dist: pydantic>=2.12.4
15
15
  Requires-Dist: pydantic-settings>=2.10.1
@@ -1,4 +1,4 @@
1
- __version__ = "v0.0.15"
1
+ __version__ = "v0.0.17"
2
2
 
3
3
  import pathlib
4
4
  import sys
@@ -26,7 +26,7 @@ from mhd_model.model.v0_1.dataset.profiles.legacy.profile import MhDatasetLegacy
26
26
  from mhd_model.model.v0_1.rules.managed_cv_terms import (
27
27
  COMMON_ASSAY_TYPES,
28
28
  COMMON_CHARACTERISTIC_DEFINITIONS,
29
- COMMON_MEASUREMENT_TYPES,
29
+ COMMON_MEASUREMENT_TYPES_MAP,
30
30
  COMMON_OMICS_TYPES,
31
31
  COMMON_PARAMETER_DEFINITIONS,
32
32
  COMMON_PROTOCOLS,
@@ -61,11 +61,11 @@ MTBLS_ASSAY_TYPES = {
61
61
  "MS": COMMON_ASSAY_TYPES["OBI:0000470"],
62
62
  }
63
63
  MTBLS_MEASUREMENT_TYPES = {
64
- "targeted": COMMON_MEASUREMENT_TYPES["MSIO:0000100"],
65
- "untargeted": COMMON_MEASUREMENT_TYPES["MSIO:0000101"],
64
+ "targeted": COMMON_MEASUREMENT_TYPES_MAP["MSIO:0000100"],
65
+ "untargeted": COMMON_MEASUREMENT_TYPES_MAP["MSIO:0000101"],
66
66
  }
67
67
 
68
- DEFAULT_MEASUREMENT_TYPE = COMMON_MEASUREMENT_TYPES["MSIO:0000101"]
68
+ DEFAULT_MEASUREMENT_TYPE = COMMON_MEASUREMENT_TYPES_MAP["MSIO:0000101"]
69
69
 
70
70
  DEFAULT_OMICS_TYPE = COMMON_OMICS_TYPES["EDAM:3172"]
71
71
 
@@ -283,6 +283,7 @@ class MhdLegacyDatasetBuilder:
283
283
  if x
284
284
  ]
285
285
  ),
286
+ email_list=[submitter.user_name],
286
287
  )
287
288
  mhd_builder.add(mhd_contact)
288
289
  mhd_builder.link(
@@ -331,6 +332,11 @@ class MhdLegacyDatasetBuilder:
331
332
  idx,
332
333
  )
333
334
  continue
335
+ if contact.additional_emails:
336
+ if mhd_contact.email_list:
337
+ mhd_contact.email_list.extend(contact.additional_emails)
338
+ else:
339
+ mhd_contact.email_list = contact.additional_emails
334
340
  if not mhd_contact.email_list:
335
341
  logger.warning(
336
342
  "%s study %s. contact's ('%s') email is empty. Contact will be ignored.",
@@ -360,7 +366,11 @@ class MhdLegacyDatasetBuilder:
360
366
  organization,
361
367
  reverse_relationship_name="affiliates",
362
368
  )
369
+ roles = set()
363
370
  for role in contact.roles:
371
+ if role.term.lower() in roles:
372
+ continue
373
+ roles.add(role.term.lower())
364
374
  if role.term.lower() == "principal investigator":
365
375
  mhd_builder.link(
366
376
  mhd_contact,
@@ -429,7 +439,7 @@ class MhdLegacyDatasetBuilder:
429
439
  else:
430
440
  mhd_contact = contacts[submitter.user_name]
431
441
  submitter_roles = [
432
- x for x in contact.roles if x.term == "submitter"
442
+ x for x in contact.roles if x.term.lower() == "submitter"
433
443
  ]
434
444
  if not submitter_roles:
435
445
  mhd_builder.link(
@@ -1487,17 +1497,17 @@ class MhdLegacyDatasetBuilder:
1487
1497
  )
1488
1498
  mhd_builder.add_node(keyword)
1489
1499
 
1490
- if item.source and item.source.lower() in ("data-curation", "workflows"):
1500
+ if not item.source or item.source.lower() in ("submitter",):
1491
1501
  mhd_builder.link(
1492
1502
  mhd_study,
1493
- "has-repository-keyword",
1503
+ "has-submitter-keyword",
1494
1504
  keyword,
1495
1505
  reverse_relationship_name="keyword-of",
1496
1506
  )
1497
1507
  else:
1498
1508
  mhd_builder.link(
1499
1509
  mhd_study,
1500
- "has-submitter-keyword",
1510
+ "has-repository-keyword",
1501
1511
  keyword,
1502
1512
  reverse_relationship_name="keyword-of",
1503
1513
  )
@@ -1525,20 +1535,17 @@ class MhdLegacyDatasetBuilder:
1525
1535
  )
1526
1536
  mhd_builder.add_node(keyword)
1527
1537
 
1528
- if item.source and item.source.lower() in (
1529
- "data-curation",
1530
- "workflows",
1531
- ):
1538
+ if not item.source or item.source.lower() in ("submitter",):
1532
1539
  mhd_builder.link(
1533
1540
  mhd_assay,
1534
- "has-repository-keyword",
1541
+ "has-submitter-keyword",
1535
1542
  keyword,
1536
1543
  reverse_relationship_name="keyword-of",
1537
1544
  )
1538
1545
  else:
1539
1546
  mhd_builder.link(
1540
1547
  mhd_assay,
1541
- "has-submitter-keyword",
1548
+ "has-repository-keyword",
1542
1549
  keyword,
1543
1550
  reverse_relationship_name="keyword-of",
1544
1551
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mtbls-mhd-integration
3
- Version: 0.0.15
3
+ Version: 0.0.17
4
4
  Summary: MetaboLights - MetabolomicsHub Integration
5
5
  Author-email: MetaboLights Team <metabolights-help@ebi.ac.uk>
6
6
  License-Expression: Apache-2.0
@@ -9,7 +9,7 @@ Description-Content-Type: text/markdown
9
9
  License-File: LICENSE
10
10
  Requires-Dist: asyncpg>=0.30.0
11
11
  Requires-Dist: metabolights-utils>=1.4.18
12
- Requires-Dist: mhd-model>=0.1.44
12
+ Requires-Dist: mhd-model>=0.1.46
13
13
  Requires-Dist: psycopg[binary,pool]>=3.3.2
14
14
  Requires-Dist: pydantic>=2.12.4
15
15
  Requires-Dist: pydantic-settings>=2.10.1
@@ -1,6 +1,6 @@
1
1
  asyncpg>=0.30.0
2
2
  metabolights-utils>=1.4.18
3
- mhd-model>=0.1.44
3
+ mhd-model>=0.1.46
4
4
  psycopg[binary,pool]>=3.3.2
5
5
  pydantic>=2.12.4
6
6
  pydantic-settings>=2.10.1
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mtbls-mhd-integration"
3
- version = "0.0.15"
3
+ version = "0.0.17"
4
4
  description = "MetaboLights - MetabolomicsHub Integration"
5
5
  authors = [{"name" = "MetaboLights Team", "email" = "metabolights-help@ebi.ac.uk"}]
6
6
  license = "Apache-2.0"
@@ -9,7 +9,7 @@ requires-python = ">=3.12,<4.0"
9
9
  dependencies = [
10
10
  "asyncpg>=0.30.0",
11
11
  "metabolights-utils>=1.4.18",
12
- "mhd-model>=0.1.44",
12
+ "mhd-model>=0.1.46",
13
13
  "psycopg[binary,pool]>=3.3.2",
14
14
  "pydantic>=2.12.4",
15
15
  "pydantic-settings>=2.10.1",
@@ -54,7 +54,7 @@ exclude = ["tests*", "docs*"]
54
54
  [tool.commitizen]
55
55
  name = "cz_conventional_commits"
56
56
  version_provider = "uv"
57
- version = "0.0.153"
57
+ version = "0.0.173"
58
58
  tag_format = "v$major.$minor.$patch"
59
59
  version_files = [
60
60
  "pyproject.toml:version",