Skip to content

Commit 99f0afb

Browse files
committed
Minor code tightening
- adding explicit `if ( baf>4/5.) continue;` for possible rounding differences leading to different number of k's in the first and third for loop - explicit check for the absence of control sample Recommended by #2529
1 parent 3974339 commit 99f0afb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

vcfcnv.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ static int update_sample_args(args_t *args, sample_t *smpl, int ismpl)
871871
for (i=0; i<args->nsites; i++)
872872
{
873873
float baf = smpl->baf[i];
874+
if ( baf>4/5.) continue; // skip AA genotypes
874875
if ( baf>0.5 ) baf = 1 - baf; // the bands should be symmetric
875876
if ( baf<1/5.) continue; // skip RR,AA genotypes
876877

@@ -1118,6 +1119,10 @@ static void cnv_flush_viterbi(args_t *args)
11181119

11191120
static int parse_lrr_baf(sample_t *smpl, bcf_fmt_t *baf_fmt, bcf_fmt_t *lrr_fmt, float *baf, float *lrr)
11201121
{
1122+
*baf = -0.1;
1123+
*lrr = 0;
1124+
if ( !smpl->name || smpl->idx<0 ) return 0;
1125+
11211126
*baf = ((float*)(baf_fmt->p + baf_fmt->size*smpl->idx))[0];
11221127
if ( bcf_float_is_missing(*baf) || isnan(*baf) ) *baf = -0.1; // arbitrary negative value == missing value
11231128

0 commit comments

Comments
 (0)