Skip to content

Commit

Permalink
Plugins to use bcf_gt_is_missing instead of the old bcf_int32_missing
Browse files Browse the repository at this point in the history
  • Loading branch information
pd3 authored and mcshane committed Sep 16, 2015
1 parent 4dd02c3 commit f46aa3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/dosage.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int calc_dosage_GT(bcf1_t *rec)
float dsg = 0;
for (j=0; j<nret; j++)
{
if ( ptr[j]==bcf_int32_missing || ptr[j]==bcf_int32_vector_end || ptr[j]==bcf_gt_missing ) break;
if ( ptr[j]==bcf_int32_vector_end || bcf_gt_is_missing(ptr[j]) ) break;
if ( bcf_gt_allele(ptr[j]) ) dsg += 1;
}
printf("\t%.1f", j>0 ? dsg : -1);
Expand Down
4 changes: 3 additions & 1 deletion plugins/vcf2sex.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,10 @@ int process_region_precise(args_t *args, char *seq, regitr_t *itr)
int32_t *gts = args->gts + ngts*ismpl;
int igt, ploidy = 0;
for (igt=0; igt<ngts; igt++)
if ( gts[igt]==bcf_gt_missing || gts[igt]==bcf_int32_missing || gts[igt]==bcf_int32_vector_end ) break;
{
if ( gts[igt]==bcf_int32_vector_end || bcf_gt_is_missing(gts[igt]) ) break;
else ploidy++;
}
args->counts[ismpl*(args->max_ploidy+1) + ploidy]++;
if ( args->verbose )
fprintf(stderr,"%s:%d\t%s\tploidy=%d\n", seq,rec->pos+1,args->hdr->samples[ismpl],ploidy);
Expand Down

0 comments on commit f46aa3e

Please sign in to comment.