@@ -111,9 +111,9 @@ def test_perfect___process(bed_class):
111111 )
112112
113113
114- def test_includeinpanel___process (bed_class ):
114+ def test__process_input_contains_includeinpanel (bed_class ):
115115 """
116- Make sure includeInPanel column is propogated and
116+ Make sure includeInPanel column is propogated if included in input and
117117 intergenic region is captured
118118 """
119119
@@ -157,6 +157,51 @@ def test_includeinpanel___process(bed_class):
157157 assert_frame_equal (
158158 expected_beddf , new_beddf [expected_beddf .columns ], check_dtype = False
159159 )
160+
161+ def test__process_input_does_not_contain_includeinpanel (bed_class ):
162+ """
163+ Make sure placeholder includeInPanel column is created
164+ """
165+
166+ expected_beddf = pd .DataFrame (
167+ dict (
168+ Chromosome = ["2" , "9" , "12" , "19" ],
169+ Start_Position = [69688432 , 1111 , 53700240 , 44080953 ],
170+ End_Position = [69689532 , 1111 , 53719548 , 44084624 ],
171+ Hugo_Symbol = ["AAK1" , float ("nan" ), "AAAS" , float ("nan" )],
172+ includeInPanel = [True , True , True , True ],
173+ clinicalReported = [float ("nan" )] * 4 ,
174+ ID = ["foo" , "bar" , "baz" , "boo" ],
175+ SEQ_ASSAY_ID = ["SAGE-TEST" , "SAGE-TEST" , "SAGE-TEST" , "SAGE-TEST" ],
176+ Feature_Type = ["exon" , "intergenic" , "exon" , "exon" ],
177+ CENTER = ["SAGE" , "SAGE" , "SAGE" , "SAGE" ],
178+ )
179+ )
180+
181+ expected_beddf .sort_values ("Chromosome" , inplace = True )
182+ expected_beddf .reset_index (drop = True , inplace = True )
183+
184+ # symbols that can't be map should be null,
185+ # includeInPanel column should be included if it exists
186+ beddf = pd .DataFrame (
187+ {
188+ 0 : ["2" , "9" , "12" , "19" ],
189+ 1 : [69688432 , 1111 , 53700240 , 44080953 ],
190+ 2 : [69689532 , 1111 , 53719548 , 44084624 ],
191+ 3 : ["foo" , "bar" , "baz" , "boo" ],
192+ }
193+ )
194+ with patch .object (
195+ genie_registry .bed , "create_gtf" , return_value = (EXON_TEMP .name , GENE_TEMP .name )
196+ ):
197+ new_beddf = bed_class ._process (
198+ beddf , seq_assay_id , new_path , parentid , create_panel = False
199+ )
200+ new_beddf .sort_values ("Chromosome" , inplace = True )
201+ new_beddf .reset_index (drop = True , inplace = True )
202+ assert_frame_equal (
203+ expected_beddf , new_beddf [expected_beddf .columns ], check_dtype = False
204+ )
160205
161206
162207def test_clinicalreport___process (bed_class ):
0 commit comments