Skip to content

Commit 90dd5df

Browse files
authored
Merge pull request #49 from oyurekten/metabolights-data-type-support
new and updated values for DataTypeEnum
2 parents b901090 + a724d42 commit 90dd5df

File tree

3 files changed

+105
-86
lines changed

3 files changed

+105
-86
lines changed

mars-cli/mars_lib/models/isa_json.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,18 @@ class DataTypeEnum(str, Enum):
3131
RAW_DATA_FILE = "Raw Data File"
3232
DERIVED_DATA_FILE = "Derived Data File"
3333
IMAGE_FILE = "Image File"
34-
SPECTRAL_RAW_DATA_FILE = "Spectral Raw Data File" # TODO: QUESTION: This is not mentioned in the specs (https://isa-specs.readthedocs.io/)
35-
FREE_INDUCTION_DECAY_FILE = "Free Induction Decay File" # TODO: QUESTION: This is not mentioned in the specs (https://isa-specs.readthedocs.io/)
34+
# The following names are not mentioned in the specs (https://isa-specs.readthedocs.io/en/latest/isajson.html#data-schema-json).
35+
# However, spectral data file names are mentioned in the ISA-Tab specs (https://isa-specs.readthedocs.io/en/latest/isatab.html).
36+
# TODO: Review and support all possible data file names mentioned in the the ISA-Tab specs (Section 2.3.8).
37+
# Metabolights support the following data file types:
38+
RAW_SPECTRAL_DATA_FILE = "Raw Spectral Data File"
39+
DERIVED_SPECTRAL_DATA_FILE = "Derived Spectral Data File"
40+
FREE_INDUCTION_DECAY_DATA_FILE = "Free Induction Decay Data File"
41+
ACQUSITION_PARAMETER_DATA_FILE = "Acquisition Parameter Data File"
42+
METABOLITE_ASSIGNMENT_FILE = "Metabolite Assignment File" # Used in MetaboLights to report metabolite assignments
43+
44+
45+
DATA_TYPE_VALUES = {item.value for item in DataTypeEnum}
3646

3747

3848
class Data(IsaBase):
@@ -43,7 +53,7 @@ class Data(IsaBase):
4353

4454
@field_validator("type")
4555
def apply_enum(cls, v: str) -> str:
46-
if v not in [item.value for item in DataTypeEnum]:
56+
if v not in DATA_TYPE_VALUES:
4757
raise ValueError("Invalid material type")
4858
return v
4959

test-data/ISA-BH2023-ALL/isa-bh2023-all.json

