Skip to content

Commit 4edd317

Browse files
committed
When complaining about missing tags, be explicit if it is FORMAT or INFO. Resolves #1770
1 parent 547bfe6 commit 4edd317

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

vcfannotate.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2441,7 +2441,7 @@ static void init_columns(args_t *args)
24412441
}
24422442
int hdr_id = bcf_hdr_id2int(args->hdr_out, BCF_DT_ID, key_dst);
24432443
if ( !bcf_hdr_idinfo_exists(args->hdr_out,BCF_HL_FMT,hdr_id) )
2444-
error("The tag \"%s\" is not defined in %s, was the -h option provided?\n", str.s, args->targets_fname);
2444+
error("The FORMAT tag \"%s\" is not defined in %s, was the -h option provided?\n", str.s, args->targets_fname);
24452445
args->ncols++; args->cols = (annot_col_t*) realloc(args->cols,sizeof(annot_col_t)*args->ncols);
24462446
annot_col_t *col = &args->cols[args->ncols-1];
24472447
memset(col,0,sizeof(*col));
@@ -2555,9 +2555,9 @@ static void init_columns(args_t *args)
25552555
if ( ptr )
25562556
{
25572557
*ptr = 0; tmp.l = 0; ksprintf(&tmp,"%s:=%s",key_src,ptr+1); *ptr = '=';
2558-
error("The tag \"%s\" is not defined, is this what you want \"%s\" ?\n",key_src,tmp.s);
2558+
error("The INFO tag \"%s\" is not defined, is this what you want \"%s\" ?\n",key_src,tmp.s);
25592559
}
2560-
error("The tag \"%s\" is not defined in %s, was the -h option provided?\n", key_src,args->files->readers[1].fname);
2560+
error("The INFO tag \"%s\" is not defined in %s, was the -h option provided?\n", key_src,args->files->readers[1].fname);
25612561
}
25622562
tmp.l = 0;
25632563
bcf_hrec_format_rename(hrec, key_dst, &tmp);
@@ -2568,7 +2568,7 @@ static void init_columns(args_t *args)
25682568
hdr_id = bcf_hdr_id2int(args->hdr_out, BCF_DT_ID, key_dst);
25692569
}
25702570
else
2571-
error("The tag \"%s\" is not defined in %s, was the -h option provided?\n", key_dst, args->targets_fname);
2571+
error("The INFO tag \"%s\" is not defined in %s, was the -h option provided?\n", key_dst, args->targets_fname);
25722572
assert( bcf_hdr_idinfo_exists(args->hdr_out,BCF_HL_INFO,hdr_id) );
25732573
}
25742574
if ( args->tgts_is_vcf )

vcfmerge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ static void info_rules_init(args_t *args)
385385
info_rule_t *rule = &args->rules[n];
386386
rule->hdr_tag = strdup(ss);
387387
int id = bcf_hdr_id2int(args->out_hdr, BCF_DT_ID, rule->hdr_tag);
388-
if ( !bcf_hdr_idinfo_exists(args->out_hdr,BCF_HL_INFO,id) ) error("The tag is not defined in the header: \"%s\"\n", rule->hdr_tag);
388+
if ( !bcf_hdr_idinfo_exists(args->out_hdr,BCF_HL_INFO,id) ) error("The INFO tag is not defined in the header: \"%s\"\n", rule->hdr_tag);
389389
rule->type = bcf_hdr_id2type(args->out_hdr,BCF_HL_INFO,id);
390390
if ( rule->type==BCF_HT_INT ) rule->type_size = sizeof(int32_t);
391391
else if ( rule->type==BCF_HT_REAL ) rule->type_size = sizeof(float);

0 commit comments

Comments
 (0)