Skip to content

Commit

Permalink
increase window for variant sites check
Browse files Browse the repository at this point in the history
  • Loading branch information
ksamuk committed Feb 3, 2024
1 parent f0b8ee1 commit eae05b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
``pixy``<img src="https://raw.githubusercontent.com/ksamuk/pixy/master/docs/images/pixy_logo.png" align="right" width="20%">
====================

[![DOI](https://zenodo.org/badge/181987337.svg)](https://zenodo.org/badge/latestdoi/181987337) ![version](https://img.shields.io/badge/version-1.2.7.beta1-blue) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![DOI](https://zenodo.org/badge/181987337.svg)](https://zenodo.org/badge/latestdoi/181987337) ![version](https://img.shields.io/badge/version-1.2.8.beta1-blue) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


`pixy` is a command-line tool for painlessly estimating average nucleotide diversity within (π) and between (d<sub>xy</sub>) populations from a VCF. In particular, pixy facilitates the use of VCFs containing invariant (monomorphic) sites, which are **essential** for the correct computation of π and d<sub>xy</sub> in the face of missing data (i.e. always).
Expand Down
4 changes: 2 additions & 2 deletions pixy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,11 +615,11 @@ def check_and_validate_args(args):
check_message = "OK"

if args.bypass_invariant_check=='no':
alt_list = subprocess.check_output("gunzip -c " + args.vcf + " | grep -v '#' | head -n 10000 | awk '{print $5}' | sort | uniq", shell=True).decode("utf-8").split()
alt_list = subprocess.check_output("gunzip -c " + args.vcf + " | grep -v '#' | head -n 100000 | awk '{print $5}' | sort | uniq", shell=True).decode("utf-8").split()
if "." not in alt_list:
raise Exception('[pixy] ERROR: the provided VCF appears to contain no invariant sites (ALT = \".\"). This check can be bypassed via --bypass_invariant_check \'yes\'.')
if "." in alt_list and len(alt_list) == 1 :
raise Exception('[pixy] ERROR: the provided VCF appears to contain no variable sites. It may have been filtered incorrectly, or otherwise corrupted.')
raise Exception('[pixy] ERROR: the provided VCF appears to contain no variable sites in the first 100 000 sites. It may have been filtered incorrectly, or genetic diversity is very low. This check can be bypassed via --bypass_invariant_check \'yes\'.')
else:
if not (len(args.stats) == 1 and (args.stats[0] == 'fst')):
check_message = "WARNING"
Expand Down

0 comments on commit eae05b0

Please sign in to comment.