eva-sub-cli 0.6.1__tar.gz → 0.6.2__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.
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/PKG-INFO +1 -1
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/_version.py +3 -3
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/etc/spreadsheet2json_conf.yaml +1 -0
- eva_sub_cli-0.6.2/eva_sub_cli/executables/format_metadata.py +42 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/file_utils.py +0 -23
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/nextflow/validation.nf +30 -2
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/validators/docker_validator.py +1 -1
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/validators/validator.py +12 -10
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli.egg-info/PKG-INFO +1 -1
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli.egg-info/SOURCES.txt +3 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli.egg-info/entry_points.txt +1 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/pyproject.toml +1 -0
- eva_sub_cli-0.6.2/tests/resources/EVA_Submission_test_with_links.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_file_utils.py +1 -32
- eva_sub_cli-0.6.2/tests/test_format_metadata.py +64 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_validator.py +33 -2
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_xlsx2json.py +29 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/.github/workflows/integration-tests.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/.github/workflows/publish.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/.github/workflows/publish_docs.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/.github/workflows/tests.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/.github/workflows/trigger-eva-sub-cli-integration-tests.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/.gitignore +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/LICENSE +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/README.md +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/conda/build.sh +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/conda/meta.yaml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/docker/Dockerfile +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/docs/README.md +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/docs/_config.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/docs/how_to_submit.md +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/docs/input_file_overview.md +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/docs/installation.md +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/docs/using_nextflow.md +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/docs/validation_overview.md +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/__init__.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/auth.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/call_home.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/date_utils.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/etc/EVA_Submission_Example.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/etc/EVA_Submission_template.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/etc/call_home_payload_schema.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/etc/eva-biosamples.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/etc/eva_logo.png +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/etc/eva_schema.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/etc/spreadsheet2json_conf_V2.yaml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/__init__.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/invalid_file_type_exception.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/metadata_template_version_exception.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/submission_not_found_exception.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/submission_status_exception.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/submission_upload_exception.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/executables/__init__.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/executables/check_fasta_insdc.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/executables/check_metadata_semantics.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/executables/cli.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/executables/evidence_type_checker.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/executables/samples_checker.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/executables/trim_down.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/executables/xlsx2json.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/fasta_check.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/file_validation.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/metadata_validation.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/project_details.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/report.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/sample_name_check.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/shallow_validation.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/fasta_check.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/file_validation.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/metadata_validation.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/project_details.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/report.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/sample_name_check.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/shallow_validation.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/metadata.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/orchestrator.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/report.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/semantic_metadata.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/submission_ws.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/submit.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/utils.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/validators/__init__.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/validators/native_validator.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/validators/validation_results_parsers.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli.egg-info/dependency_links.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli.egg-info/requires.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli.egg-info/top_level.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/pytest.ini +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/requirements.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/setup.cfg +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/setup.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/build_and_test_docker_locally.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/ignore_test_nextflow_validation.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_Docker_Test.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_V2.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_fails.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_version_missing.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_with_asm_report.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_with_non_vcf_files.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_with_non_vcf_files.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_with_project_accession.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_with_project_accession.xlsx +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/assembly_check/invalid.vcf.assembly_check.log +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/assembly_check/invalid.vcf.text_assembly_report.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/assembly_reports/input_passed.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/fasta_files/Saccharomyces_cerevisiae_I.fa +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/fasta_files/input_passed.fa +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/fasta_files/multi_seq.fa +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/metadata_with_filename.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_checker/evidence_type.yaml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_checker/example1.vcf.gz +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_checker/example2.vcf +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_checker/example3.vcf +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_checker/metadata.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_in_vcf_check/allele_freq.vcf +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_in_vcf_check/fake_fasta.fa +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_in_vcf_check/genotype.vcf +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_in_vcf_check/metadata_af_no_sample_in_vcf.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_in_vcf_check/metadata_af_with_sample_in_vcf.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_in_vcf_check/metadata_genotype_no_sample_in_vcf.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/sample_in_vcf_check/metadata_genotype_with_sample_in_vcf.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/expected_metadata_json_report.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/expected_metadata_json_report.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/expected_metadata_xlsx_report.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/expected_metadata_xlsx_report.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/expected_report_metadata_json_process_not_run.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/expected_report_metadata_json_process_not_run.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/expected_shallow_metadata_xlsx_report.html +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/expected_shallow_metadata_xlsx_report.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/assembly_check/input_passed.vcf.assembly_check.log +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/assembly_check/input_passed.vcf.text_assembly_report.1680102476700.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/assembly_check/input_passed.vcf.valid_assembly_report.1680102476700.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/metadata.json +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/other_validations/evidence_type_checker.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/other_validations/file_info.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/other_validations/input_passed.fa_check.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/other_validations/input_passed_trim_down.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/other_validations/metadata_conversion_errors.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/other_validations/metadata_semantic_check.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/other_validations/metadata_validation.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/other_validations/sample_checker.yml +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/vcf_format/input_passed.vcf.errors.1680102476854.db +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/vcf_format/input_passed.vcf.errors.1680102476854.txt +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/validation_reports/validation_output/vcf_format/input_passed.vcf.vcf_format.log +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/vcf_files/example2.vcf.gz +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/vcf_files/example2.vcf.gz.tbi +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/vcf_files/input_passed.vcf +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_auth.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_call_home.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_check_fasta_insdc.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_cli.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_docker_validator.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_evidence_type_checker.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_metadata.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_native_validator_sample_in_vcf.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_orchestrator.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_report.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_samples_checker.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_semantic_metadata.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_submit.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_trim_down.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_utils.py +0 -0
- {eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/test_validaton_results_parsers.py +0 -0
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '0.6.
|
|
32
|
-
__version_tuple__ = version_tuple = (0, 6,
|
|
31
|
+
__version__ = version = '0.6.2'
|
|
32
|
+
__version_tuple__ = version_tuple = (0, 6, 2)
|
|
33
33
|
|
|
34
|
-
__commit_id__ = commit_id = '
|
|
34
|
+
__commit_id__ = commit_id = 'g1dbfe4351'
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import argparse
|
|
3
|
+
import json
|
|
4
|
+
import shutil
|
|
5
|
+
|
|
6
|
+
from ebi_eva_common_pyutils.logger import logging_config
|
|
7
|
+
logger = logging_config.get_logger(__name__)
|
|
8
|
+
|
|
9
|
+
def format_experiment_type(json_file_input, json_file_output):
|
|
10
|
+
try:
|
|
11
|
+
with open(json_file_input, 'r') as input:
|
|
12
|
+
json_data = json.load(input)
|
|
13
|
+
|
|
14
|
+
for analysis_item in json_data.get("analysis", []):
|
|
15
|
+
original_experiment_type = analysis_item.get("experimentType", "")
|
|
16
|
+
logger.info(f"Formatting metadata - experiment type to capitalized - {original_experiment_type}")
|
|
17
|
+
experiment_type_capital = original_experiment_type.capitalize()
|
|
18
|
+
analysis_item["experimentType"] = experiment_type_capital or ""
|
|
19
|
+
|
|
20
|
+
with open(json_file_output, 'w') as output:
|
|
21
|
+
json.dump(json_data, output, indent=4)
|
|
22
|
+
return json_file_output
|
|
23
|
+
|
|
24
|
+
except (FileNotFoundError, json.JSONDecodeError, KeyError) as e:
|
|
25
|
+
# if the try block fails, copy the input file (because nextflow is expecting the output file).
|
|
26
|
+
logger.error(f"Failed to process JSON: {e}")
|
|
27
|
+
shutil.copy(json_file_input, json_file_output)
|
|
28
|
+
return None
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def main():
|
|
32
|
+
arg_parser = argparse.ArgumentParser(
|
|
33
|
+
description='Formats experiment type for the metadata.')
|
|
34
|
+
arg_parser.add_argument('--metadata_json_input', required=True, dest='metadata_json_input',
|
|
35
|
+
help='EVA metadata json file INPUT')
|
|
36
|
+
arg_parser.add_argument('--metadata_json_output', required=True, dest='metadata_json_output',
|
|
37
|
+
help='EVA metadata json file OUTPUT')
|
|
38
|
+
args = arg_parser.parse_args()
|
|
39
|
+
format_experiment_type(args.metadata_json_input, args.metadata_json_output)
|
|
40
|
+
|
|
41
|
+
if __name__ == "__main__":
|
|
42
|
+
main()
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import glob
|
|
2
2
|
import gzip
|
|
3
3
|
import os
|
|
4
|
-
import shutil
|
|
5
4
|
import time
|
|
6
5
|
from itertools import groupby
|
|
7
6
|
|
|
@@ -132,28 +131,6 @@ def _assess_vcf_evidence_type_manual(vcf_file):
|
|
|
132
131
|
open_file.close()
|
|
133
132
|
|
|
134
133
|
|
|
135
|
-
def backup_file_or_directory(file_name, max_backups=None):
|
|
136
|
-
"""
|
|
137
|
-
Rename a file or directory by adding a '.1' at the end. If the '.1' file exists it move it to a '.2' and so on.
|
|
138
|
-
Keep at most the specified number of backups, if None will keep all.
|
|
139
|
-
"""
|
|
140
|
-
suffix = 1
|
|
141
|
-
backup_name = f'{file_name}.{suffix}'
|
|
142
|
-
while os.path.exists(backup_name):
|
|
143
|
-
suffix += 1
|
|
144
|
-
backup_name = f'{file_name}.{suffix}'
|
|
145
|
-
|
|
146
|
-
for i in range(suffix, 1, -1):
|
|
147
|
-
if max_backups and i > max_backups:
|
|
148
|
-
if os.path.isfile(file_name):
|
|
149
|
-
os.remove(f'{file_name}.{i - 1}')
|
|
150
|
-
else:
|
|
151
|
-
shutil.rmtree(f'{file_name}.{i - 1}')
|
|
152
|
-
else:
|
|
153
|
-
os.rename(f'{file_name}.{i - 1}', f'{file_name}.{i}')
|
|
154
|
-
os.rename(file_name, file_name + '.1')
|
|
155
|
-
|
|
156
|
-
|
|
157
134
|
def open_gzip_if_required(input_file, mode='r'):
|
|
158
135
|
"""Open a file in read mode using gzip if the file extension says .gz"""
|
|
159
136
|
if input_file.endswith('.gz'):
|
|
@@ -42,7 +42,8 @@ params.python_scripts = [
|
|
|
42
42
|
"fasta_checker": "check_fasta_insdc.py",
|
|
43
43
|
"xlsx2json": "xlsx2json.py",
|
|
44
44
|
"semantic_checker": "check_metadata_semantics.py",
|
|
45
|
-
"trim_down": "trim_down.py"
|
|
45
|
+
"trim_down": "trim_down.py",
|
|
46
|
+
"format_metadata": "format_metadata.py"
|
|
46
47
|
]
|
|
47
48
|
// prefix to prepend to all provided path
|
|
48
49
|
params.base_dir = ""
|
|
@@ -98,8 +99,11 @@ workflow {
|
|
|
98
99
|
convert_xlsx_2_json(joinBasePath(params.metadata_xlsx))
|
|
99
100
|
metadata_json = convert_xlsx_2_json.out.metadata_json
|
|
100
101
|
} else {
|
|
101
|
-
metadata_json = joinBasePath(params.metadata_json)
|
|
102
|
+
metadata_json = file(joinBasePath(params.metadata_json), checkIfExists:true)
|
|
102
103
|
}
|
|
104
|
+
|
|
105
|
+
metadata_json_format(metadata_json)
|
|
106
|
+
metadata_json = metadata_json_format.out.metadata_formatted_json
|
|
103
107
|
// File size and MD5
|
|
104
108
|
generate_file_size_and_md5_digests(vcf_files)
|
|
105
109
|
collect_file_size_and_md5(generate_file_size_and_md5_digests.out.file_size_and_digest_info.collect())
|
|
@@ -177,6 +181,7 @@ process check_vcf_valid {
|
|
|
177
181
|
"""
|
|
178
182
|
trap 'if [[ \$? == 1 ]]; then exit 0; fi' EXIT
|
|
179
183
|
|
|
184
|
+
rm -rf ${output_dir}/vcf_format
|
|
180
185
|
mkdir -p vcf_format
|
|
181
186
|
$params.executable.vcf_validator -i $vcf -r text -o vcf_format --require-evidence > vcf_format/${vcf}.vcf_format.log 2>&1
|
|
182
187
|
"""
|
|
@@ -206,6 +211,7 @@ process check_vcf_reference {
|
|
|
206
211
|
"""
|
|
207
212
|
trap 'if [[ \$? == 1 || \$? == 139 ]]; then exit 0; fi' EXIT
|
|
208
213
|
|
|
214
|
+
rm -rf ${output_dir}/assembly_check
|
|
209
215
|
mkdir -p assembly_check
|
|
210
216
|
$params.executable.vcf_assembly_checker -i $vcf -f $fasta $report_opt -r summary,text -o assembly_check --require-genbank > assembly_check/${vcf}.assembly_check.log 2>&1
|
|
211
217
|
"""
|
|
@@ -274,6 +280,28 @@ process convert_xlsx_2_json {
|
|
|
274
280
|
"""
|
|
275
281
|
}
|
|
276
282
|
|
|
283
|
+
process metadata_json_format {
|
|
284
|
+
|
|
285
|
+
label 'short_time', 'small_mem'
|
|
286
|
+
|
|
287
|
+
publishDir output_dir,
|
|
288
|
+
overwrite: true,
|
|
289
|
+
mode: "copy"
|
|
290
|
+
|
|
291
|
+
input:
|
|
292
|
+
path(metadata_json)
|
|
293
|
+
|
|
294
|
+
output:
|
|
295
|
+
path "metadata_formatted.log", emit: metadata_formatted
|
|
296
|
+
path "metadata_formatted_case_insensitive.json", emit: metadata_formatted_json
|
|
297
|
+
|
|
298
|
+
script:
|
|
299
|
+
def output_json = "metadata_formatted_case_insensitive.json"
|
|
300
|
+
"""
|
|
301
|
+
$params.python_scripts.format_metadata --metadata_json_input $metadata_json --metadata_json_output $output_json > metadata_formatted.log 2>&1
|
|
302
|
+
"""
|
|
303
|
+
}
|
|
304
|
+
|
|
277
305
|
process metadata_json_validation {
|
|
278
306
|
|
|
279
307
|
label 'short_time', 'small_mem'
|
|
@@ -9,7 +9,7 @@ from retry import retry
|
|
|
9
9
|
from eva_sub_cli.validators.validator import Validator, ALL_VALIDATION_TASKS
|
|
10
10
|
|
|
11
11
|
default_container_image = 'ebivariation/eva-sub-cli'
|
|
12
|
-
default_container_tag = 'v0.0.
|
|
12
|
+
default_container_tag = 'v0.0.13'
|
|
13
13
|
container_validation_dir = '/opt/vcf_validation'
|
|
14
14
|
container_validation_output_dir = 'vcf_validation_output'
|
|
15
15
|
|
|
@@ -3,17 +3,18 @@ import csv
|
|
|
3
3
|
import datetime
|
|
4
4
|
import logging
|
|
5
5
|
import os
|
|
6
|
+
import shutil
|
|
6
7
|
from functools import lru_cache, cached_property
|
|
7
8
|
|
|
8
9
|
import yaml
|
|
9
10
|
from ebi_eva_common_pyutils.command_utils import run_command_with_output
|
|
10
11
|
from ebi_eva_common_pyutils.config import WritableConfig
|
|
11
|
-
from ebi_eva_common_pyutils.logger import
|
|
12
|
+
from ebi_eva_common_pyutils.logger import AppLogger
|
|
12
13
|
from packaging import version
|
|
13
14
|
|
|
14
15
|
import eva_sub_cli
|
|
15
16
|
from eva_sub_cli import ETC_DIR, SUB_CLI_CONFIG_FILE, __version__
|
|
16
|
-
from eva_sub_cli.file_utils import
|
|
17
|
+
from eva_sub_cli.file_utils import resolve_single_file_path
|
|
17
18
|
from eva_sub_cli.metadata import EvaMetadataJson
|
|
18
19
|
from eva_sub_cli.report import generate_html_report, generate_text_report
|
|
19
20
|
from eva_sub_cli.validators.validation_results_parsers import parse_assembly_check_log, parse_assembly_check_report, \
|
|
@@ -43,7 +44,6 @@ RUN_STATUS_KEY = 'run_status'
|
|
|
43
44
|
PASS = 'pass'
|
|
44
45
|
|
|
45
46
|
|
|
46
|
-
|
|
47
47
|
class Validator(AppLogger):
|
|
48
48
|
|
|
49
49
|
def __init__(self, mapping_file, submission_dir, project_title=None, metadata_json=None, metadata_xlsx=None,
|
|
@@ -54,6 +54,7 @@ class Validator(AppLogger):
|
|
|
54
54
|
self.tasks = validation_tasks
|
|
55
55
|
self.submission_dir = submission_dir
|
|
56
56
|
self.output_dir = os.path.join(submission_dir, VALIDATION_OUTPUT_DIR)
|
|
57
|
+
self.nextflow_work_dir = os.path.join(self.submission_dir, 'work') # Default location when we chdir in self.submission_dir
|
|
57
58
|
self.validation_result_file = os.path.join(submission_dir, VALIDATION_RESULTS_FILE)
|
|
58
59
|
self.mapping_file = mapping_file
|
|
59
60
|
vcf_files, fasta_files = self._find_vcf_and_fasta_files()
|
|
@@ -130,20 +131,22 @@ class Validator(AppLogger):
|
|
|
130
131
|
raise NotImplementedError
|
|
131
132
|
|
|
132
133
|
def set_up_output_dir(self):
|
|
133
|
-
if os.path.exists(self.output_dir):
|
|
134
|
-
|
|
135
|
-
os.makedirs(self.output_dir, exist_ok=True)
|
|
134
|
+
if not os.path.exists(self.output_dir):
|
|
135
|
+
os.makedirs(self.output_dir, exist_ok=True)
|
|
136
136
|
|
|
137
137
|
def clean_up_output_dir(self):
|
|
138
138
|
# Move intermediate validation outputs into a subdir except metadata.json
|
|
139
139
|
subdir = os.path.join(self.output_dir, 'other_validations')
|
|
140
|
-
os.
|
|
140
|
+
os.makedirs(subdir, exist_ok=True)
|
|
141
141
|
for file_name in os.listdir(self.output_dir):
|
|
142
|
-
if file_name
|
|
142
|
+
if file_name in ['metadata.json', 'report.txt', 'report.html']:
|
|
143
143
|
continue
|
|
144
144
|
file_path = os.path.join(self.output_dir, file_name)
|
|
145
145
|
if os.path.isfile(file_path):
|
|
146
146
|
os.rename(file_path, os.path.join(subdir, file_name))
|
|
147
|
+
# Remove the nextflow work directory if it exists
|
|
148
|
+
if os.path.exists(self.nextflow_work_dir):
|
|
149
|
+
shutil.rmtree(self.nextflow_work_dir)
|
|
147
150
|
|
|
148
151
|
@staticmethod
|
|
149
152
|
def _validation_file_path_for(file_path):
|
|
@@ -210,7 +213,6 @@ class Validator(AppLogger):
|
|
|
210
213
|
del self.results[SHALLOW_VALIDATION]['required']
|
|
211
214
|
del self.results[SHALLOW_VALIDATION]['requested']
|
|
212
215
|
|
|
213
|
-
|
|
214
216
|
def _collect_validation_workflow_results(self):
|
|
215
217
|
# Collect information from the output and summarise in the config
|
|
216
218
|
if self.shallow_validation:
|
|
@@ -550,7 +552,7 @@ class Validator(AppLogger):
|
|
|
550
552
|
file_path_2_file_size[vcf_file] = file_size
|
|
551
553
|
file_name_2_file_size[os.path.basename(vcf_file)] = file_size
|
|
552
554
|
else:
|
|
553
|
-
error_txt =
|
|
555
|
+
error_txt = f"Cannot locate file_info.txt at {os.path.join(self.output_dir, 'other_validations', 'file_info.txt')}"
|
|
554
556
|
self.error(error_txt)
|
|
555
557
|
raise FileNotFoundError(error_txt)
|
|
556
558
|
|
|
@@ -59,6 +59,7 @@ eva_sub_cli/executables/check_fasta_insdc.py
|
|
|
59
59
|
eva_sub_cli/executables/check_metadata_semantics.py
|
|
60
60
|
eva_sub_cli/executables/cli.py
|
|
61
61
|
eva_sub_cli/executables/evidence_type_checker.py
|
|
62
|
+
eva_sub_cli/executables/format_metadata.py
|
|
62
63
|
eva_sub_cli/executables/samples_checker.py
|
|
63
64
|
eva_sub_cli/executables/trim_down.py
|
|
64
65
|
eva_sub_cli/executables/xlsx2json.py
|
|
@@ -91,6 +92,7 @@ tests/test_cli.py
|
|
|
91
92
|
tests/test_docker_validator.py
|
|
92
93
|
tests/test_evidence_type_checker.py
|
|
93
94
|
tests/test_file_utils.py
|
|
95
|
+
tests/test_format_metadata.py
|
|
94
96
|
tests/test_metadata.py
|
|
95
97
|
tests/test_native_validator_sample_in_vcf.py
|
|
96
98
|
tests/test_orchestrator.py
|
|
@@ -110,6 +112,7 @@ tests/resources/EVA_Submission_test_V2.xlsx
|
|
|
110
112
|
tests/resources/EVA_Submission_test_fails.xlsx
|
|
111
113
|
tests/resources/EVA_Submission_test_version_missing.xlsx
|
|
112
114
|
tests/resources/EVA_Submission_test_with_asm_report.json
|
|
115
|
+
tests/resources/EVA_Submission_test_with_links.xlsx
|
|
113
116
|
tests/resources/EVA_Submission_test_with_non_vcf_files.json
|
|
114
117
|
tests/resources/EVA_Submission_test_with_non_vcf_files.xlsx
|
|
115
118
|
tests/resources/EVA_Submission_test_with_project_accession.json
|
|
@@ -3,6 +3,7 @@ check_fasta_insdc.py = eva_sub_cli.executables.check_fasta_insdc:main
|
|
|
3
3
|
check_metadata_semantics.py = eva_sub_cli.executables.check_metadata_semantics:main
|
|
4
4
|
eva-sub-cli.py = eva_sub_cli.executables.cli:main
|
|
5
5
|
evidence_type_checker.py = eva_sub_cli.executables.evidence_type_checker:main
|
|
6
|
+
format_metadata.py = eva_sub_cli.executables.format_metadata:main
|
|
6
7
|
samples_checker.py = eva_sub_cli.executables.samples_checker:main
|
|
7
8
|
trim_down.py = eva_sub_cli.executables.trim_down:main
|
|
8
9
|
xlsx2json.py = eva_sub_cli.executables.xlsx2json:main
|
|
@@ -37,6 +37,7 @@ classifiers = [
|
|
|
37
37
|
'evidence_type_checker.py'='eva_sub_cli.executables.evidence_type_checker:main'
|
|
38
38
|
'xlsx2json.py'='eva_sub_cli.executables.xlsx2json:main'
|
|
39
39
|
'trim_down.py'='eva_sub_cli.executables.trim_down:main'
|
|
40
|
+
'format_metadata.py'='eva_sub_cli.executables.format_metadata:main'
|
|
40
41
|
|
|
41
42
|
[tool.setuptools]
|
|
42
43
|
packages = ['eva_sub_cli', 'eva_sub_cli.exceptions', 'eva_sub_cli.executables', 'eva_sub_cli.validators']
|
|
Binary file
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import glob
|
|
2
2
|
import os
|
|
3
3
|
import shutil
|
|
4
|
-
import time
|
|
5
4
|
from pathlib import Path
|
|
6
5
|
from unittest import TestCase
|
|
7
6
|
|
|
8
|
-
from eva_sub_cli.file_utils import
|
|
7
|
+
from eva_sub_cli.file_utils import DirLock, DirLockError
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
def set_up_test_dir():
|
|
@@ -18,36 +17,6 @@ def clean_up():
|
|
|
18
17
|
shutil.rmtree(file_name)
|
|
19
18
|
|
|
20
19
|
|
|
21
|
-
def test_backup_file_or_directory():
|
|
22
|
-
set_up_test_dir()
|
|
23
|
-
backup_file_or_directory('backup_test')
|
|
24
|
-
assert not os.path.exists('backup_test')
|
|
25
|
-
assert os.path.exists('backup_test.1/nested/dir')
|
|
26
|
-
assert os.path.exists('backup_test.1/file.txt')
|
|
27
|
-
clean_up()
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
def test_backup_file_or_directory_max_backups():
|
|
31
|
-
max_backups = 2
|
|
32
|
-
|
|
33
|
-
# Backup directory
|
|
34
|
-
for i in range(max_backups + 2):
|
|
35
|
-
set_up_test_dir()
|
|
36
|
-
backup_file_or_directory('backup_test', max_backups=max_backups)
|
|
37
|
-
for i in range(1, max_backups + 1):
|
|
38
|
-
assert os.path.exists(f'backup_test.{i}')
|
|
39
|
-
assert not os.path.exists(f'backup_test.{max_backups + 1}')
|
|
40
|
-
|
|
41
|
-
# Backup file
|
|
42
|
-
for i in range(max_backups + 2):
|
|
43
|
-
set_up_test_dir()
|
|
44
|
-
backup_file_or_directory('backup_test/file.txt', max_backups=max_backups)
|
|
45
|
-
for i in range(1, max_backups + 1):
|
|
46
|
-
assert os.path.exists(f'backup_test/file.txt.{i}')
|
|
47
|
-
assert not os.path.exists(f'backup_test/file.txt.{max_backups + 1}')
|
|
48
|
-
clean_up()
|
|
49
|
-
|
|
50
|
-
|
|
51
20
|
class TestDirLock(TestCase):
|
|
52
21
|
resources_folder = os.path.join(os.path.dirname(__file__), 'resources')
|
|
53
22
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import os.path
|
|
2
|
+
from unittest import TestCase
|
|
3
|
+
from eva_sub_cli.executables import format_metadata
|
|
4
|
+
import tempfile
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
class TestValidateMetadata(TestCase):
|
|
8
|
+
|
|
9
|
+
def test_format_experiment_type(self):
|
|
10
|
+
expected_experiment_type = "Genotyping by array"
|
|
11
|
+
unexpected_experiment_type = "GeNoTyPiNg By ArRaY"
|
|
12
|
+
# testing a correctly formatted JSON file
|
|
13
|
+
clean_json = {
|
|
14
|
+
"submitterDetails": [{"lastName": "", "firstName": "", "email": "", "laboratory": "", "centre": ""}],
|
|
15
|
+
"project": {"title": "", "description": "", "taxId": 9606, "centre": ""},
|
|
16
|
+
"analysis": [{"analysisTitle": "", "analysisAlias": "", "description": "",
|
|
17
|
+
# CHANGING THE LINE BELOW
|
|
18
|
+
"experimentType": expected_experiment_type,
|
|
19
|
+
"referenceGenome": ""}],
|
|
20
|
+
"sample": [{"analysisAlias": [""], "sampleInVCF": "", "bioSampleObject": {"sample_title": "", "scientific_name": "", "tax_id": 9606, "collection date": "not provided", "geographic location (country and/or sea)": "not provided"}}],
|
|
21
|
+
"files": [{"analysisAlias": "", "fileName": "", "fileSize": 1000, "md5": ""}]
|
|
22
|
+
}
|
|
23
|
+
with tempfile.NamedTemporaryFile(mode='w', delete=False) as tmp_out_clean:
|
|
24
|
+
temp_path_clean_output = tmp_out_clean.name
|
|
25
|
+
tmp_out_clean.write('')
|
|
26
|
+
with tempfile.NamedTemporaryFile(mode='w', delete=False) as tmp:
|
|
27
|
+
json.dump(clean_json, tmp)
|
|
28
|
+
temp_path_clean = tmp.name
|
|
29
|
+
format_metadata.format_experiment_type(temp_path_clean, temp_path_clean_output)
|
|
30
|
+
with open(temp_path_clean_output, 'r') as f:
|
|
31
|
+
result_data = json.load(f)
|
|
32
|
+
expected = clean_json
|
|
33
|
+
self.assertEqual(result_data, expected)
|
|
34
|
+
self.assertEqual(result_data["analysis"][0]["experimentType"], expected_experiment_type)
|
|
35
|
+
if os.path.exists(temp_path_clean_output):
|
|
36
|
+
os.remove(temp_path_clean_output)
|
|
37
|
+
if os.path.exists(temp_path_clean):
|
|
38
|
+
os.remove(temp_path_clean)
|
|
39
|
+
# testing an incorrectly formatted JSON file
|
|
40
|
+
unclean_json = {
|
|
41
|
+
"submitterDetails": [{"lastName": "", "firstName": "", "email": "", "laboratory": "", "centre": ""}],
|
|
42
|
+
"project": {"title": "", "description": "", "taxId": 9606, "centre": "",},
|
|
43
|
+
"analysis": [{"analysisTitle": "", "analysisAlias": "", "description": "",
|
|
44
|
+
# CHANGING THE LINE BELOW
|
|
45
|
+
"experimentType": unexpected_experiment_type,
|
|
46
|
+
"referenceGenome": ""}],
|
|
47
|
+
"sample": [{"analysisAlias": [""], "sampleInVCF": "", "bioSampleObject": {"sample_title": "", "scientific_name": "", "tax_id": 9606, "collection date": "not provided", "geographic location (country and/or sea)": "not provided"}}],
|
|
48
|
+
"files": [{"analysisAlias": "", "fileName": "", "fileSize": 1000, "md5": ""}]
|
|
49
|
+
}
|
|
50
|
+
with tempfile.NamedTemporaryFile(mode='w', delete=False) as tmp_out_unclean:
|
|
51
|
+
temp_path_unclean_output = tmp_out_unclean.name
|
|
52
|
+
with tempfile.NamedTemporaryFile(mode='w', delete=False) as tmp:
|
|
53
|
+
json.dump(unclean_json, tmp)
|
|
54
|
+
temp_path_unclean = tmp.name
|
|
55
|
+
format_metadata.format_experiment_type(temp_path_unclean, temp_path_unclean_output)
|
|
56
|
+
with open(temp_path_unclean_output, 'r') as f:
|
|
57
|
+
result_data = json.load(f)
|
|
58
|
+
expected = clean_json
|
|
59
|
+
self.assertEqual(result_data, expected)
|
|
60
|
+
self.assertEqual(result_data["analysis"][0]["experimentType"], expected_experiment_type)
|
|
61
|
+
if os.path.exists(temp_path_unclean_output):
|
|
62
|
+
os.remove(temp_path_unclean_output)
|
|
63
|
+
if os.path.exists(temp_path_unclean):
|
|
64
|
+
os.remove(temp_path_unclean)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os.path
|
|
2
2
|
import shutil
|
|
3
3
|
from copy import deepcopy
|
|
4
|
+
from tempfile import TemporaryDirectory
|
|
4
5
|
from unittest import TestCase
|
|
5
6
|
|
|
6
7
|
import yaml
|
|
@@ -174,6 +175,38 @@ class TestValidator(TestCase):
|
|
|
174
175
|
with open(validator.validation_result_file, 'w') as val_res_file:
|
|
175
176
|
yaml.safe_dump(results, val_res_file)
|
|
176
177
|
|
|
178
|
+
|
|
179
|
+
def create_validator(self, submission_dir):
|
|
180
|
+
mapping_file = os.path.join(submission_dir, 'vcf_files_mapping.csv')
|
|
181
|
+
create_mapping_file(mapping_file,
|
|
182
|
+
[os.path.join(self.vcf_files, 'input_passed.vcf')],
|
|
183
|
+
[os.path.join(self.fasta_files, 'input_passed.fa')]
|
|
184
|
+
)
|
|
185
|
+
return Validator(mapping_file, submission_dir, metadata_json=self.metadata_json_file)
|
|
186
|
+
|
|
187
|
+
def test_clean_up_output_dir_moves_intermediate_files_and_removes_nextflow_work_dir(self):
|
|
188
|
+
with TemporaryDirectory() as submission_dir:
|
|
189
|
+
validator = self.create_validator(submission_dir)
|
|
190
|
+
os.makedirs(validator.output_dir)
|
|
191
|
+
os.makedirs(os.path.join(validator.nextflow_work_dir, 'nested'))
|
|
192
|
+
|
|
193
|
+
files_to_keep = ['metadata.json', 'report.txt', 'report.html']
|
|
194
|
+
files_to_move = ['metadata_validation.txt', 'sample_checker.yml']
|
|
195
|
+
for file_name in files_to_keep + files_to_move:
|
|
196
|
+
with open(os.path.join(validator.output_dir, file_name), 'w') as output_file:
|
|
197
|
+
output_file.write(file_name)
|
|
198
|
+
|
|
199
|
+
validator.clean_up_output_dir()
|
|
200
|
+
|
|
201
|
+
other_validations_dir = os.path.join(validator.output_dir, 'other_validations')
|
|
202
|
+
assert not os.path.exists(validator.nextflow_work_dir)
|
|
203
|
+
for file_name in files_to_keep:
|
|
204
|
+
assert os.path.exists(os.path.join(validator.output_dir, file_name))
|
|
205
|
+
for file_name in files_to_move:
|
|
206
|
+
assert not os.path.exists(os.path.join(validator.output_dir, file_name))
|
|
207
|
+
assert os.path.exists(os.path.join(other_validations_dir, file_name))
|
|
208
|
+
|
|
209
|
+
|
|
177
210
|
def test__collect_validation_workflow_results_with_metadata_json(self):
|
|
178
211
|
self.run_collect_results(self.validator_json)
|
|
179
212
|
assert self.validator_json.results == self.format_data_structure(expected_validation_results)
|
|
@@ -290,7 +323,6 @@ class TestValidator(TestCase):
|
|
|
290
323
|
assert saved_results == self.format_data_structure(expected_results)
|
|
291
324
|
|
|
292
325
|
|
|
293
|
-
|
|
294
326
|
def test__collect_validation_workflow_results_for_shallow_validation_no_effect_when_task_not_in_vcf_check_or_assembly_check(
|
|
295
327
|
self):
|
|
296
328
|
validator_json_shallow = Validator(self.mapping_file, self.output_dir, validation_tasks=[METADATA_CHECK],
|
|
@@ -633,4 +665,3 @@ class TestValidator(TestCase):
|
|
|
633
665
|
|
|
634
666
|
|
|
635
667
|
|
|
636
|
-
|
|
@@ -126,6 +126,35 @@ class TestXlsReader(TestCase):
|
|
|
126
126
|
|
|
127
127
|
jsonschema.validate(json_data, eva_json_schema)
|
|
128
128
|
|
|
129
|
+
def test_conversion_2_json_with_links(self) -> None:
|
|
130
|
+
xls_filename = os.path.join(self.resource_dir, 'EVA_Submission_test_with_links.xlsx')
|
|
131
|
+
self.parser = XlsxParser(xls_filename, self.conf_filename)
|
|
132
|
+
output_json = os.path.join(self.resource_dir, 'EVA_Submission_test_output.json')
|
|
133
|
+
errors_yaml = os.path.join(self.resource_dir, 'EVA_Submission_test_errors.yml')
|
|
134
|
+
self.parser.json(output_json)
|
|
135
|
+
self.parser.save_errors(errors_yaml)
|
|
136
|
+
|
|
137
|
+
# confirm no errors
|
|
138
|
+
with open(errors_yaml) as open_file:
|
|
139
|
+
errors_data = yaml.safe_load(open_file)
|
|
140
|
+
assert errors_data == []
|
|
141
|
+
|
|
142
|
+
with open(output_json) as open_file:
|
|
143
|
+
json_data = json.load(open_file)
|
|
144
|
+
# assert json file is created with expected data
|
|
145
|
+
assert sorted(json_data.keys()) == ['$schema', 'analysis', 'files', 'project', 'sample', 'submitterDetails']
|
|
146
|
+
json_data.pop('$schema', None)
|
|
147
|
+
expected_json = self.get_expected_json()
|
|
148
|
+
expected_json['analysis'][0]['links'] = ['BioProject:PRJNA1435562']
|
|
149
|
+
self.assertEqual(expected_json, json_data)
|
|
150
|
+
|
|
151
|
+
# assert json schema
|
|
152
|
+
with open(self.eva_schema) as eva_schema_file:
|
|
153
|
+
eva_json_schema = json.load(eva_schema_file)
|
|
154
|
+
|
|
155
|
+
# assert created json file conform to eva_schema
|
|
156
|
+
jsonschema.validate(json_data, eva_json_schema)
|
|
157
|
+
|
|
129
158
|
def test_create_xls_template(self):
|
|
130
159
|
metadata_file = os.path.join(self.resource_dir, 'metadata_not_existing.xlsx')
|
|
131
160
|
create_xls_template_from_yaml(metadata_file, self.conf_filename)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/.github/workflows/trigger-eva-sub-cli-integration-tests.yml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/invalid_file_type_exception.py
RENAMED
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/submission_not_found_exception.py
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/submission_status_exception.py
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/exceptions/submission_upload_exception.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/file_validation.html
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/metadata_validation.html
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/project_details.html
RENAMED
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/sample_name_check.html
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/html/shallow_validation.html
RENAMED
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/file_validation.txt
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/metadata_validation.txt
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/project_details.txt
RENAMED
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/sample_name_check.txt
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/jinja_templates/text/shallow_validation.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/eva_sub_cli/validators/validation_results_parsers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_version_missing.xlsx
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_with_asm_report.json
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_with_non_vcf_files.json
RENAMED
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/EVA_Submission_test_with_non_vcf_files.xlsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{eva_sub_cli-0.6.1 → eva_sub_cli-0.6.2}/tests/resources/fasta_files/Saccharomyces_cerevisiae_I.fa
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|