{"action":"opened","issue":{"url":"https://api.github.com/repos/samtools/bcftools/issues/208","labels_url":"https://api.github.com/repos/samtools/bcftools/issues/208/labels{/name}","comments_url":"https://api.github.com/repos/samtools/bcftools/issues/208/comments","events_url":"https://api.github.com/repos/samtools/bcftools/issues/208/events","html_url":"https://github.com/samtools/bcftools/issues/208","id":57002815,"number":208,"title":"inconsistent INFO and FORMAT lines IDX numbers between call and view subcommands","user":{"login":"wm75","id":4742081,"avatar_url":"https://avatars.githubusercontent.com/u/4742081?v=3","gravatar_id":"","url":"https://api.github.com/users/wm75","html_url":"https://github.com/wm75","followers_url":"https://api.github.com/users/wm75/followers","following_url":"https://api.github.com/users/wm75/following{/other_user}","gists_url":"https://api.github.com/users/wm75/gists{/gist_id}","starred_url":"https://api.github.com/users/wm75/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wm75/subscriptions","organizations_url":"https://api.github.com/users/wm75/orgs","repos_url":"https://api.github.com/users/wm75/repos","events_url":"https://api.github.com/users/wm75/events{/privacy}","received_events_url":"https://api.github.com/users/wm75/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-09T08:45:07Z","updated_at":"2015-02-09T08:45:07Z","closed_at":null,"body":"Hi,\r\na few days ago I switched from samtools/bcftools 1.0 to 1.2 .\r\nOne immediate problem I ran into was that 'bcftools concat' stopped working for mixed bcf input files, some generated with 'bcftools call', some with 'bcftools view'. With stopped working I mean that 'concat' actually does produce output without complaining, but when trying to 'view' the resulting file 'bctools view' invariably seg faults on the first record in the file.\r\n\r\nAfter quite some debugging attempts, my only explanation for the observed behaviour is that the 'call' command seems to use different IDX numbers for certain INFO and FORMAT lines in the bcf header.\r\nHere's a element-by-element comparison (I had to trim all lines to prevent github from ignoring '<>' flanked content) for the relevant header lines from a file generated with 'bcftools call' and one obtained by taking that same file through a bcf -> vcf -> bcf cycle with 'bcftools view'. Note how several IDXs are changing.\r\n\r\nThe INFO records:\r\nID=INDEL,Number=0,Type=Flag,Description=\"Indicates that the variant is an INDEL.\",IDX=1\r\nID=INDEL,Number=0,Type=Flag,Description=\"Indicates that the variant is an INDEL.\",IDX=1\r\nID=IDV,Number=1,Type=Integer,Description=\"Maximum number of reads supporting an indel\",IDX=2\r\nID=IDV,Number=1,Type=Integer,Description=\"Maximum number of reads supporting an indel\",IDX=2\r\nID=IMF,Number=1,Type=Float,Description=\"Maximum fraction of reads supporting an indel\",IDX=3\r\nID=IMF,Number=1,Type=Float,Description=\"Maximum fraction of reads supporting an indel\",IDX=3\r\nID=DP,Number=1,Type=Integer,Description=\"Raw read depth\",IDX=4\r\nID=DP,Number=1,Type=Integer,Description=\"Raw read depth\",IDX=4\r\nID=VDB,Number=1,Type=Float,Description=\"Variant Distance Bias for filtering splice-site artefacts in RNA-seq data (bigger is better)\",Version=\"3\",IDX=5\r\nID=VDB,Number=1,Type=Float,Description=\"Variant Distance Bias for filtering splice-site artefacts in RNA-seq data (bigger is better)\",Version=\"3\",IDX=5\r\nID=RPB,Number=1,Type=Float,Description=\"Mann-Whitney U test of Read Position Bias (bigger is better)\",IDX=6\r\nID=RPB,Number=1,Type=Float,Description=\"Mann-Whitney U test of Read Position Bias (bigger is better)\",IDX=6\r\nID=MQB,Number=1,Type=Float,Description=\"Mann-Whitney U test of Mapping Quality Bias (bigger is better)\",IDX=7\r\nID=MQB,Number=1,Type=Float,Description=\"Mann-Whitney U test of Mapping Quality Bias (bigger is better)\",IDX=7\r\nID=BQB,Number=1,Type=Float,Description=\"Mann-Whitney U test of Base Quality Bias (bigger is better)\",IDX=8\r\nID=BQB,Number=1,Type=Float,Description=\"Mann-Whitney U test of Base Quality Bias (bigger is better)\",IDX=8\r\nID=MQSB,Number=1,Type=Float,Description=\"Mann-Whitney U test of Mapping Quality vs Strand Bias (bigger is better)\",IDX=9\r\nID=MQSB,Number=1,Type=Float,Description=\"Mann-Whitney U test of Mapping Quality vs Strand Bias (bigger is better)\",IDX=9\r\nID=SGB,Number=1,Type=Float,Description=\"Segregation based metric.\",IDX=10\r\nID=SGB,Number=1,Type=Float,Description=\"Segregation based metric.\",IDX=10\r\nID=MQ0F,Number=1,Type=Float,Description=\"Fraction of MQ0 reads (smaller is better)\",IDX=11\r\nID=MQ0F,Number=1,Type=Float,Description=\"Fraction of MQ0 reads (smaller is better)\",IDX=11\r\nID=ICB,Number=1,Type=Float,Description=\"Inbreeding Coefficient Binomial test (bigger is better)\",IDX=18\r\nID=ICB,Number=1,Type=Float,Description=\"Inbreeding Coefficient Binomial test (bigger is better)\",IDX=16\r\nID=HOB,Number=1,Type=Float,Description=\"Bias in the number of HOMs number (smaller is better)\",IDX=19\r\nID=HOB,Number=1,Type=Float,Description=\"Bias in the number of HOMs number (smaller is better)\",IDX=17\r\nID=AC,Number=A,Type=Integer,Description=\"Allele count in genotypes for each ALT allele, in the same order as listed\",IDX=20\r\nID=AC,Number=A,Type=Integer,Description=\"Allele count in genotypes for each ALT allele, in the same order as listed\",IDX=18\r\nID=AN,Number=1,Type=Integer,Description=\"Total number of alleles in called genotypes\",IDX=21\r\nID=AN,Number=1,Type=Integer,Description=\"Total number of alleles in called genotypes\",IDX=19\r\nID=DP4,Number=4,Type=Integer,Description=\"Number of high-quality ref-forward , ref-reverse, alt-forward and alt-reverse bases\",IDX=22\r\nID=DP4,Number=4,Type=Integer,Description=\"Number of high-quality ref-forward , ref-reverse, alt-forward and alt-reverse bases\",IDX=20\r\nID=MQ,Number=1,Type=Integer,Description=\"Average mapping quality\",IDX=23\r\nID=MQ,Number=1,Type=Integer,Description=\"Average mapping quality\",IDX=21\r\n\r\nand the FORMAT entries:\r\nID=PL,Number=G,Type=Integer,Description=\"List of Phred-scaled genotype likelihoods\",IDX=14\r\nID=PL,Number=G,Type=Integer,Description=\"List of Phred-scaled genotype likelihoods\",IDX=12\r\nID=DP,Number=1,Type=Integer,Description=\"Number of high-quality bases\",IDX=4\r\nID=DP,Number=1,Type=Integer,Description=\"Number of high-quality bases\",IDX=4\r\nID=DPR,Number=R,Type=Integer,Description=\"Number of high-quality bases observed for each allele\",IDX=15\r\nID=DPR,Number=R,Type=Integer,Description=\"Number of high-quality bases observed for each allele\",IDX=13\r\nID=GT,Number=1,Type=String,Description=\"Genotype\",IDX=16\r\nID=GT,Number=1,Type=String,Description=\"Genotype\",IDX=14\r\nID=GQ,Number=1,Type=Integer,Description=\"Phred-scaled Genotype Quality\",IDX=17\r\nID=GQ,Number=1,Type=Integer,Description=\"Phred-scaled Genotype Quality\",IDX=15\r\n\r\nThe rewritten bcf (containing the second lines above) then concats perfectly with other 'bcftools view' generated bcfs.\r\n\r\nJust in case it is relevant, here is the samtools mpileup | bcftools call pipe used to generate the 'call' bcf example:\r\n\r\nsamtools mpileup -d 250 -r MtDNA: -t DP,DPR -gu -f genome4217.fa bam8128.bam | bcftools call -m -A -f GQ -O b -\r\n\r\nThat exact same command run with samtools/bcftools 1.0 generated output that worked just fine with bcftools concat. I never tried samtools 1.1 so I don't know about the behaviour there.\r\n\r\nHope my description makes kind of sense and I'm not totally wrong with my diagnosis.\r\nBest wishes,\r\nWolfgang"}}