Skip to content

Commit

Permalink
Drop offending space character in query -H output
Browse files Browse the repository at this point in the history
The header printed by `bcftools query -H` and `bcftools +split-vep -H` contained
a space after the leading hash
    # [1]columnName

The space is unnecessary and complicates machine processing, so is dropped to
produce output like
    #[1]columnName

Resolves #1856
  • Loading branch information
pd3 committed Feb 6, 2023
1 parent 9ae4fe8 commit 02a3961
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,17 @@ Changes affecting the whole of bcftools, or multiple commands:
FORMAT/AD[0:GT] > 10 .. same as above, but in the first sample
sSUM(FORMAT/AD[GT]) > 20 .. require total sample depth bigger than 20

* The commands `consensus -H` and `+split-vep -H`

- Drop unnecessary leading space in the first header column and newly print `#[1]columnName`
instead of the previous `# [1]columnName` (#1856)


Changes affecting specific commands:

* bcftools +allele-length

- fix overflow for indels longer than 512bp and aggregate alleles equal or larger than
- Fix overflow for indels longer than 512bp and aggregate alleles equal or larger than
that in the same bin (#1837)

* bcftools annotate
Expand Down
4 changes: 2 additions & 2 deletions convert.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* convert.c -- functions for converting between VCF/BCF and related formats.
Copyright (C) 2013-2022 Genome Research Ltd.
Copyright (C) 2013-2023 Genome Research Ltd.
Author: Petr Danecek <pd3@sanger.ac.uk>
Expand Down Expand Up @@ -1568,7 +1568,7 @@ int convert_header(convert_t *convert, kstring_t *str)
if ( i!=convert->nfmt )
return str->l - l_ori;

kputs("# ", str);
kputc('#', str);
for (i=0; i<convert->nfmt; i++)
{
// Genotype fields
Expand Down
2 changes: 1 addition & 1 deletion test/split-vep.12.2.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [1]POS [2]Allele [3]Consequence [4]IMPACT [5]SYMBOL [6]Gene [7]Feature_type [8]Feature [9]BIOTYPE [10]EXON [11]INTRON [12]HGVSc [13]HGVSp [14]cDNA_position [15]CDS_position [16]Protein_position [17]Amino_acids [18]Codons [19]Existing_variation [20]ALLELE_NUM [21]DISTANCE [22]STRAND [23]FLAGS [24]VARIANT_CLASS [25]SYMBOL_SOURCE [26]HGNC_ID [27]CANONICAL [28]TSL [29]APPRIS [30]CCDS [31]ENSP [32]SWISSPROT [33]TREMBL [34]UNIPARC [35]SOURCE [36]GENE_PHENO [37]SIFT [38]PolyPhen [39]DOMAINS [40]miRNA [41]HGVS_OFFSET [42]AF [43]AFR_AF [44]AMR_AF [45]EAS_AF [46]EUR_AF [47]SAS_AF [48]AA_AF [49]EA_AF [50]gnomAD_AF [51]gnomAD_AFR_AF [52]gnomAD_AMR_AF [53]gnomAD_ASJ_AF [54]gnomAD_EAS_AF [55]gnomAD_FIN_AF [56]gnomAD_NFE_AF [57]gnomAD_OTH_AF [58]gnomAD_SAS_AF [59]MAX_AF [60]MAX_AF_POPS [61]CLIN_SIG [62]SOMATIC [63]PHENO [64]PUBMED [65]MOTIF_NAME [66]MOTIF_POS [67]HIGH_INF_POS [68]MOTIF_SCORE_CHANGE [69]LoF [70]LoF_filter [71]LoF_flags [72]LoF_info [73]CADD_PHRED [74]CADD_RAW [75]gnomAD2.1 [76]gnomAD2.1_AF_raw [77]gnomAD2.1_AF_popmax [78]gnomAD2.1_AF_afr [79]gnomAD2.1_AF_amr [80]gnomAD2.1_AF_asj [81]gnomAD2.1_AF_eas [82]gnomAD2.1_AF_fin [83]gnomAD2.1_AF_nfe [84]gnomAD2.1_AF_oth [85]gnomAD2.1_AF_sas
#[1]POS [2]Allele [3]Consequence [4]IMPACT [5]SYMBOL [6]Gene [7]Feature_type [8]Feature [9]BIOTYPE [10]EXON [11]INTRON [12]HGVSc [13]HGVSp [14]cDNA_position [15]CDS_position [16]Protein_position [17]Amino_acids [18]Codons [19]Existing_variation [20]ALLELE_NUM [21]DISTANCE [22]STRAND [23]FLAGS [24]VARIANT_CLASS [25]SYMBOL_SOURCE [26]HGNC_ID [27]CANONICAL [28]TSL [29]APPRIS [30]CCDS [31]ENSP [32]SWISSPROT [33]TREMBL [34]UNIPARC [35]SOURCE [36]GENE_PHENO [37]SIFT [38]PolyPhen [39]DOMAINS [40]miRNA [41]HGVS_OFFSET [42]AF [43]AFR_AF [44]AMR_AF [45]EAS_AF [46]EUR_AF [47]SAS_AF [48]AA_AF [49]EA_AF [50]gnomAD_AF [51]gnomAD_AFR_AF [52]gnomAD_AMR_AF [53]gnomAD_ASJ_AF [54]gnomAD_EAS_AF [55]gnomAD_FIN_AF [56]gnomAD_NFE_AF [57]gnomAD_OTH_AF [58]gnomAD_SAS_AF [59]MAX_AF [60]MAX_AF_POPS [61]CLIN_SIG [62]SOMATIC [63]PHENO [64]PUBMED [65]MOTIF_NAME [66]MOTIF_POS [67]HIGH_INF_POS [68]MOTIF_SCORE_CHANGE [69]LoF [70]LoF_filter [71]LoF_flags [72]LoF_info [73]CADD_PHRED [74]CADD_RAW [75]gnomAD2.1 [76]gnomAD2.1_AF_raw [77]gnomAD2.1_AF_popmax [78]gnomAD2.1_AF_afr [79]gnomAD2.1_AF_amr [80]gnomAD2.1_AF_asj [81]gnomAD2.1_AF_eas [82]gnomAD2.1_AF_fin [83]gnomAD2.1_AF_nfe [84]gnomAD2.1_AF_oth [85]gnomAD2.1_AF_sas
14464 T non_coding_transcript_exon_variant MODIFIER WASH7P ENSG00000227232 Transcript ENST00000423562 unprocessed_pseudogene 10/10 . ENST00000423562.1:n.1568T>A . 1568 . . . . rs546169444 1 . -1 . SNV HGNC 38034 . . . . . . . . . . . . . . . 0.0958 0.0144 0.1138 0.005 0.1859 0.1943 . . . . . . . . . . . 0.1943 SAS . . . . . . . . . . . . . . . . . . . . . . . . .
14464 T non_coding_transcript_exon_variant MODIFIER WASH7P ENSG00000227232 Transcript ENST00000438504 unprocessed_pseudogene 12/12 . ENST00000438504.2:n.1682T>A . 1682 . . . . rs546169444 1 . -1 . SNV HGNC 38034 YES . . . . . . . . . . . . . . 0.0958 0.0144 0.1138 0.005 0.1859 0.1943 . . . . . . . . . . . 0.1943 SAS . . . . . . . . . . . . . . . . . . . . . . . . .
14464 T downstream_gene_variant MODIFIER DDX11L1 ENSG00000223972 Transcript ENST00000456328 processed_transcript . . . . . . . . . rs546169444 1 55 1 . SNV HGNC 37102 YES . . . . . . . . . . . . . . 0.0958 0.0144 0.1138 0.005 0.1859 0.1943 . . . . . . . . . . . 0.1943 SAS . . . . . . . . . . . . . . . . . . . . . . . . .
Expand Down

0 comments on commit 02a3961

Please sign in to comment.