@@ -19,6 +19,7 @@ def setUp(self):
1919 self .dgva_input_file = os .path .join (self .input_folder_parent , "etc" ,"dgvaINFOattributes.tsv" )
2020 self .gvf_input_file = os .path .join (self .input_folder_parent , "etc" ,"gvfINFOattributes.tsv" )
2121 self .output_file = os .path .join (input_folder , "input" , "a.vcf" )
22+ self .assembly = os .path .join (input_folder , "input" , "zebrafish.fa" )
2223
2324 def test_read_in_gvf_file (self ):
2425 gvf_pragmas , gvf_non_essential , gvf_lines_obj_list = read_in_gvf_file (self .input_file )
@@ -38,6 +39,7 @@ def test_gvf_features_to_vcf_objects(self):
3839 gvf_pragmas , gvf_non_essential , gvf_lines_obj_list = read_in_gvf_file (self .input_file )
3940 dgva_attribute_dict = read_dgva_info_attributes (self .dgva_input_file )
4041 gvf_attribute_dict = read_gvf_info_attributes (self .gvf_input_file )
42+ assembly_file = self .assembly
4143 # custom meta-information lines for this VCF file
4244 lines_custom_structured = []
4345 lines_custom_unstructured = []
@@ -53,7 +55,9 @@ def test_gvf_features_to_vcf_objects(self):
5355 all_possible_FORMAT_lines = generate_all_possible_standard_structured_format_lines ()
5456
5557 vcf_data_lines , list_of_vcf_objects = gvf_features_to_vcf_objects (gvf_lines_obj_list , dgva_attribute_dict ,
56- gvf_attribute_dict , lines_custom_structured ,
58+ gvf_attribute_dict ,
59+ assembly_file ,
60+ lines_custom_structured ,
5761 lines_standard_ALT , lines_standard_INFO ,
5862 lines_standard_FILTER , lines_standard_FORMAT ,
5963 all_possible_ALT_lines ,
@@ -65,12 +69,13 @@ def test_gvf_features_to_vcf_objects(self):
6569 assert len (list_of_vcf_objects ) > 1
6670
6771 def test_get_ref (self ):
68- gvf_feature_line = "1 DGVa copy_number_loss 776614 786127 . + . ID=1;Name=nssv1412199;Alias=CNV28955;variant_call_so_id=SO:0001743;parent=nsv811094;Start_range=.,776614;End_range=786127,.;submitter_variant_call_id=CNV28955;sample_name=Wilds2-3;remap_score=.98857;Variant_seq=."
72+ gvf_feature_line = "chromosome1 DGVa copy_number_loss 77 78 . + . ID=1;Name=nssv1412199;Alias=CNV28955;variant_call_so_id=SO:0001743;parent=nsv811094;Start_range=.,776614;End_range=786127,.;submitter_variant_call_id=CNV28955;sample_name=Wilds2-3;remap_score=.98857;Variant_seq=."
6973 f_list = gvf_feature_line .split ("\t " )
7074 line_object = GvfFeatureline (f_list [0 ], f_list [1 ], f_list [2 ], f_list [3 ], f_list [4 ], f_list [5 ], f_list [6 ], f_list [7 ], f_list [8 ])
7175 gvf_pragmas , gvf_non_essential , gvf_lines_obj_list = read_in_gvf_file (self .input_file )
7276 dgva_attribute_dict = read_dgva_info_attributes (self .dgva_input_file )
7377 gvf_attribute_dict = read_gvf_info_attributes (self .gvf_input_file )
78+ assembly_file = self .assembly
7479 # custom meta-information lines for this VCF file
7580 lines_custom_structured = []
7681 lines_custom_unstructured = []
@@ -88,6 +93,7 @@ def test_get_ref(self):
8893 v = VcfLine (line_object ,
8994 dgva_attribute_dict ,
9095 gvf_attribute_dict ,
96+ assembly_file ,
9197 lines_custom_structured ,
9298 lines_standard_ALT ,
9399 lines_standard_INFO ,
@@ -98,12 +104,13 @@ def test_get_ref(self):
98104 all_possible_FILTER_lines ,
99105 all_possible_FORMAT_lines )
100106 reference_allele = v .get_ref ()
101- assert reference_allele == "."
107+ assert len ( reference_allele ) != 0
102108
103109 def test_generate_vcf_metainformation (self ):
104110 gvf_pragmas , gvf_non_essential , gvf_lines_obj_list = read_in_gvf_file (self .input_file )
105111 dgva_attribute_dict = read_dgva_info_attributes (self .dgva_input_file )
106112 gvf_attribute_dict = read_gvf_info_attributes (self .gvf_input_file )
113+ assembly_file = self .assembly
107114 # custom meta-information lines for this VCF file
108115 lines_custom_structured = []
109116 lines_custom_unstructured = []
@@ -121,6 +128,7 @@ def test_generate_vcf_metainformation(self):
121128 vcf_data_lines , list_of_vcf_objects = gvf_features_to_vcf_objects (gvf_lines_obj_list ,
122129 dgva_attribute_dict ,
123130 gvf_attribute_dict ,
131+ assembly_file ,
124132 lines_custom_structured ,
125133 lines_standard_ALT ,
126134 lines_standard_INFO ,
@@ -158,6 +166,7 @@ def test_generate_vcf_header_line(self):
158166 vcf_data_lines , list_of_vcf_objects = gvf_features_to_vcf_objects (gvf_lines_obj_list ,
159167 dgva_attribute_dict ,
160168 gvf_attribute_dict ,
169+ self .assembly ,
161170 lines_custom_structured ,
162171 lines_standard_ALT ,
163172 lines_standard_INFO ,
@@ -196,6 +205,7 @@ def test_populate_sample_formats(self):
196205 vcf_data_lines , list_of_vcf_objects = gvf_features_to_vcf_objects (gvf_lines_obj_list ,
197206 dgva_attribute_dict ,
198207 gvf_attribute_dict ,
208+ self .assembly ,
199209 lines_custom_structured ,
200210 lines_standard_ALT ,
201211 lines_standard_INFO ,
@@ -234,6 +244,7 @@ def test_format_sample_values(self):
234244 vcf_data_lines , list_of_vcf_objects = gvf_features_to_vcf_objects (gvf_lines_obj_list ,
235245 dgva_attribute_dict ,
236246 gvf_attribute_dict ,
247+ self .assembly ,
237248 lines_custom_structured ,
238249 lines_standard_ALT ,
239250 lines_standard_INFO ,
@@ -255,6 +266,7 @@ def test_format_vcf_datalines(self):
255266 gvf_pragmas , gvf_non_essential , gvf_lines_obj_list = read_in_gvf_file (self .input_file )
256267 dgva_attribute_dict = read_dgva_info_attributes (self .dgva_input_file )
257268 gvf_attribute_dict = read_gvf_info_attributes (self .gvf_input_file )
269+ assembly_file = self .assembly
258270 # custom meta-information lines for this VCF file
259271 lines_custom_structured = []
260272 lines_custom_unstructured = []
@@ -272,6 +284,7 @@ def test_format_vcf_datalines(self):
272284 vcf_data_lines , list_of_vcf_objects = gvf_features_to_vcf_objects (gvf_lines_obj_list ,
273285 dgva_attribute_dict ,
274286 gvf_attribute_dict ,
287+ assembly_file ,
275288 lines_custom_structured ,
276289 lines_standard_ALT ,
277290 lines_standard_INFO ,
0 commit comments