Skip to content

Commit b3bfc34

Browse files
committed
Merge pull request samtools#271 from samtools/feature/fix.84
fix.84
2 parents dbb7dda + b2163f5 commit b3bfc34

File tree

9 files changed

+222
-67
lines changed

9 files changed

+222
-67
lines changed

test/norm.fa

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ ACTGGACACGTGGACACACACACACACACACACACACACACAGTCAAACCACCTACCAGA
2222
TCCCCTCTTGACCTCTCTCTATTTTTTTTTTTTTTTCTGAGATGGATTTTTGCTCTTGTT
2323
>5 20:18724313-18724343
2424
GTCTCAAAAAAAAAAAAAAAAAAAAGAAAAG
25+
>21
26+
TTTATTATTATTATTATTAAATTGAATTTATTTAGTGTACATACATTCATGTGTATTGTG

test/norm.fa.fai

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
3 60 902 60 61
55
4 60 985 60 61
66
5 31 1070 31 32
7+
21 60 1106 60 61

test/norm.merge.2.out

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
##fileformat=VCFv4.1
2+
##FILTER=<ID=PASS,Description="All filters passed">
3+
##INFO=<ID=INDEL,Number=0,Type=Flag,Description="Indicates that the variant is an INDEL.">
4+
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
5+
##FORMAT=<ID=PL,Number=G,Type=Integer,Description="Phred-scaled likelihood">
6+
##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Depth">
7+
##contig=<ID=1,length=2147483647>
8+
##contig=<ID=2,length=2147483647>
9+
##contig=<ID=20,length=2147483647>
10+
##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Depth">
11+
##INFO=<ID=AC,Number=A,Type=Integer,Description="Allele count in genotypes">
12+
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in called genotypes">
13+
##INFO=<ID=XRF,Number=R,Type=Float,Description="Test Number=AGR in INFO">
14+
##INFO=<ID=XAF,Number=A,Type=Float,Description="Test Number=AGR in INFO">
15+
##INFO=<ID=XGF,Number=G,Type=Float,Description="Test Number=AGR in INFO">
16+
##INFO=<ID=XRI,Number=R,Type=Integer,Description="Test Number=AGR in INFO">
17+
##INFO=<ID=XAI,Number=A,Type=Integer,Description="Test Number=AGR in INFO">
18+
##INFO=<ID=XGI,Number=G,Type=Integer,Description="Test Number=AGR in INFO">
19+
##INFO=<ID=XRS,Number=R,Type=String,Description="Test Number=AGR in INFO">
20+
##INFO=<ID=XAS,Number=A,Type=String,Description="Test Number=AGR in INFO">
21+
##INFO=<ID=XGS,Number=G,Type=String,Description="Test Number=AGR in INFO">
22+
##FORMAT=<ID=FRF,Number=R,Type=Float,Description="Test Number=AGR in FORMAT">
23+
##FORMAT=<ID=FAF,Number=A,Type=Float,Description="Test Number=AGR in FORMAT">
24+
##FORMAT=<ID=FGF,Number=G,Type=Float,Description="Test Number=AGR in FORMAT">
25+
##FORMAT=<ID=FRI,Number=R,Type=Integer,Description="Test Number=AGR in FORMAT">
26+
##FORMAT=<ID=FAI,Number=A,Type=Integer,Description="Test Number=AGR in FORMAT">
27+
##FORMAT=<ID=FGI,Number=G,Type=Integer,Description="Test Number=AGR in FORMAT">
28+
##FORMAT=<ID=FRS,Number=R,Type=String,Description="Test Number=AGR in FORMAT">
29+
##FORMAT=<ID=FAS,Number=A,Type=String,Description="Test Number=AGR in FORMAT">
30+
##FORMAT=<ID=FGS,Number=G,Type=String,Description="Test Number=AGR in FORMAT">
31+
##FORMAT=<ID=FSTR,Number=1,Type=String,Description="Test String in FORMAT">
32+
##INFO=<ID=ISTR,Number=1,Type=String,Description="Test String in INFO">
33+
##FILTER=<ID=FAIL1,Description="Failed filter 1">
34+
##FILTER=<ID=FAIL2,Description="Failed filter 2">
35+
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT XY00001 XY00002 XY00003
36+
1 105 . T C 999 PASS . GT:FGI:FRI 1:1,2:3,4 0/1:5,6,7:8,9 0/1:.:.,.
37+
1 110 . C A 999 PASS . GT:FGI 1:1,2 0:3,4 0:.
38+
1 150 . A C 999 PASS . GT:FGI 1:1,2 0:. 0:3,4

