Skip to content

Commit

Permalink
Address comments from review
Browse files Browse the repository at this point in the history
  • Loading branch information
tcezard committed Sep 9, 2024
1 parent 45e6d68 commit aecf386
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
6 changes: 2 additions & 4 deletions eva_sub_cli/jinja_templates/html_report.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% from 'sample_name_check.html' import sample_name_check_report %}
{% from 'fasta_check.html' import fasta_check_report %}
{% from 'metadata_validation.html' import metadata_validation_report %}
{% from 'shallow_validation.html' import shallow_validation_report %}
{% from 'shallow_validation.html' import optional_shallow_validation_report %}

<html lang="EN">
<head>
Expand Down Expand Up @@ -47,9 +47,7 @@ <h6>eva-sub-cli v{{cli_version}}</h6>
</div>
</header>

<section>
{{ shallow_validation_report(validation_results) }}
</section>
{{ optional_shallow_validation_report(validation_results) }}

<section>
<h2>Project Summary</h2>
Expand Down
8 changes: 5 additions & 3 deletions eva_sub_cli/jinja_templates/shallow_validation.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@

{% macro shallow_validation_report(validation_results) -%}
{% macro optional_shallow_validation_report(validation_results) -%}
{% set results = validation_results.get('shallow_validation', {}) %}

{% if results.get('required') %}
<section>
<div class="report-section fail collapsible"> <span class="expand_icon">&#9654;</span>
&#10060; <b>You requested to run the shallow validation, please run full validation before submitting the data</b>
</div>
<div class="no-show">
<table>
<tr>
<th><strong>VCF File</strong></th>
<th><strong>Records validated in VCF</strong></th>
<th><strong>Records validated in Fasta</strong></th>
<th><strong>Variant lines validated in VCF</strong></th>
<th><strong>Entries used in Fasta</strong></th>
</tr>
{% for vcf_file in results.get('metrics') %}
<tr>
Expand All @@ -22,6 +23,7 @@
{% endfor %}
</table>
</div>
</section>
{% endif %}

{%- endmacro %}
27 changes: 9 additions & 18 deletions eva_sub_cli/validators/docker_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,15 @@ def _validation_file_path_for(file_path):
return f'{container_validation_dir}/{file_path}'

def get_docker_validation_cmd(self):
if self.metadata_xlsx and not self.metadata_json:
docker_cmd = ''.join([
f"{self.docker_path} exec {self.container_name} nextflow run eva_sub_cli/nextflow/validation.nf ",
f"--base_dir {container_validation_dir} ",
f"--vcf_files_mapping {self.mapping_file} ",
f"--metadata_xlsx {self.metadata_xlsx} ",
f"--shallow_validation true " if self.shallow_validation else "",
f"--output_dir {container_validation_output_dir}"
])
else:
docker_cmd = ''.join([
f"{self.docker_path} exec {self.container_name} nextflow run eva_sub_cli/nextflow/validation.nf ",
f"--base_dir {container_validation_dir} ",
f"--vcf_files_mapping {self.mapping_file} ",
f"--metadata_json {self.metadata_json} ",
f"--shallow_validation true " if self.shallow_validation else "",
f"--output_dir {container_validation_output_dir}"
])
docker_cmd = ''.join([
f"{self.docker_path} exec {self.container_name} nextflow run eva_sub_cli/nextflow/validation.nf ",
f"--base_dir {container_validation_dir} ",
f"--vcf_files_mapping {self.mapping_file} ",
f"--metadata_xlsx {self.metadata_xlsx} " if self.metadata_xlsx and not self.metadata_json
else f"--metadata_json {self.metadata_json} ",
f"--shallow_validation true " if self.shallow_validation else "",
f"--output_dir {container_validation_output_dir}"
])
return docker_cmd

def run_docker_validator(self):
Expand Down
1 change: 1 addition & 0 deletions eva_sub_cli/validators/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def verify_ready_for_submission_to_eva(self):
)),
self.results.get('sample_check', {}).get('overall_differences', True) is False,
len(self.results.get('metadata_check', {}).get('spreadsheet_errors', [])) == 0,
len(self.results.get('metadata_check', {}).get('json_errors', [])) == 0,
any((
self.results['shallow_validation']['requested'] is False,
self.results['shallow_validation'].get('required', True) is False
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit aecf386

Please sign in to comment.