Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust file mappings #213

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 17 additions & 15 deletions deployment/conf/supported_apps_w_extensions.json
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Autogenerated file. See the other two for real details.

Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@
"csv",
"tsv",
"xls",
"xlsx",
"json"
"xlsx"
],
"media": [
"tsv",
Expand All @@ -149,6 +148,9 @@
],
"escher_map": [
"json"
],
"dts_manifest": [
"json"
]
},
"types": {
Expand Down Expand Up @@ -1102,31 +1104,31 @@
}
]
},
"json": {
"smbl": {
"file_ext_type": [
"JSON"
"SBML"
],
"mappings": [
{
"id": "import_specification",
"title": "Import Specification",
"app_weight": 1
},
{
"id": "escher_map",
"title": "EscherMap",
"id": "fba_model",
"title": "FBA Model",
"app_weight": 1
}
]
},
"smbl": {
"json": {
"file_ext_type": [
"SBML"
"JSON"
],
"mappings": [
{
"id": "fba_model",
"title": "FBA Model",
"id": "escher_map",
"title": "EscherMap",
"app_weight": 1
},
{
"id": "dts_manifest",
"title": "Data Transfer Service Manifest",
"app_weight": 1
}
]
Expand Down
4 changes: 3 additions & 1 deletion staging_service/autodetect/GenerateMappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
ZIP,
assembly_id,
decompress_id,
dts_manifest,
escher_map_id,
expression_matrix_id,
extension_to_file_format_mapping,
Expand Down Expand Up @@ -90,6 +91,7 @@
phenotype_set_id: "Phenotype Set",
escher_map_id: "EscherMap",
import_specification: "Import Specification",
dts_manifest: "Data Transfer Service Manifest",
}

file_format_to_app_mapping = {}
Expand Down Expand Up @@ -129,7 +131,7 @@
fba_model_id,
import_specification,
]
file_format_to_app_mapping[JSON] = [escher_map_id, import_specification]
file_format_to_app_mapping[JSON] = [escher_map_id, dts_manifest]
file_format_to_app_mapping[SBML] = [fba_model_id]

app_id_to_extensions = defaultdict(list)
Expand Down
4 changes: 4 additions & 0 deletions staging_service/autodetect/Mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
# import_specification is not a "real" data type, but rather tells the narrative that the
# file contains specifications for how to load one or more other staging area files.
import_specification = "import_specification"
# dts_manifest is also not a real data type, but functions like import_specification as
# it tells the narrative that the file has specs for loading other staging area files
# that came from the Data Transfer Service, and that this manifest follows that spec.
dts_manifest = "dts_manifest"
decompress_id = "decompress"
metabolic_annotations_id = "metabolic_annotation"
metabolic_annotations_bulk_id = "metabolic_annotation_bulk"
Expand Down
3 changes: 2 additions & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,8 @@ async def test_importer_filetypes():
a2f = js["datatype_to_filetype"]
assert a2f["assembly"] == ["FASTA"]
assert a2f["gff_genome"] == ["FASTA", "GFF"]
assert a2f["import_specification"] == ["CSV", "EXCEL", "JSON", "TSV"]
assert a2f["import_specification"] == ["CSV", "EXCEL", "TSV"]
assert a2f["dts_manifest"] == ["JSON"]

f2e = js["filetype_to_extensions"]
assert f2e["FASTA"] == [
Expand Down
Loading