Skip to content

Commit

Permalink
target_repository
Browse files Browse the repository at this point in the history
  • Loading branch information
bedroesb committed Nov 5, 2024
1 parent ea16333 commit e39fdfc
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion mars-cli/mars_lib/models/repository_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class RepositoryResponse(BaseModel):
@field_validator("target_repository")
def validate_target_repository(cls, v: str) -> str:
if v not in [item.value for item in TargetRepository]:
raise ValueError(f"Invalid 'target repository' value: '{v}'")
raise ValueError(f"Invalid 'target_repository' value: '{v}'")
return v

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion mars-cli/mars_lib/target_repo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import Enum


TARGET_REPO_KEY = "target repository"
TARGET_REPO_KEY = "target_repository"


class TargetRepository(str, Enum):
Expand Down
10 changes: 5 additions & 5 deletions mars-cli/tests/test_isa_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,28 +121,28 @@ def test_target_repo_comment_validator():
"comments": [
{
"@id": "comment_003",
"name": "target repository",
"name": "target_repository",
"value": TargetRepository.ENA,
},
{
"@id": "comment_004",
"name": "target repository",
"name": "target_repository",
"value": TargetRepository.METABOLIGHTS,
},
],
}

assert Assay.model_validate(valid_assay_json)
with pytest.raises(
ValidationError, match="Invalid 'target repository' value: 'my special repo'"
ValidationError, match="Invalid 'target_repository' value: 'my special repo'"
):
Assay.model_validate(invalid_assay_json)

with pytest.raises(ValidationError, match="'target repository' comment is missing"):
with pytest.raises(ValidationError, match="'target_repository' comment is missing"):
Assay.model_validate(second_invalid_assay_json)

with pytest.raises(
ValidationError, match="Multiple 'target repository' comments found"
ValidationError, match="Multiple 'target_repository' comments found"
):
Assay.model_validate(third_invalid_assay_json)

