Skip to content

Commit dcd3658

Browse files
committed
Merge branch 'develop' of pd3-github:samtools/bcftools into develop
2 parents 6d69141 + edc6dfa commit dcd3658

File tree

9 files changed

+17
-17
lines changed

9 files changed

+17
-17
lines changed

csq.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3182,9 +3182,9 @@ int test_cds(args_t *args, bcf1_t *rec, vbuf_t *vbuf)
31823182
for (ismpl=0; ismpl<args->smpl->n; ismpl++)
31833183
{
31843184
int32_t *gt = args->gt_arr + args->smpl->idx[ismpl]*ngts;
3185-
if ( gt[0]==bcf_gt_missing ) continue;
3185+
if ( bcf_gt_is_missing(gt[0]) ) continue;
31863186

3187-
if ( ngts>1 && gt[1]!=bcf_gt_missing && gt[1]!=bcf_int32_vector_end && bcf_gt_allele(gt[0])!=bcf_gt_allele(gt[1]) )
3187+
if ( ngts>1 && !bcf_gt_is_missing(gt[1]) && gt[1]!=bcf_int32_vector_end && bcf_gt_allele(gt[0])!=bcf_gt_allele(gt[1]) )
31883188
{
31893189
if ( args->phase==PHASE_MERGE )
31903190
{
@@ -3206,7 +3206,7 @@ int test_cds(args_t *args, bcf1_t *rec, vbuf_t *vbuf)
32063206

32073207
for (ihap=0; ihap<ngts; ihap++)
32083208
{
3209-
if ( gt[ihap]==bcf_gt_missing || gt[ihap]==bcf_int32_vector_end ) continue;
3209+
if ( bcf_gt_is_missing(gt[ihap]) || gt[ihap]==bcf_int32_vector_end ) continue;
32103210

32113211
i = 2*ismpl + ihap;
32123212

@@ -3311,7 +3311,7 @@ void csq_stage(args_t *args, csq_t *csq, bcf1_t *rec)
33113311
int32_t *gt = args->gt_arr + args->smpl->idx[i]*ngt;
33123312
for (j=0; j<ngt; j++)
33133313
{
3314-
if ( gt[j]==bcf_gt_missing || gt[j]==bcf_int32_vector_end ) continue;
3314+
if ( bcf_gt_is_missing(gt[j]) || gt[j]==bcf_int32_vector_end ) continue;
33153315
int ial = bcf_gt_allele(gt[j]);
33163316
if ( !ial || ial!=csq->type.vcf_ial ) continue;
33173317
csq_print_text(args, csq, args->smpl->idx[i],j+1);
@@ -3326,7 +3326,7 @@ void csq_stage(args_t *args, csq_t *csq, bcf1_t *rec)
33263326
int32_t *gt = args->gt_arr + args->smpl->idx[i]*ngt;
33273327
for (j=0; j<ngt; j++)
33283328
{
3329-
if ( gt[j]==bcf_gt_missing || gt[j]==bcf_int32_vector_end ) continue;
3329+
if ( bcf_gt_is_missing(gt[j]) || gt[j]==bcf_int32_vector_end ) continue;
33303330
int ial = bcf_gt_allele(gt[j]);
33313331
if ( !ial || ial!=csq->type.vcf_ial ) continue;
33323332

filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1397,7 +1397,7 @@ static void filters_set_nmissing(filter_t *flt, bcf1_t *line, token_t *tok)
13971397
{ \
13981398
type_t val = convert(&ptr[j * sizeof(type_t)]); \
13991399
if ( val==is_vector_end ) break; \
1400-
if ( val==bcf_gt_missing ) { nmissing++; break; } \
1400+
if ( bcf_gt_is_missing(val) ) { nmissing++; break; } \
14011401
} \
14021402
} \
14031403
}

plugins/check-sparsity.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static void test_region(args_t *args, char *reg)
206206
int8_t *ptr = (int8_t*) (fmt_gt->p + args->smpl[i]*fmt_gt->size);
207207
int ial = 0;
208208
for (ial=0; ial<fmt_gt->n; ial++)
209-
if ( ptr[ial]==bcf_gt_missing || ptr[ial]==bcf_int8_vector_end ) break;
209+
if ( bcf_gt_is_missing(ptr[ial]) || ptr[ial]==bcf_int8_vector_end ) break;
210210
if ( ial==0 ) continue; // missing
211211
if ( ++args->nsites[i] < args->min_sites ) continue;
212212
if ( i+1<args->nsmpl )

plugins/guess-ploidy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ void process_region_guess(args_t *args)
167167
int32_t *ptr = args->arr + ismpl*ngt;
168168
double *tmp = args->tmpf + ismpl*3;
169169

170-
if ( ptr[0]==bcf_gt_missing )
170+
if ( bcf_gt_is_missing(ptr[0]) )
171171
{
172172
tmp[0] = -1;
173173
continue;

plugins/mendelian2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,12 +566,12 @@ static int parse_gt(int32_t *gt, int ngt, uint64_t *a, uint64_t *b)
566566
{
567567
*a = *b = 0;
568568

569-
if ( gt[0]==bcf_gt_missing || gt[0]==bcf_int32_vector_end ) return 0;
569+
if ( bcf_gt_is_missing(gt[0]) || gt[0]==bcf_int32_vector_end ) return 0;
570570
*a |= 1<<bcf_gt_allele(gt[0]);
571571

572572
if ( ngt==1 || gt[1]==bcf_int32_vector_end ) return 1;
573573

574-
if ( gt[1]==bcf_gt_missing ) return 0;
574+
if ( bcf_gt_is_missing(gt[1]) ) return 0;
575575
*b |= 1<<bcf_gt_allele(gt[1]);
576576

577577
return 2;

plugins/missing2ref.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ bcf1_t *process(bcf1_t *rec)
121121
// replace gts
122122
for (i=0; i<ngts; i++)
123123
{
124-
if ( gts[i]==bcf_gt_missing )
124+
if ( bcf_gt_is_missing(gts[i]) )
125125
{
126126
gts[i] = new_gt;
127127
changed++;

plugins/setGT.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ static inline int set_gt_custom(args_t *args, int32_t *ptr, int ngts, int nals)
403403
{
404404
if ( args->custom.gt[i]==MINOR_ALLELE ) new_allele = args->custom.m_allele;
405405
else if ( args->custom.gt[i]==MAJOR_ALLELE ) new_allele = args->custom.M_allele;
406-
else if ( args->custom.gt[i]==X_VAF_ALLELE ) new_allele = args->custom.x_vaf_allele==bcf_gt_missing ? nals : bcf_gt_allele(args->custom.x_vaf_allele);
406+
else if ( args->custom.gt[i]==X_VAF_ALLELE ) new_allele = bcf_gt_is_missing(args->custom.x_vaf_allele) ? nals : bcf_gt_allele(args->custom.x_vaf_allele);
407407
else if ( args->custom.gt[i]==MISSING_ALLELE ) new_allele = nals; // this is to trigger the `new_allele = bcf_gt_missing` branch below
408408
else new_allele = args->custom.gt[i];
409409
if ( new_allele >= nals ) // cannot set, the requested index is bigger than there are alleles in ALT

plugins/trio-switch-rate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ int parse_genotype(gt_t *gt, int32_t *ptr);
182182

183183
inline int parse_genotype(gt_t *gt, int32_t *ptr)
184184
{
185-
if ( ptr[0]==bcf_gt_missing ) return 0;
186-
if ( ptr[1]==bcf_gt_missing ) return 0;
185+
if ( bcf_gt_is_missing(ptr[0]) ) return 0;
186+
if ( bcf_gt_is_missing(ptr[1]) ) return 0;
187187
if ( ptr[1]==bcf_int32_vector_end ) return 0;
188188
gt->phased = bcf_gt_is_phased(ptr[1]) ? 1 : 0;
189189
gt->a = bcf_gt_allele(ptr[0]); if ( gt->a > 1 ) return 0; // consider only the first two alleles at biallelic sites

vcfbuf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ static double _estimate_af(int8_t *ptr, int size, int nvals, int nsamples)
842842
{
843843
for (j=0; j<nvals; j++)
844844
{
845-
if ( ptr[j]==bcf_gt_missing ) break;
845+
if ( bcf_gt_is_missing(ptr[j]) ) break;
846846
if ( ptr[j]==bcf_int8_vector_end ) break;
847847
if ( bcf_gt_allele(ptr[j]) ) nalt++;
848848
else nref++;
@@ -911,7 +911,7 @@ static int _calc_r2_ld(vcfbuf_t *buf, bcf1_t *arec, bcf1_t *brec, vcfbuf_ld_t *l
911911
for (j=0; j<afmt->n; j++)
912912
{
913913
if ( aptr[j]==bcf_int8_vector_end ) break;
914-
if ( aptr[j]==bcf_gt_missing )
914+
if ( bcf_gt_is_missing(aptr[j]) )
915915
{
916916
if ( !buf->ld.rand_missing ) break;
917917
if ( hts_drand48() >= aaf ) adsg += 1;
@@ -922,7 +922,7 @@ static int _calc_r2_ld(vcfbuf_t *buf, bcf1_t *arec, bcf1_t *brec, vcfbuf_ld_t *l
922922
for (j=0; j<bfmt->n; j++)
923923
{
924924
if ( bptr[j]==bcf_int8_vector_end ) break;
925-
if ( bptr[j]==bcf_gt_missing )
925+
if ( bcf_gt_is_missing(bptr[j]) )
926926
{
927927
if ( !buf->ld.rand_missing ) break;
928928
if ( hts_drand48() >= baf ) bdsg += 1;

0 commit comments

Comments
 (0)