Skip to content

Commit

Permalink
Merge pull request #45 from hobrien/master
Browse files Browse the repository at this point in the history
Unphased SNPs triggering 'unable to parse genotype' warning
  • Loading branch information
gmcvicker committed May 31, 2016
2 parents 467651c + 7b30418 commit c2509a4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions snp2h5/vcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,13 @@ void vcf_parse_haplotypes(VCFInfo *vcf_info, char *haplotypes,
/* try with '/' separator instead */
n = sscanf(inner_tok, "%d/%d", &hap1, &hap2);

if(n == 2 && warn_phase) {
my_warn("%s:%d: some genotypes are unphased (delimited "
"with '/' instead of '|')\n", __FILE__, __LINE__,
inner_tok);
warn_phase = FALSE;
if(n == 2) {
if(warn_phase) {
my_warn("%s:%d: some genotypes are unphased (delimited "
"with '/' instead of '|')\n", __FILE__, __LINE__,
inner_tok);
warn_phase = FALSE;
}
} else {
my_warn("%s:%d: could not parse genotype string '%s'\n",
__FILE__, __LINE__, inner_tok);
Expand Down

0 comments on commit c2509a4

Please sign in to comment.