Expand Down
2 changes: 1 addition & 1 deletion test-data/ISA-BH2023-ALL/i_investigation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Study Assay Technology Type mass spectrometry NMR spectroscopy NMR spectroscopy
Study Assay Technology Type Term Accession Number http://purl.obolibrary.org/obo/CHMO_0000470 http://purl.obolibrary.org/obo/CHMO_0000591 http://purl.obolibrary.org/obo/CHMO_0000591
Study Assay Technology Type Term Source REF MSIO MSIO MSIO MSIO MSIO
Study Assay Technology Platform
Comment[target repository] metabolights metabolights metabolights ega arrayexpress
Comment[target_repository] metabolights metabolights metabolights ega arrayexpress
STUDY PROTOCOLS
Study Protocol Name cell culture and isotopic labeling intracellular metabolite extraction extracellular metabolite extraction liquid chromatography mass spectrometry 1D 13C NMR spectroscopy for isotopomer analysis 1D 13C NMR spectroscopy for metabolite profiling MS metabolite identification NMR metabolite identification mRNA extraction gDNA extraction gDNA library preparation mRNA library preparation sequencing transcription analysis CNV analysis 13C SIRM MS and NMR integrative analysis
Study Protocol Type sample collection metabolite extraction metabolite extraction mass spectrometry nmr spectroscopy nmr spectroscopy metabolite identification data transformation material separation material separation library construction library construction nucleic acid sequencing data transformation data transformation data transformation
Expand Down
10 changes: 5 additions & 5 deletions test-data/ISA-BH2023-ALL/isa-bh2023-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
],
"comments": [
{
"name": "target repository",
"name": "target_repository",
"value": "metabolights"
}
],
Expand Down Expand Up @@ -858,7 +858,7 @@
"characteristicCategories": [],
"comments": [
{
"name": "target repository",
"name": "target_repository",
"value": "metabolights"
}
],
Expand Down Expand Up @@ -2735,7 +2735,7 @@
"characteristicCategories": [],
"comments": [
{
"name": "target repository",
"name": "target_repository",
"value": "metabolights"
}
],
Expand Down Expand Up @@ -3429,7 +3429,7 @@
],
"comments": [
{
"name": "target repository",
"name": "target_repository",
"value": "eva"
}
],
Expand Down Expand Up @@ -4749,7 +4749,7 @@
],
"comments": [
{
"name": "target repository",
"name": "target_repository",
"value": "ena"
}
],
Expand Down
2 changes: 1 addition & 1 deletion test-data/ISA-BH2023-Gx/i_investigation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Study Assay Technology Type nucleic acid sequencing
Study Assay Technology Type Term Accession Number
Study Assay Technology Type Term Source REF MSIO
Study Assay Technology Platform
Comment[target repository] ega
Comment[target_repository] ega
STUDY PROTOCOLS
Study Protocol Name cell culture and isotopic labeling intracellular metabolite extraction extracellular metabolite extraction liquid chromatography mass spectrometry 1D 13C NMR spectroscopy for isotopomer analysis 1D 13C NMR spectroscopy for metabolite profiling MS metabolite identification NMR metabolite identification mRNA extraction gDNA extraction gDNA library preparation mRNA library preparation sequencing transcription analysis CNV analysis 13C SIRM MS and NMR integrative analysis
Study Protocol Type sample collection metabolite extraction metabolite extraction mass spectrometry nmr spectroscopy nmr spectroscopy metabolite identification data transformation material separation material separation library construction library construction nucleic acid sequencing data transformation data transformation data transformation
Expand Down
2 changes: 1 addition & 1 deletion test-data/ISA-BH2023-Mx/i_investigation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Study Assay Technology Type mass spectrometry NMR spectroscopy NMR spectroscopy
Study Assay Technology Type Term Accession Number http://purl.obolibrary.org/obo/CHMO_0000470 http://purl.obolibrary.org/obo/CHMO_0000591 http://purl.obolibrary.org/obo/CHMO_0000591
Study Assay Technology Type Term Source REF MSIO MSIO MSIO
Study Assay Technology Platform
Comment[target repository] metabolights metabolights metabolights
Comment[target_repository] metabolights metabolights metabolights
STUDY PROTOCOLS
Study Protocol Name cell culture and isotopic labeling intracellular metabolite extraction extracellular metabolite extraction liquid chromatography mass spectrometry 1D 13C NMR spectroscopy for isotopomer analysis 1D 13C NMR spectroscopy for metabolite profiling MS metabolite identification NMR metabolite identification mRNA extraction gDNA extraction gDNA library preparation mRNA library preparation sequencing transcription analysis CNV analysis 13C SIRM MS and NMR integrative analysis
Study Protocol Type sample collection metabolite extraction metabolite extraction mass spectrometry nmr spectroscopy nmr spectroscopy metabolite identification data transformation material separation material separation library construction library construction nucleic acid sequencing data transformation data transformation data transformation
Expand Down
2 changes: 1 addition & 1 deletion test-data/ISA-BH2023-Tx/i_investigation.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Study Assay Technology Type nucleic acid sequencing
Study Assay Technology Type Term Accession Number
Study Assay Technology Type Term Source REF MSIO
Study Assay Technology Platform
Comment[target repository] arrayexpress
Comment[target_repository] arrayexpress
STUDY PROTOCOLS
Study Protocol Name cell culture and isotopic labeling intracellular metabolite extraction extracellular metabolite extraction liquid chromatography mass spectrometry 1D 13C NMR spectroscopy for isotopomer analysis 1D 13C NMR spectroscopy for metabolite profiling MS metabolite identification NMR metabolite identification mRNA extraction gDNA extraction gDNA library preparation mRNA library preparation sequencing transcription analysis CNV analysis 13C SIRM MS and NMR integrative analysis
Study Protocol Type sample collection metabolite extraction metabolite extraction mass spectrometry nmr spectroscopy nmr spectroscopy metabolite identification data transformation material separation material separation library construction library construction nucleic acid sequencing data transformation data transformation data transformation
Expand Down
20 changes: 10 additions & 10 deletions test-data/biosamples-input-isa.json
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@
],
"comments": [
{
"name": "target repository",
"name": "target_repository",
"value": "ena"
}
],
Expand Down Expand Up @@ -974,27 +974,27 @@
"dataFiles": [
{
"@id": "#data/334",
"name": "fake2.bam",
"name": "RD file 1b",
"type": "Raw Data File",
"comments": [
{
"name": "file type",
"value": "bam"
"name": "file_name",
"value": "ENA_TEST2.R2.fastq.gz"
},
{
"name": "file checksum",
"value": "9840f585055afc37de353706fd31a377"
"name": "file_type",
"value": "fastq"
},
{
"name": "submission date",
"value": ""
"name": "file checksum",
"value": "69c903251902c1e0b75331f70e531012"
},
{
"name": "status",
"name": "accession",
"value": ""
},
{
"name": "accession",
"name": "submission date",
"value": ""
}
]
Expand Down

0 comments on commit e39fdfc

Please sign in to comment.