Skip to content

Commit c137015

Browse files
committed
Fix in setGT -i/-e filtering for cases
where the filtering expression does not involve the genotype fields and hence the per-sample pass status is not available. Fixes samtools#514
1 parent ea4ab43 commit c137015

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

plugins/setGT.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,11 @@ bcf1_t *process(bcf1_t *rec)
229229
if ( (pass_site && filter_logic==FLT_EXCLUDE) || (!pass_site && filter_logic==FLT_INCLUDE) ) return rec;
230230
for (i=0; i<rec->n_sample; i++)
231231
{
232-
if ( !smpl_pass[i] && filter_logic==FLT_INCLUDE ) continue;
233-
if ( smpl_pass[i] && filter_logic==FLT_EXCLUDE ) continue;
232+
if ( smpl_pass )
233+
{
234+
if ( !smpl_pass[i] && filter_logic==FLT_INCLUDE ) continue;
235+
if ( smpl_pass[i] && filter_logic==FLT_EXCLUDE ) continue;
236+
}
234237

235238
if ( new_mask&GT_UNPHASED )
236239
changed += unphase_gt(gts + i*ngts, ngts);

0 commit comments

Comments
 (0)