+51-42
Original file line numberDiff line numberDiff line change
@@ -65,59 +65,65 @@
6565
}
6666
],
6767
"dataFiles": [
68+
{
69+
"@id": "#data_file/4dd85c35-6e70-4541-99ac-324328f817eb",
70+
"comments": [],
71+
"name": "m_BH2023___metabolite_profiling_v2_maf.tsv",
72+
"type": "Metabolite Assignment File"
73+
},
6874
{
6975
"@id": "#data_file/b3530ec1-6bc5-4757-a526-81c1773530a6",
7076
"comments": [],
7177
"name": "isotopologue-distribution-analysis.txt",
72-
"type": "Derived Data File"
78+
"type": "Derived Spectral Data File"
7379
},
7480
{
7581
"@id": "#data_file/2647db5f-0ed8-4536-aec7-8d5d4cfc65d3",
7682
"comments": [],
7783
"name": "ms-data-0.mzml",
78-
"type": "Spectral Raw Data File"
84+
"type": "Raw Spectral Data File"
7985
},
8086
{
8187
"@id": "#data_file/d3cf3b1f-f375-4763-8837-89d9f453116c",
8288
"comments": [],
8389
"name": "ms-data-1.mzml",
84-
"type": "Spectral Raw Data File"
90+
"type": "Raw Spectral Data File"
8591
},
8692
{
8793
"@id": "#data_file/ca61e6d1-0cab-45be-b333-e45583e06311",
8894
"comments": [],
8995
"name": "ms-data-2.mzml",
90-
"type": "Spectral Raw Data File"
96+
"type": "Raw Spectral Data File"
9197
},
9298
{
9399
"@id": "#data_file/0eb3dcc9-b79c-4b44-ac31-b977ea63ae2c",
94100
"comments": [],
95101
"name": "ms-data-3.mzml",
96-
"type": "Spectral Raw Data File"
102+
"type": "Raw Spectral Data File"
97103
},
98104
{
99105
"@id": "#data_file/a449d1e5-9f71-4503-a165-97c5a4c69252",
100106
"comments": [],
101107
"name": "ms-data-4.mzml",
102-
"type": "Spectral Raw Data File"
108+
"type": "Raw Spectral Data File"
103109
},
104110
{
105111
"@id": "#data_file/f32fe0d7-d349-4f70-948e-17f7d8ec22fe",
106112
"comments": [],
107113
"name": "ms-data-5.mzml",
108-
"type": "Spectral Raw Data File"
114+
"type": "Raw Spectral Data File"
109115
},
110116
{
111117
"@id": "#data_file/15c1fb2e-2814-4bff-a37d-cb336fb8b5f4",
112118
"comments": [],
113119
"name": "ms-data-6.mzml",
114-
"type": "Spectral Raw Data File"
120+
"type": "Raw Spectral Data File"
115121
},
116122
{
117123
"@id": "#data_file/402b1d0c-6925-44bd-a365-16bf933659aa",
118124
"comments": [],
119125
"name": "ms-data-7.mzml",
120-
"type": "Spectral Raw Data File"
126+
"type": "Raw Spectral Data File"
121127
}
122128
],
123129
"filename": "a_BH2023-isotopologue-ms-assay.txt",
@@ -819,6 +825,9 @@
819825
"outputs": [
820826
{
821827
"@id": "#data_file/b3530ec1-6bc5-4757-a526-81c1773530a6"
828+
},
829+
{
830+
"@id": "#data_file/4dd85c35-6e70-4541-99ac-324328f817eb"
822831
}
823832
],
824833
"parameterValues": [
@@ -864,193 +873,193 @@
864873
"@id": "#data_file/cc587806-e123-459e-b089-37731063b6ce",
865874
"comments": [],
866875
"name": "nmr-data-topoHACO-DIPSY-1.nmrml",
867-
"type": "Free Induction Decay File"
876+
"type": "Free Induction Decay Data File"
868877
},
869878
{
870879
"@id": "#data_file/5b4ec5f5-57c1-459d-b022-2a21395f0dbc",
871880
"comments": [],
872881
"name": "nmr-data-topoHACO-DIPSY-2.nmrml",
873-
"type": "Free Induction Decay File"
882+
"type": "Free Induction Decay Data File"
874883
},
875884
{
876885
"@id": "#data_file/053fe2d8-a3c1-4405-90ba-5a44576b4755",
877886
"comments": [],
878887
"name": "nmr-data-topoHACO-DIPSY-3.nmrml",
879-
"type": "Free Induction Decay File"
888+
"type": "Free Induction Decay Data File"
880889
},
881890
{
882891
"@id": "#data_file/5b6f541e-ed67-4061-9ce7-987b299b238c",
883892
"comments": [],
884893
"name": "nmr-data-topoHACO-DIPSY-4.nmrml",
885-
"type": "Free Induction Decay File"
894+
"type": "Free Induction Decay Data File"
886895
},
887896
{
888897
"@id": "#data_file/8ac4d26e-9d70-48eb-97b2-fd2b03d70dc7",
889898
"comments": [],
890899
"name": "nmr-data-topoHACO-DIPSY-5.nmrml",
891-
"type": "Free Induction Decay File"
900+
"type": "Free Induction Decay Data File"
892901
},
893902
{
894903
"@id": "#data_file/632db404-8826-40f1-92b0-3e5f17b48e17",
895904
"comments": [],
896905
"name": "nmr-data-topoHACO-DIPSY-6.nmrml",
897-
"type": "Free Induction Decay File"
906+
"type": "Free Induction Decay Data File"
898907
},
899908
{
900909
"@id": "#data_file/6dbadd82-109c-4e87-9a9d-3fe0f820d066",
901910
"comments": [],
902911
"name": "nmr-data-topoHACO-DIPSY-7.nmrml",
903-
"type": "Free Induction Decay File"
912+
"type": "Free Induction Decay Data File"
904913
},
905914
{
906915
"@id": "#data_file/f8b16168-af0c-45a5-8748-9bbd9579457b",
907916
"comments": [],
908917
"name": "nmr-data-topoHACO-DIPSY-8.nmrml",
909-
"type": "Free Induction Decay File"
918+
"type": "Free Induction Decay Data File"
910919
},
911920
{
912921
"@id": "#data_file/2b5b1f3e-6ad3-42eb-8dc3-988d9f35b134",
913922
"comments": [],
914923
"name": "nmr-data-topoHNCA-1.nmrml",
915-
"type": "Free Induction Decay File"
924+
"type": "Free Induction Decay Data File"
916925
},
917926
{
918927
"@id": "#data_file/e23ccca9-7f27-4001-b4f7-632ac031476b",
919928
"comments": [],
920929
"name": "nmr-data-topoHNCA-2.nmrml",
921-
"type": "Free Induction Decay File"
930+
"type": "Free Induction Decay Data File"
922931
},
923932
{
924933
"@id": "#data_file/1285966c-8236-46d6-9b6d-ecd99af63503",
925934
"comments": [],
926935
"name": "nmr-data-topoHNCA-3.nmrml",
927-
"type": "Free Induction Decay File"
936+
"type": "Free Induction Decay Data File"
928937
},
929938
{
930939
"@id": "#data_file/b4051169-6be9-41cd-9cf1-0b62287226f2",
931940
"comments": [],
932941
"name": "nmr-data-topoHNCA-4.nmrml",
933-
"type": "Free Induction Decay File"
942+
"type": "Free Induction Decay Data File"
934943
},
935944
{
936945
"@id": "#data_file/ccd56c4c-d54e-4629-90cf-01b088242fd8",
937946
"comments": [],
938947
"name": "nmr-data-topoHNCA-5.nmrml",
939-
"type": "Free Induction Decay File"
948+
"type": "Free Induction Decay Data File"
940949
},
941950
{
942951
"@id": "#data_file/743004a7-7a7a-4d84-ada5-59bc145494dd",
943952
"comments": [],
944953
"name": "nmr-data-topoHNCA-6.nmrml",
945-
"type": "Free Induction Decay File"
954+
"type": "Free Induction Decay Data File"
946955
},
947956
{
948957
"@id": "#data_file/ee89ba9a-4338-495a-ac7c-bc817788dd0d",
949958
"comments": [],
950959
"name": "nmr-data-topoHNCA-7.nmrml",
951-
"type": "Free Induction Decay File"
960+
"type": "Free Induction Decay Data File"
952961
},
953962
{
954963
"@id": "#data_file/a8443352-8dfa-4afc-9253-db2033520d38",
955964
"comments": [],
956965
"name": "nmr-data-topoHNCA-8.nmrml",
957-
"type": "Free Induction Decay File"
966+
"type": "Free Induction Decay Data File"
958967
},
959968
{
960969
"@id": "#data_file/6b436486-605b-4099-94be-293d2a9c149a",
961970
"comments": [],
962971
"name": "nmr-data-topoHSQC-1.nmrml",
963-
"type": "Free Induction Decay File"
972+
"type": "Free Induction Decay Data File"
964973
},
965974
{
966975
"@id": "#data_file/2dd6ce6a-d36d-4f50-9a59-abb922729aa7",
967976
"comments": [],
968977
"name": "nmr-data-topoHSQC-2.nmrml",
969-
"type": "Free Induction Decay File"
978+
"type": "Free Induction Decay Data File"
970979
},
971980
{
972981
"@id": "#data_file/f2b57ff4-3a49-4954-9473-ac2cb9caf990",
973982
"comments": [],
974983
"name": "nmr-data-topoHSQC-3.nmrml",
975-
"type": "Free Induction Decay File"
984+
"type": "Free Induction Decay Data File"
976985
},
977986
{
978987
"@id": "#data_file/caaec7ef-2b45-44d4-a795-be3e95ba698f",
979988
"comments": [],
980989
"name": "nmr-data-topoHSQC-4.nmrml",
981-
"type": "Free Induction Decay File"
990+
"type": "Free Induction Decay Data File"
982991
},
983992
{
984993
"@id": "#data_file/7c25feec-5af8-4a0d-84cf-755fce9cb33c",
985994
"comments": [],
986995
"name": "nmr-data-topoHSQC-5.nmrml",
987-
"type": "Free Induction Decay File"
996+
"type": "Free Induction Decay Data File"
988997
},
989998
{
990999
"@id": "#data_file/470899c8-03d5-4c3e-bc0f-5b1c294e37f6",
9911000
"comments": [],
9921001
"name": "nmr-data-topoHSQC-6.nmrml",
993-
"type": "Free Induction Decay File"
1002+
"type": "Free Induction Decay Data File"
9941003
},
9951004
{
9961005
"@id": "#data_file/ef1692cd-12a1-4e25-b035-3c3c7dc76931",
9971006
"comments": [],
9981007
"name": "nmr-data-topoHSQC-7.nmrml",
999-
"type": "Free Induction Decay File"
1008+
"type": "Free Induction Decay Data File"
10001009
},
10011010
{
10021011
"@id": "#data_file/eb9c13be-d281-4081-ae03-fe8519461948",
10031012
"comments": [],
10041013
"name": "nmr-data-topoHSQC-8.nmrml",
1005-
"type": "Free Induction Decay File"
1014+
"type": "Free Induction Decay Data File"
10061015
},
10071016
{
10081017
"@id": "#data_file/0d00bdaa-df1a-4e14-a497-a95dd5f729a0",
10091018
"comments": [],
10101019
"name": "nmr-data-topoZQF-TOCSY-1.nmrml",
1011-
"type": "Free Induction Decay File"
1020+
"type": "Free Induction Decay Data File"
10121021
},
10131022
{
10141023
"@id": "#data_file/72496274-97ad-4e72-b7fd-7c500ac69b4b",
10151024
"comments": [],
10161025
"name": "nmr-data-topoZQF-TOCSY-2.nmrml",
1017-
"type": "Free Induction Decay File"
1026+
"type": "Free Induction Decay Data File"
10181027
},
10191028
{
10201029
"@id": "#data_file/a4465bef-42fe-43bd-89a0-872a6b749a7a",
10211030
"comments": [],
10221031
"name": "nmr-data-topoZQF-TOCSY-3.nmrml",
1023-
"type": "Free Induction Decay File"
1032+
"type": "Free Induction Decay Data File"
10241033
},
10251034
{
10261035
"@id": "#data_file/c7f86f88-92a6-4490-8672-cef8fbbfa25a",
10271036
"comments": [],
10281037
"name": "nmr-data-topoZQF-TOCSY-4.nmrml",
1029-
"type": "Free Induction Decay File"
1038+
"type": "Free Induction Decay Data File"
10301039
},
10311040
{
10321041
"@id": "#data_file/bd4b9325-bca0-4770-b287-4f515036333c",
10331042
"comments": [],
10341043
"name": "nmr-data-topoZQF-TOCSY-5.nmrml",
1035-
"type": "Free Induction Decay File"
1044+
"type": "Free Induction Decay Data File"
10361045
},
10371046
{
10381047
"@id": "#data_file/effd7cc5-3bc6-4d40-9bc8-c21b819ba95e",
10391048
"comments": [],
10401049
"name": "nmr-data-topoZQF-TOCSY-6.nmrml",
1041-
"type": "Free Induction Decay File"
1050+
"type": "Free Induction Decay Data File"
10421051
},
10431052
{
10441053
"@id": "#data_file/7da41385-7cb8-4a3e-85bb-360f4ea90a16",
10451054
"comments": [],
10461055
"name": "nmr-data-topoZQF-TOCSY-7.nmrml",
1047-
"type": "Free Induction Decay File"
1056+
"type": "Free Induction Decay Data File"
10481057
},
10491058
{
10501059
"@id": "#data_file/5b69b0e6-95da-4534-bd0d-02527f9a1b8d",
10511060
"comments": [],
10521061
"name": "nmr-data-topoZQF-TOCSY-8.nmrml",
1053-
"type": "Free Induction Decay File"
1062+
"type": "Free Induction Decay Data File"
10541063
}
10551064
],
10561065
"filename": "a_BH2023-isotopomer-nmr-assay.txt",
@@ -2741,7 +2750,7 @@
27412750
"@id": "#data_file/abee3156-8521-4539-bcf3-c5bfeadb2f83",
27422751
"comments": [],
27432752
"name": "nmr-data-topoHACO-DIPSY-8.nmrml",
2744-
"type": "Free Induction Decay File"
2753+
"type": "Free Induction Decay Data File"
27452754
}
27462755
],
27472756
"filename": "a_BH2023-metabolite-profiling-nmr-assay.txt",

0 commit comments

Comments
 (0)