Skip to content

Commit 3451d0a

Browse files
committed
Merge pull request #19 from sanger-pathogens/BT5_471874_GT_format
Change output format to show Genotype rather than Alt Base
2 parents 682941d + 497b6e0 commit 3451d0a

File tree

9 files changed

+226
-42
lines changed

9 files changed

+226
-42
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1
1+
2.0.0

src/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ TESTS = $(check_PROGRAMS)
2525
check_PROGRAMS = run-all-tests
2626
run_all_tests_SOURCES = \
2727
../tests/check-snp-sites.c \
28+
../tests/check-vcf.c \
2829
../tests/helper-methods.c \
2930
../tests/run-all-tests.c
3031
run_all_tests_CFLAGS = -I../tests

src/vcf.c

Lines changed: 60 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
#include "vcf.h"
2727
#include "alignment-file.h"
2828
#include "snp-sites.h"
29-
30-
29+
#include <assert.h>
3130

3231
void create_vcf_file(char filename[], int snp_locations[],int number_of_snps, char ** bases_for_snps, char ** sequence_names, int number_of_samples)
3332
{
@@ -56,7 +55,7 @@ void output_vcf_header( FILE * vcf_file_pointer, char ** sequence_names, int num
5655
{
5756
int i;
5857
fprintf( vcf_file_pointer, "##fileformat=VCFv4.1\n" );
59-
fprintf( vcf_file_pointer, "##INFO=<ID=AB,Number=1,Type=String,Description=\"Alt Base\">\n" );
58+
fprintf( vcf_file_pointer, "##FORMAT=<ID=GT,Number=1,Type=String,Description=\"Genotype\">\n" );
6059
fprintf( vcf_file_pointer, "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO\tFORMAT\t" );
6160

6261
for(i=0; i<number_of_samples; i++)
@@ -69,7 +68,6 @@ void output_vcf_header( FILE * vcf_file_pointer, char ** sequence_names, int num
6968
void output_vcf_row(FILE * vcf_file_pointer, char * bases_for_snp, int snp_location, int number_of_samples)
7069
{
7170
char reference_base = bases_for_snp[0];
72-
char alt_bases[30];
7371
if(reference_base == '\0')
7472
{
7573
return;
@@ -90,53 +88,94 @@ void output_vcf_row(FILE * vcf_file_pointer, char * bases_for_snp, int snp_locat
9088
// ALT
9189
// Need to look through list and find unique characters
9290

93-
alternative_bases(reference_base, bases_for_snp, alt_bases, number_of_samples);
94-
fprintf( vcf_file_pointer, "%s\t", alt_bases);
91+
char * alt_bases = alternative_bases(reference_base, bases_for_snp, number_of_samples);
92+
char * alternative_bases_string = format_alternative_bases(alt_bases);
93+
fprintf( vcf_file_pointer, "%s\t", alternative_bases_string );
94+
free(alternative_bases_string);
9595

9696
// QUAL
9797
fprintf( vcf_file_pointer, ".\t");
9898

9999
// FILTER
100100
fprintf( vcf_file_pointer, ".\t");
101101

102-
// FORMAT
103-
fprintf( vcf_file_pointer, "AB\t");
104-
105102
// INFO
106103
fprintf( vcf_file_pointer, ".\t");
107104

105+
// FORMAT
106+
fprintf( vcf_file_pointer, "GT\t");
107+
108108
// Bases for each sample
109-
output_vcf_row_samples_bases(vcf_file_pointer, reference_base, bases_for_snp, number_of_samples );
109+
output_vcf_row_samples_bases(vcf_file_pointer, reference_base, alt_bases, bases_for_snp, number_of_samples );
110+
free(alt_bases);
110111

111112
fprintf( vcf_file_pointer, "\n");
112113
}
113114

114115

115-
void alternative_bases(char reference_base, char * bases_for_snp, char alt_bases[], int number_of_samples)
116+
char * alternative_bases(char reference_base, char * bases_for_snp, int number_of_samples)
116117
{
117118
int i;
118119
int num_alt_bases = 0;
120+
char * alt_bases = calloc(MAXIMUM_NUMBER_OF_ALT_BASES+1, sizeof(char));
119121
for(i=0; i< number_of_samples; i++ )
120122
{
121123
if((bases_for_snp[i] != reference_base) && (bases_for_snp[i] != '-') && (toupper(bases_for_snp[i]) != 'N') )
122124
{
123125
if(check_if_char_in_string(alt_bases, bases_for_snp[i], num_alt_bases) == 0)
124126
{
127+
if (num_alt_bases >= MAXIMUM_NUMBER_OF_ALT_BASES)
128+
{
129+
fprintf(stderr, "Unexpectedly large number of alternative bases found between sequences. Please check input file is not corrupted\n\n");
130+
fflush(stderr);
131+
exit(EXIT_FAILURE);
132+
}
125133
alt_bases[num_alt_bases] = bases_for_snp[i];
126134
num_alt_bases++;
127-
alt_bases[num_alt_bases] = ',';
128-
num_alt_bases++;
129135
}
130136
}
131137
}
132-
if(num_alt_bases > 0 && alt_bases[num_alt_bases-1] == ',')
138+
return alt_bases;
139+
}
140+
141+
char * format_allele_index(char base, char reference_base, char * alt_bases)
142+
{
143+
int length_of_alt_bases = strlen(alt_bases);
144+
assert(length_of_alt_bases < 100);
145+
char * result = calloc(3, sizeof(char));
146+
int index;
147+
if (reference_base == base || toupper(base) == 'N' || base == '-')
133148
{
134-
alt_bases[num_alt_bases-1] = '\0';
149+
sprintf(result, "0");
135150
}
136151
else
137152
{
138-
alt_bases[num_alt_bases] = '\0';
153+
sprintf(result, ".");
154+
for (index = 1; index <= length_of_alt_bases; index++)
155+
{
156+
if (alt_bases[index-1] == base)
157+
{
158+
sprintf(result, "%i", index);
159+
break;
160+
}
161+
}
162+
}
163+
return result;
164+
}
165+
166+
char * format_alternative_bases(char * alt_bases)
167+
{
168+
int number_of_alt_bases = strlen(alt_bases);
169+
assert( number_of_alt_bases < MAXIMUM_NUMBER_OF_ALT_BASES );
170+
char * formatted_alt_bases = calloc(number_of_alt_bases*2 + 1, sizeof(char));
171+
int i;
172+
formatted_alt_bases[0] = alt_bases[0];
173+
for (i = 1; i < number_of_alt_bases; i++)
174+
{
175+
formatted_alt_bases[i*2 - 1] = ',';
176+
formatted_alt_bases[i*2] = alt_bases[i];
139177
}
178+
return formatted_alt_bases;
140179
}
141180

142181
int check_if_char_in_string(char search_string[], char target_char, int search_string_length)
@@ -152,20 +191,16 @@ int check_if_char_in_string(char search_string[], char target_char, int search_s
152191
return 0;
153192
}
154193

155-
void output_vcf_row_samples_bases(FILE * vcf_file_pointer, char reference_base, char * bases_for_snp, int number_of_samples)
194+
void output_vcf_row_samples_bases(FILE * vcf_file_pointer, char reference_base, char * alt_bases, char * bases_for_snp, int number_of_samples)
156195
{
157196
int i;
197+
char * format;
158198

159199
for(i=0; i < number_of_samples ; i++ )
160200
{
161-
if((bases_for_snp[i] == reference_base) || (bases_for_snp[i] == '-') || (toupper(bases_for_snp[i]) == 'N') )
162-
{
163-
fprintf( vcf_file_pointer, "." );
164-
}
165-
else
166-
{
167-
fprintf( vcf_file_pointer, "%c", (char) bases_for_snp[i] );
168-
}
201+
format = format_allele_index(bases_for_snp[i], reference_base, alt_bases);
202+
fprintf( vcf_file_pointer, "%s", format);
203+
free(format);
169204
if(i+1 != number_of_samples)
170205
{
171206
fprintf( vcf_file_pointer, "\t");

src/vcf.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ void output_vcf_header( FILE * vcf_file_pointer, char ** sequence_names, int num
2525
void create_vcf_file(char filename[], int snp_locations[], int number_of_snps, char ** bases_for_snps, char ** sequence_names, int number_of_samples);
2626
void output_vcf_snps(FILE * vcf_file_pointer, char ** bases_for_snps, int * snp_locations, int number_of_snps, int number_of_samples);
2727
void output_vcf_row(FILE * vcf_file_pointer, char * bases_for_snp, int snp_location, int number_of_samples);
28-
void output_vcf_row_samples_bases(FILE * vcf_file_pointer, char reference_base, char * bases_for_snp, int number_of_samples);
29-
void alternative_bases(char reference_base, char * bases_for_snp, char alt_bases[], int number_of_samples);
28+
void output_vcf_row_samples_bases(FILE * vcf_file_pointer, char reference_base, char * alt_bases, char * bases_for_snp, int number_of_samples);
29+
char * alternative_bases(char reference_base, char * bases_for_snp, int number_of_samples);
30+
char * format_alternative_bases(char *);
31+
char * format_allele_index(char, char, char *);
3032
int check_if_char_in_string(char search_string[], char target_char, int search_string_length);
3133
#define MAX_FILENAME_SIZE 250
34+
#define MAXIMUM_NUMBER_OF_ALT_BASES 30
3235

3336
#endif

tests/check-vcf.c

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*
2+
* Wellcome Trust Sanger Institute
3+
* Copyright (C) 2013 Wellcome Trust Sanger Institute
4+
*
5+
* This program is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License
7+
* as published by the Free Software Foundation; either version 3
8+
* of the License, or (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18+
*/
19+
20+
#include <stdio.h>
21+
#include <stdlib.h>
22+
#include <string.h>
23+
#include <check.h>
24+
#include <sys/stat.h>
25+
#include <fcntl.h>
26+
#include <unistd.h>
27+
#include <errno.h>
28+
#include "check-vcf.h"
29+
#include "vcf.h"
30+
31+
void check_alternative_bases(char reference_base, char * bases_for_snp, int number_of_samples, char * expected_result)
32+
{
33+
char * result;
34+
result = alternative_bases(reference_base, bases_for_snp, number_of_samples);
35+
ck_assert_str_eq(result, expected_result);
36+
free(result);
37+
}
38+
39+
START_TEST (alternative_bases_test)
40+
{
41+
check_alternative_bases('A', "AGCT-nN", 6, "GCT");
42+
}
43+
END_TEST
44+
45+
void check_format_alternative_bases(char * test_case, char * expected_result)
46+
{
47+
char * result;
48+
result = format_alternative_bases(test_case);
49+
ck_assert_str_eq(result, expected_result);
50+
free(result);
51+
}
52+
53+
START_TEST (format_alternative_bases_test)
54+
{
55+
check_format_alternative_bases("", "");
56+
check_format_alternative_bases("A", "A");
57+
check_format_alternative_bases("AC", "A,C");
58+
check_format_alternative_bases("ACT", "A,C,T");
59+
}
60+
END_TEST
61+
62+
void check_format_allele_index(char test_base, char reference_base, char * alt_bases, char * expected_result)
63+
{
64+
char * result;
65+
result = format_allele_index(test_base, reference_base, alt_bases);
66+
ck_assert_str_eq(result, expected_result);
67+
free(result);
68+
}
69+
70+
START_TEST (format_allele_index_test)
71+
{
72+
check_format_allele_index('A', 'A', "", "0");
73+
check_format_allele_index('A', 'A', "C", "0");
74+
check_format_allele_index('A', 'A', "CA", "0");
75+
76+
check_format_allele_index('A', 'C', "A", "1");
77+
check_format_allele_index('A', 'C', "GA", "2");
78+
79+
check_format_allele_index('A', 'C', "", ".");
80+
check_format_allele_index('A', 'C', "G", ".");
81+
82+
check_format_allele_index('A', 'B', "CDEFGHIJKLMNOPAQRST", "15");
83+
84+
check_format_allele_index('-', 'A', "C", "0");
85+
check_format_allele_index('N', 'A', "C", "0");
86+
check_format_allele_index('n', 'A', "C", "0");
87+
}
88+
END_TEST
89+
90+
Suite * vcf_suite (void)
91+
{
92+
Suite *s = suite_create ("Creating_VCF_file");
93+
94+
TCase *tc_vcf_file = tcase_create ("vcf_file");
95+
tcase_add_test (tc_vcf_file, alternative_bases_test);
96+
tcase_add_test (tc_vcf_file, format_alternative_bases_test);
97+
tcase_add_test (tc_vcf_file, format_allele_index_test);
98+
suite_add_tcase (s, tc_vcf_file);
99+
100+
return s;
101+
}
102+
103+
104+

tests/check-vcf.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Wellcome Trust Sanger Institute
3+
* Copyright (C) 2013 Wellcome Trust Sanger Institute
4+
*
5+
* This program is free software; you can redistribute it and/or
6+
* modify it under the terms of the GNU General Public License
7+
* as published by the Free Software Foundation; either version 3
8+
* of the License, or (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program; if not, write to the Free Software
17+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18+
*/
19+
20+
#ifndef _CHECK_VCF_H_
21+
#define _CHECK_VCF_H_
22+
23+
void check_alternative_bases(char, char *, int, char *);
24+
void check_format_alternative_bases(char *, char *);
25+
void check_format_allele_index(char, char, char *, char *);
26+
Suite * vcf_suite (void);
27+
#endif
28+
29+
30+
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
##fileformat=VCFv4.1
2-
##INFO=<ID=AB,Number=1,Type=String,Description="Alt Base">
2+
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
33
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT 2956_6_1 2956_6_2 2956_6_3 2956_6_4 2956_6_5 2956_6_6 3002_8_1 3002_8_2 3002_8_3 3002_8_4 3002_8_5 3002_8_6 3002_8_7 4056_2_10 4056_2_11 4056_2_1 4056_2_12 4056_2_2 4056_2_3 4056_2_4 4056_2_5 4056_2_6 4056_2_7 4056_2_9 4056_6_10 4056_6_11 4056_6_12 4056_6_2 4056_6_3 4056_6_4 4056_6_5 4056_6_6 4056_6_7 4056_6_9 4056_7_10 4056_7_11 4056_7_1 4056_7_12 4056_7_7 4056_7_8 4056_7_9 4056_8_10 4056_8_1 4056_8_12 4056_8_2 4056_8_3 4056_8_4 4056_8_6 4056_8_8 4056_8_9 4075_3_11 4075_3_12 4075_3_2 4075_3_3 4075_3_5 4075_3_6 4075_3_7 4075_3_8 4075_3_9 4370_2_11 4370_2_12 4370_2_2 4370_2_3 4370_2_4 4370_2_7 4370_2_8 4370_2_9 4370_3_11 4370_3_1 4370_3_6 4370_3_7 4370_3_8 5174_5_1 5174_5_2 5174_5_3 5174_5_4 5174_5_5 5174_5_6 5174_5_7 5174_5_9 5174_6_10 5174_6_1 5174_6_2 5174_6_3 5174_6_4 5174_6_5 5174_6_6 5174_6_7 5174_6_8 5174_6_9 5174_7_10 5174_7_1 5174_7_2 5174_7_3 5174_7_4 5174_7_5 5174_7_6 5174_7_7 5174_7_8 5174_7_9 5174_8_1 5174_8_2 5174_8_3 5174_8_5 5174_8_6 5174_8_8 5174_8_9 Vibrio_parahaemolyticus Vibrio_vulnificus
4-
1 825 . A G . . AB . . . . . . . G G . . . G . G . . . . . G . . . . . . . . . . . . . . . . . . . . . . . . . . . G . . . . . . . . . . . . . . . . . . . . . . . . G . . . . . G G G . . . . . . . . . . G . . . . . . . . . . . G . . . . .
5-
1 1278 . A G . . AB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G
6-
1 1281 . C G . . AB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G
7-
1 1299 . G A . . AB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A
8-
1 1435 . C T . . AB . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4+
1 825 . A G . . . GT 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
5+
1 1278 . A G . . . GT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
6+
1 1281 . C G . . . GT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
7+
1 1299 . G A . . . GT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
8+
1 1435 . C T . . . GT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
##fileformat=VCFv4.1
2-
##INFO=<ID=AB,Number=1,Type=String,Description="Alt Base">
2+
##FORMAT=<ID=GT,Number=1,Type=String,Description="Genotype">
33
#CHROM POS ID REF ALT QUAL FILTER INFO FORMAT 2956_6_1 2956_6_2 2956_6_3 2956_6_4 2956_6_5 2956_6_6 3002_8_1 3002_8_2 3002_8_3 3002_8_4 3002_8_5 3002_8_6 3002_8_7 4056_2_10 4056_2_11 4056_2_1 4056_2_12 4056_2_2 4056_2_3 4056_2_4 4056_2_5 4056_2_6 4056_2_7 4056_2_9 4056_6_10 4056_6_11 4056_6_12 4056_6_2 4056_6_3 4056_6_4 4056_6_5 4056_6_6 4056_6_7 4056_6_9 4056_7_10 4056_7_11 4056_7_1 4056_7_12 4056_7_7 4056_7_8 4056_7_9 4056_8_10 4056_8_1 4056_8_12 4056_8_2 4056_8_3 4056_8_4 4056_8_6 4056_8_8 4056_8_9 4075_3_11 4075_3_12 4075_3_2 4075_3_3 4075_3_5 4075_3_6 4075_3_7 4075_3_8 4075_3_9 4370_2_11 4370_2_12 4370_2_2 4370_2_3 4370_2_4 4370_2_7 4370_2_8 4370_2_9 4370_3_11 4370_3_1 4370_3_6 4370_3_7 4370_3_8 5174_5_1 5174_5_2 5174_5_3 5174_5_4 5174_5_5 5174_5_6 5174_5_7 5174_5_9 5174_6_10 5174_6_1 5174_6_2 5174_6_3 5174_6_4 5174_6_5 5174_6_6 5174_6_7 5174_6_8 5174_6_9 5174_7_10 5174_7_1 5174_7_2 5174_7_3 5174_7_4 5174_7_5 5174_7_6 5174_7_7 5174_7_8 5174_7_9 5174_8_1 5174_8_2 5174_8_3 5174_8_5 5174_8_6 5174_8_8 5174_8_9 Vibrio_parahaemolyticus Vibrio_vulnificus
4-
1 825 . A G . . AB . . . . . . . G G . . . G . G . . . . . G . . . . . . . . . . . . . . . . . . . . . . . . . . . G . . . . . . . . . . . . . . . . . . . . . . . . G . . . . . G G G . . . . . . . . . . G . . . . . . . . . . . G . . . . .
5-
1 1278 . A G . . AB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G
6-
1 1281 . C G . . AB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . G
7-
1 1299 . G A . . AB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A
8-
1 1435 . C T . . AB . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4+
1 825 . A G . . . GT 0 0 0 0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
5+
1 1278 . A G . . . GT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
6+
1 1281 . C G . . . GT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
7+
1 1299 . G A . . . GT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
8+
1 1435 . C T . . . GT 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

tests/run-all-tests.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,27 @@
2222
#include <string.h>
2323
#include <check.h>
2424
#include "check-snp-sites.h"
25+
#include "check-vcf.h"
2526

2627

2728

2829
int main (void)
2930
{
3031
int number_failed;
31-
Suite *s = snp_sites_suite ();
32-
SRunner *sr = srunner_create (s);
32+
Suite *s;
33+
SRunner *sr;
34+
35+
s = snp_sites_suite ();
36+
sr = srunner_create (s);
3337
srunner_run_all (sr, CK_NORMAL);
3438
number_failed = srunner_ntests_failed (sr);
3539
srunner_free (sr);
40+
41+
s = vcf_suite ();
42+
sr = srunner_create (s);
43+
srunner_run_all (sr, CK_NORMAL);
44+
number_failed += srunner_ntests_failed (sr);
45+
srunner_free (sr);
46+
3647
return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
3748
}

0 commit comments

Comments
 (0)