test/norm.merge.2.vcf

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
##fileformat=VCFv4.1
2+
##FILTER=<ID=PASS,Description="All filters passed">
3+
##INFO=<ID=INDEL,Number=0,Type=Flag,Description="Indicates that the variant is an INDEL.">
4+
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
5+
##FORMAT=<ID=PL,Number=G,Type=Integer,Description="Phred-scaled likelihood">
6+
##FORMAT=<ID=DP,Number=1,Type=Integer,Description="Depth">
7+
##contig=<ID=1,length=2147483647>
8+
##contig=<ID=2,length=2147483647>
9+
##contig=<ID=20,length=2147483647>
10+
##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Depth">
11+
##INFO=<ID=AC,Number=A,Type=Integer,Description="Allele count in genotypes">
12+
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in called genotypes">
13+
##INFO=<ID=XRF,Number=R,Type=Float,Description="Test Number=AGR in INFO">
14+
##INFO=<ID=XAF,Number=A,Type=Float,Description="Test Number=AGR in INFO">
15+
##INFO=<ID=XGF,Number=G,Type=Float,Description="Test Number=AGR in INFO">
16+
##INFO=<ID=XRI,Number=R,Type=Integer,Description="Test Number=AGR in INFO">
17+
##INFO=<ID=XAI,Number=A,Type=Integer,Description="Test Number=AGR in INFO">
18+
##INFO=<ID=XGI,Number=G,Type=Integer,Description="Test Number=AGR in INFO">
19+
##INFO=<ID=XRS,Number=R,Type=String,Description="Test Number=AGR in INFO">
20+
##INFO=<ID=XAS,Number=A,Type=String,Description="Test Number=AGR in INFO">
21+
##INFO=<ID=XGS,Number=G,Type=String,Description="Test Number=AGR in INFO">
22+
##FORMAT=<ID=FRF,Number=R,Type=Float,Description="Test Number=AGR in FORMAT">
23+
##FORMAT=<ID=FAF,Number=A,Type=Float,Description="Test Number=AGR in FORMAT">
24+
##FORMAT=<ID=FGF,Number=G,Type=Float,Description="Test Number=AGR in FORMAT">
25+
##FORMAT=<ID=FRI,Number=R,Type=Integer,Description="Test Number=AGR in FORMAT">
26+
##FORMAT=<ID=FAI,Number=A,Type=Integer,Description="Test Number=AGR in FORMAT">
27+
##FORMAT=<ID=FGI,Number=G,Type=Integer,Description="Test Number=AGR in FORMAT">
28+
##FORMAT=<ID=FRS,Number=R,Type=String,Description="Test Number=AGR in FORMAT">
29+
##FORMAT=<ID=FAS,Number=A,Type=String,Description="Test Number=AGR in FORMAT">
30+
##FORMAT=<ID=FGS,Number=G,Type=String,Description="Test Number=AGR in FORMAT">
31+
##FORMAT=<ID=FSTR,Number=1,Type=String,Description="Test String in FORMAT">
32+
##INFO=<ID=ISTR,Number=1,Type=String,Description="Test String in INFO">
33+
##FILTER=<ID=FAIL1,Description="Failed filter 1">
34+
##FILTER=<ID=FAIL2,Description="Failed filter 2">
35+
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT XY00001 XY00002 XY00003
36+
1 105 . T . 999 PASS . GT:FGI:FRI 0:.:. 0/0:.:. 0/1:.:.
37+
1 105 . T C 999 PASS . GT:FGI:FRI 1:1,2:3,4 0/1:5,6,7:8,9 0/1:.:.
38+
1 110 . C . 999 PASS . GT:FGI 0:. 0:. 0:.
39+
1 110 . C A 999 PASS . GT:FGI 1:1,2 0:3,4 0:.
40+
1 150 . A . 999 PASS . GT:FGI 0:. 0:. 0:.
41+
1 150 . A C 999 PASS . GT:FGI 1:1,2 0:. 0:3,4

