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

Use new version of VCF validator #66

Merged
merged 2 commits into from
Nov 5, 2024
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
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
Loading