Skip to content

Commit

Permalink
refactor: Fix schema validation when using txt files
Browse files Browse the repository at this point in the history
  • Loading branch information
jvfe committed Mar 30, 2024
1 parent 252cb8a commit 5893cd2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions microview/file_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def detect_report_type(report_paths: List[Path], console) -> List[Sample]:
one the report path, the other a string specifying the report type.
"""
kaiju_validated = [
get_validation_dict(report, schema=kaiju_report_schema)
get_validation_dict(report, format="tsv", schema=kaiju_report_schema)
for report in report_paths
]
kaiju_reports = [
Expand All @@ -107,7 +107,7 @@ def detect_report_type(report_paths: List[Path], console) -> List[Sample]:

# TODO: Improve Kraken validation
kraken_validated = [
get_validation_dict(report, checks=[checks.table_dimensions(num_fields=6)])
get_validation_dict(report, format="tsv", checks=[checks.table_dimensions(num_fields=6)])
for report in report_paths
]
kraken_reports = [
Expand Down
8 changes: 4 additions & 4 deletions microview/schemas/kaiju_report.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
"format": "default",
"name": "percent",
"type": "number",
"required": false
"required": true
},
{
"format": "default",
"name": "reads",
"type": "integer",
"required": false
"required": true
},
{
"format": "default",
"name": "taxon_id",
"type": "integer",
"required": false
"required": true
},
{
"format": "default",
"name": "taxon_name",
"type": "string",
"required": false
"required": true
}
],
"missingValues": ["NA"]
Expand Down

0 comments on commit 5893cd2

Please sign in to comment.