Skip to content

Commit

Permalink
Merge pull request #66 from tcezard/update_vcf_validator
Browse files Browse the repository at this point in the history
Use new version of VCF validator
  • Loading branch information
tcezard authored Nov 5, 2024
2 parents 3d9939e + 042dacc commit fed39be
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ requirements:
- nextflow >=21.10.0
- python >=3.8
- nodejs >=10.19.1
- vcf-validator >=0.9.7
- vcf-validator >=0.10.0
- ebi-eva-common-pyutils >=0.6.1
- pyyaml
- jinja2
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM python:3.10

ENV vcf_validator_version=0.9.7
ENV vcf_validator_version=0.10.0
ENV NXF_VER=22.10.6

WORKDIR /opt
Expand Down
3 changes: 1 addition & 2 deletions eva_sub_cli/nextflow/validation.nf
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,14 @@ process check_vcf_valid {
tuple path(vcf), path(fasta), path(report)

output:
path "vcf_format/*.errors.*.db", emit: vcf_validation_db
path "vcf_format/*.errors.*.txt", emit: vcf_validation_txt
path "vcf_format/*.vcf_format.log", emit: vcf_validation_log

"""
trap 'if [[ \$? == 1 ]]; then exit 0; fi' EXIT
mkdir -p vcf_format
$params.executable.vcf_validator -i $vcf -r database,text -o vcf_format --require-evidence > vcf_format/${vcf}.vcf_format.log 2>&1
$params.executable.vcf_validator -i $vcf -r text -o vcf_format --require-evidence > vcf_format/${vcf}.vcf_format.log 2>&1
"""
}

Expand Down
3 changes: 1 addition & 2 deletions eva_sub_cli/validators/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,8 @@ def _collect_vcf_check_results(self,):

vcf_check_log = self._vcf_check_log(vcf_name)
vcf_check_text_report = self._vcf_check_text_report(vcf_name)
vcf_check_db_report = self._vcf_check_db_report(vcf_name)

if vcf_check_log and vcf_check_text_report and vcf_check_db_report:
if vcf_check_log and vcf_check_text_report:
valid, warning_count, error_count, critical_count, error_list, critical_list = parse_vcf_check_report(vcf_check_text_report)
else:
valid, warning_count, error_count, critical_count, error_list, critical_list = (False, 0, 0, 1, [], ['Process failed'])
Expand Down
4 changes: 2 additions & 2 deletions tests/test_docker_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ def assert_validation_results(self, validator, expected_sample_checker, expected
with open(vcf_format_log_file) as vcf_format_log_file:
vcf_format_logs = vcf_format_log_file.readlines()
self.assertEqual('[info] According to the VCF specification, the input file is valid\n',
vcf_format_logs[3])
vcf_format_logs[2])

text_report = vcf_format_logs[2].split(':')[1].strip()
text_report = vcf_format_logs[1].split(':')[1].strip()
with open(os.path.join(validator.output_dir, text_report)) as text_report:
text_report_content = text_report.readlines()
self.assertEqual('According to the VCF specification, the input file is valid\n',
Expand Down

0 comments on commit fed39be

Please sign in to comment.