test/norm.split.out

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
##contig=<ID=1,length=2147483647>
88
##contig=<ID=2,length=2147483647>
99
##contig=<ID=20,length=2147483647>
10+
##contig=<ID=21,length=2147483647>
1011
##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Depth">
1112
##INFO=<ID=AC,Number=A,Type=Integer,Description="Allele count in genotypes">
1213
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in called genotypes">
@@ -55,5 +56,9 @@
5556
20 275 . A C 999 PASS INDEL;AN=2;AC=0 GT:PL:DP:FGF:FGI:FGS:FSTR 0:0,0:0:1e+06,2e+06:1111,2222:A,BB:WORD 0:0,0:0:1e+06,2e+06:1111,2222:A,BB:WORD
5657
20 275 . A G 999 PASS INDEL;AN=2;AC=2 GT:PL:DP:FGF:FGI:FGS:FSTR 1:0,0:0:1e+06,3e+06:1111,3333:A,CCC:WORD 1:0,0:0:1e+06,3e+06:1111,3333:A,CCC:WORD
5758
20 278 . AAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA 999 PASS INDEL;AN=0;AC=0 GT:PL:DP ./.:0,0,0:0 ./.:0,0,0:0
58-
20 300 . A C 999 PASS INDEL;AN=0;AC=0 GT:PL:DP ./.:0,0,0:0 ./.:0,0,0:0
59-
20 300 . A G 999 PASS INDEL;AN=0;AC=0 GT:PL:DP ./.:0,0,0:0 ./.:0,0,0:0
59+
20 300 . T C 999 PASS INDEL;AN=0;AC=0 GT:PL:DP ./.:0,0,0:0 ./.:0,0,0:0
60+
20 300 . T G 999 PASS INDEL;AN=0;AC=0 GT:PL:DP ./.:0,0,0:0 ./.:0,0,0:0
61+
21 1 id TTTA TTTATTATTA 999 PASS INDEL;AN=0;AC=0 GT:DP ./.:0 ./.:0
62+
21 1 id TTTA TTTATTATTATTATTATTATTA 999 PASS INDEL;AN=0;AC=0 GT:DP ./.:0 ./.:0
63+
21 1 id TTTA T 999 PASS INDEL;AN=0;AC=0 GT:DP ./.:0 ./.:0
64+
21 1 id TTTA TTATTATTA 999 PASS INDEL;AN=0;AC=0 GT:DP ./.:0 ./.:0

test/norm.split.vcf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
##contig=<ID=1,length=2147483647>
88
##contig=<ID=2,length=2147483647>
99
##contig=<ID=20,length=2147483647>
10+
##contig=<ID=21,length=2147483647>
1011
##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Depth">
1112
##INFO=<ID=AC,Number=A,Type=Integer,Description="Allele count in genotypes">
1213
##INFO=<ID=AN,Number=1,Type=Integer,Description="Total number of alleles in called genotypes">
@@ -48,4 +49,5 @@
4849
20 274 . AAAAAAAAA AAAAAAAAAAAAAAAAAAA 999 PASS INDEL;AN=0;AC=0 GT:PL:DP ./.:0,0,0:0 ./.:0,0,0:0
4950
20 275 . A C,G 999 PASS INDEL;AN=2;AC=0,2 GT:PL:DP:FGF:FGI:FGS:FSTR 2:0,0,0:0:1e+06,2e+06,3e+06:1111,2222,3333:A,BB,CCC:WORD 2:0,0,0:0:1e+06,2e+06,3e+06:1111,2222,3333:A,BB,CCC:WORD
5051
20 278 . AAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAA 999 PASS INDEL;AN=0;AC=0 GT:PL:DP ./.:0,0,0:0 ./.:0,0,0:0
51-
20 300 . A C,G 999 PASS INDEL;AN=0;AC=0,0 GT:PL:DP ./.:0,0,0,0,0,0:0 ./.:0,0,0,0,0,0:0
52+
20 300 . T C,G 999 PASS INDEL;AN=0;AC=0,0 GT:PL:DP ./.:0,0,0,0,0,0:0 ./.:0,0,0,0,0,0:0
53+
21 1 id TTTA TTTATTATTA,TTTATTATTATTATTATTATTA,T,TTATTATTA 999 PASS INDEL;AN=0;AC=0,0,0,0 GT:DP ./.:0 ./.:0

test/test.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
test_vcf_norm($opts,in=>'norm',out=>'norm.out',fai=>'norm');
8585
test_vcf_norm($opts,in=>'norm.split',out=>'norm.split.out',args=>'-m-');
8686
test_vcf_norm($opts,in=>'norm.merge',out=>'norm.merge.out',args=>'-m+');
87+
test_vcf_norm($opts,in=>'norm.merge.2',out=>'norm.merge.2.out',args=>'-m+');
8788
test_vcf_norm($opts,in=>'norm.merge',out=>'norm.merge.strict.out',args=>'-m+ -s');
8889
test_vcf_norm($opts,in=>'norm.setref',out=>'norm.setref.out',args=>'-Nc s',fai=>'norm');
8990
test_vcf_view($opts,in=>'view',out=>'view.1.out',args=>'-aUc1 -C1 -s NA00002 -v snps',reg=>'');

vcfcall.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ static char **parse_ped_samples(call_t *call, char **vals, int _n)
191191
for (i=0; i<call->nfams; i++)
192192
assert( call->fams[i].sample[0]>=0 && call->fams[i].sample[1]>=0 && call->fams[i].sample[2]>=0 ); // multiple childs, not a trio
193193

194+
// for (i=0; i<call->nfams; i++)
195+
// fprintf(stderr,"mother=%s, father=%s, child=%s\n", sam[call->fams[i].sample[MOTHER]],sam[call->fams[i].sample[FATHER]],sam[call->fams[i].sample[CHILD]]);
196+
194197
return sam;
195198
}
196199

0 commit comments

Comments
 (0)