Skip to content

Commit c2509a4

Browse files
committed
Merge pull request #45 from hobrien/master
Unphased SNPs triggering 'unable to parse genotype' warning
2 parents 467651c + 7b30418 commit c2509a4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

snp2h5/vcf.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,13 @@ void vcf_parse_haplotypes(VCFInfo *vcf_info, char *haplotypes,
172172
/* try with '/' separator instead */
173173
n = sscanf(inner_tok, "%d/%d", &hap1, &hap2);
174174

175-
if(n == 2 && warn_phase) {
176-
my_warn("%s:%d: some genotypes are unphased (delimited "
177-
"with '/' instead of '|')\n", __FILE__, __LINE__,
178-
inner_tok);
179-
warn_phase = FALSE;
175+
if(n == 2) {
176+
if(warn_phase) {
177+
my_warn("%s:%d: some genotypes are unphased (delimited "
178+
"with '/' instead of '|')\n", __FILE__, __LINE__,
179+
inner_tok);
180+
warn_phase = FALSE;
181+
}
180182
} else {
181183
my_warn("%s:%d: could not parse genotype string '%s'\n",
182184
__FILE__, __LINE__, inner_tok);

0 commit comments

Comments
 (0)