Skip to content

Commit

Permalink
Merge pull request #160 from EliLillyCo/grep-error2
Browse files Browse the repository at this point in the history
Error comparing VCF files
  • Loading branch information
jdidion authored Jan 6, 2021
2 parents f7f794a + f49a9b5 commit 7a04567
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ before_script:
- export CROMWELL_JAR=/tmp/cromwell-53.1.jar
script:
- make test
- make quickstart
- make test_release_setup
after_success:
- bash <(curl -s https://codecov.io/bash)
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,6 @@ release: clean tag
-H "Authorization: token $(token)" \
https://api.github.com/repos/$(repo)/releases \
-d '{"tag_name":"$(version)","target_commitish": "main","name": "$(version)","body": "$(desc)","draft": false,"prerelease": false}'

quickstart:
cd examples/quickstart && pytest -s -vv --show-capture=all
4 changes: 3 additions & 1 deletion pytest_wdl/data_types/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ def diff_vcf_columns(file1: Path, file2: Path, compare_phase: bool = False) -> i
with tempdir() as temp:
def make_comparable(infile, outfile):
cmd = ["grep -vE '^#'", "cut -f 1-5,7,10", "cut -d ':' -f 1"]
output = subby.sub(cmd, stdin=infile)
# if the VCF file is empty or (for some reason) has no headers,
# grep will exit with return code 1
output = subby.sub(cmd, stdin=infile, allowed_return_codes=(0, 1))
with open(outfile, "wt") as out:
if compare_phase:
out.write(output)
Expand Down

0 comments on commit 7a04567

Please sign in to comment.