@@ -16,6 +16,9 @@ def setup
1616 @record . raw_fields [ 'moleculartestingtype' ] = 'RNA studies'
1717 @handler . process_genetictestscope ( @genotype , @record )
1818 assert_equal 'Unable to assign Colorectal Lynch or MMR genetictestscope' , @genotype . attribute_map [ 'genetictestscope' ]
19+ @record . raw_fields [ 'moleculartestingtype' ] = 'Mainstreaming'
20+ @handler . process_genetictestscope ( @genotype , @record )
21+ assert_equal 'Full screen Colorectal Lynch or MMR' , @genotype . attribute_map [ 'genetictestscope' ]
1922 end
2023
2124 test 'process_multiple_tests_from_fullscreen' do
@@ -176,6 +179,121 @@ def setup
176179 assert_equal 62 , genocolorectals [ 0 ] . attribute_map [ 'gene' ]
177180 end
178181
182+ test 'process_variants_from_report_new_pc_indication_two_genes' do
183+ # where 2 genes are indicated in the report field
184+ pathogenic_record = build_raw_record ( 'pseudo_id1' => 'bob' )
185+ pathogenic_record . raw_fields [ 'indication' ] = 'PC'
186+ pathogenic_record . raw_fields [ 'report' ] = 'Next Generation Sequencing of coding regions in BRCA1 (NM_007294.4) and BRCA2 (NM_000059.3) (Illumina TruSight Hereditary Cancer Panel)'
187+ pathogenic_record . raw_fields [ 'overall2' ] = 'Pathogenic'
188+ pathogenic_record . raw_fields [ 'teststatus' ] = 'Heterozygous pathogenic variant c.1234_5678del p.(Asn1234Lysfs*3) identified in the BRCA2 gene in germline blood DNA'
189+ processor = variant_processor_for ( pathogenic_record )
190+ genocolorectals = processor . process_variants_from_report
191+ assert_equal 1 , genocolorectals [ 0 ] . attribute_map [ 'teststatus' ]
192+ assert_equal 7 , genocolorectals [ 0 ] . attribute_map [ 'gene' ]
193+ assert_equal 2 , genocolorectals [ 1 ] . attribute_map [ 'teststatus' ]
194+ assert_equal 'p.Asn1234LysfsTer3' , genocolorectals [ 1 ] . attribute_map [ 'proteinimpact' ]
195+ assert_equal 'c.1234_5678delp' , genocolorectals [ 1 ] . attribute_map [ 'codingdnasequencechange' ]
196+ assert_equal 8 , genocolorectals [ 1 ] . attribute_map [ 'gene' ]
197+
198+ normal_record = build_raw_record ( 'pseudo_id1' => 'bob' )
199+ normal_record . raw_fields [ 'indication' ] = 'PC'
200+ normal_record . raw_fields [ 'report' ] = 'Next Generation Sequencing of coding regions in BRCA1 (NM_007294.4) and BRCA2 (NM_000059.3) (Illumina TruSight Hereditary Cancer Panel)'
201+ normal_record . raw_fields [ 'overall2' ] = 'Normal'
202+ normal_record . raw_fields [ 'teststatus' ] = 'No evidence of a pathogenic variant in BRCA1 or BRCA2'
203+ processor = variant_processor_for ( normal_record )
204+ genocolorectals2 = processor . process_variants_from_report
205+ assert_equal 1 , genocolorectals2 [ 0 ] . attribute_map [ 'teststatus' ]
206+ assert_equal 7 , genocolorectals2 [ 0 ] . attribute_map [ 'gene' ]
207+ assert_equal 1 , genocolorectals2 [ 1 ] . attribute_map [ 'teststatus' ]
208+ assert_equal 8 , genocolorectals2 [ 1 ] . attribute_map [ 'gene' ]
209+ end
210+
211+ test 'process_variants_from_report_new_pc_indication_8_standard_genes' do
212+ # where 8 genes are indicated in the report field
213+ normal_record = build_raw_record ( 'pseudo_id1' => 'bob' )
214+ normal_record . raw_fields [ 'indication' ] = 'PC'
215+ normal_record . raw_fields [ 'report' ] = 'Next Generation Sequencing of coding regions in ATM (NM_000051.3), BRCA1 (NM_007294.4),
216+ BRCA2 (NM_000059.3), CHEK2 exons 2-10 plus codon 367 (NM_007194.4), MLH1 (NM_000249.4),
217+ MSH2 (NM_000251.3), MSH6 (NM_000179.3) and PALB2 (NM_024675.4) (Illumina TruSight Hereditary Cancer Panel)'
218+ normal_record . raw_fields [ 'overall2' ] = 'Normal'
219+ normal_record . raw_fields [ 'teststatus' ] = 'No evidence of a pathogenic variant in BRCA1, BRCA2, MLH1, MSH2, MSH6 or PALB2.'
220+ processor = variant_processor_for ( normal_record )
221+ genocolorectals = processor . process_variants_from_report
222+ assert_equal 8 , genocolorectals . size
223+ assert ( genocolorectals . all? { |g | g . attribute_map [ 'teststatus' ] == 1 } )
224+
225+ normal_record = build_raw_record ( 'pseudo_id1' => 'bob' )
226+ normal_record . raw_fields [ 'indication' ] = 'PC'
227+ normal_record . raw_fields [ 'report' ] = 'Next Generation Sequencing of coding regions in ATM (NM_000051.3), BRCA1 (NM_007294.4),
228+ BRCA2 (NM_000059.3), CHEK2 exons 2-10 plus codon 367 (NM_007194.4), MLH1 (NM_000249.4),
229+ MSH2 (NM_000251.3), MSH6 (NM_000179.3) and PALB2 (NM_024675.4) (Illumina TruSight Hereditary Cancer Panel)'
230+ normal_record . raw_fields [ 'overall2' ] = 'Normal'
231+ normal_record . raw_fields [ 'teststatus' ] = 'HHeterozygous pathogenic variant c.1447C>T p.(Gln483*) identified in the MLH1 gene.'
232+ processor = variant_processor_for ( normal_record )
233+ genocolorectals2 = processor . process_variants_from_report
234+ assert_equal 8 , genocolorectals2 . size
235+ assert_equal 1 , genocolorectals2 [ 4 ] . attribute_map [ 'teststatus' ]
236+ assert_nil genocolorectals2 [ 4 ] . attribute_map [ 'codingdnasequencechange' ]
237+ assert_nil genocolorectals2 [ 4 ] . attribute_map [ 'proteinimpact' ]
238+ assert_equal 2744 , genocolorectals2 [ 4 ] . attribute_map [ 'gene' ]
239+ end
240+
241+ test 'process_variants_from_report_new_pc_indication_nine_genes' do
242+ # where 9 genes are indicated in the report field
243+ uv_record = build_raw_record ( 'pseudo_id1' => 'bob' )
244+ uv_record . raw_fields [ 'indication' ] = 'PC'
245+ uv_record . raw_fields [ 'overall2' ] = 'UV'
246+ uv_record . raw_fields [ 'report' ] = 'Next Generation Sequencing of coding regions in ATM (NM_000051.3), BRCA1 (NM_007294.4),
247+ BRCA2 (NM_000059.3), CHEK2 exons 2-10 plus codon 367 (NM_007194.4), MLH1 (NM_000249.4),
248+ MSH2 (NM_000251.3), MSH6 (NM_000179.3) and PALB2 (NM_024675.4). MLPA of EPCAM.'
249+ uv_record . raw_fields [ 'teststatus' ] = 'Heterozygous inframe deletion variant of uncertain significance c.12_34del p.(Asp12_Leu17del) detected in the MLH1 gene'
250+ processor = variant_processor_for ( uv_record )
251+ genocolorectals = processor . process_variants_from_report
252+ assert_equal 9 , genocolorectals . size
253+ assert_equal 2744 , genocolorectals [ 8 ] . attribute_map [ 'gene' ]
254+ assert_equal 2 , genocolorectals [ 8 ] . attribute_map [ 'teststatus' ]
255+ assert_equal 3 , genocolorectals [ 8 ] . attribute_map [ 'variantpathclass' ]
256+ assert_equal 'c.12_34delp' , genocolorectals [ 8 ] . attribute_map [ 'codingdnasequencechange' ]
257+
258+ normal_record = build_raw_record ( 'pseudo_id1' => 'bob' )
259+ normal_record . raw_fields [ 'indication' ] = 'PC'
260+ normal_record . raw_fields [ 'overall2' ] = 'Normal'
261+ normal_record . raw_fields [ 'report' ] = 'Next Generation Sequencing of coding regions in ATM (NM_000051.3), BRCA1 (NM_007294.4),
262+ BRCA2 (NM_000059.3), CHEK2 exons 2-10 plus codon 367 (NM_007194.4), MLH1 (NM_000249.4),
263+ MSH2 (NM_000251.3), MSH6 (NM_000179.3) and PALB2 (NM_024675.4). MLPA of EPCAM.'
264+ normal_record . raw_fields [ 'teststatus' ] = 'No evidence of a pathogenic variant in BRCA1, BRCA2, MLH1, MSH2, MSH6 or PALB2.'
265+ processor = variant_processor_for ( normal_record )
266+ genocolorectals = processor . process_variants_from_report
267+ assert_equal 9 , genocolorectals . size
268+ assert ( genocolorectals . all? { |g | g . attribute_map [ 'teststatus' ] == 1 } )
269+ end
270+
271+
272+ test 'process_variants_from_report_new_bap1_indication' do
273+ pathogenic_record = build_raw_record ( 'pseudo_id1' => 'bob' )
274+ pathogenic_record . raw_fields [ 'indication' ] = 'BAP1'
275+ pathogenic_record . raw_fields [ 'report' ] = 'Sanger sequencing analysis was used to detect the familial variant in the BAP1 gene. '
276+ pathogenic_record . raw_fields [ 'overall2' ] = 'Pathogenic'
277+ pathogenic_record . raw_fields [ 'teststatus' ] = 'Molecular analysis shows the presence of the familial pathogenic variant c.123-1G>A in the BAP1 gene'
278+ processor = variant_processor_for ( pathogenic_record )
279+ genocolorectal = processor . process_variants_from_report
280+ assert_equal 1 , genocolorectal . size
281+ assert_equal 2 , genocolorectal [ 0 ] . attribute_map [ 'teststatus' ]
282+ assert_equal 'c.123-1G>A' , genocolorectal [ 0 ] . attribute_map [ 'codingdnasequencechange' ]
283+ assert_equal 517 , genocolorectal [ 0 ] . attribute_map [ 'gene' ]
284+
285+ normal_record = build_raw_record ( 'pseudo_id1' => 'bob' )
286+ normal_record . raw_fields [ 'indication' ] = 'BAP1'
287+ normal_record . raw_fields [ 'report' ] = 'Next Generation Sequencing of coding regions in BAP1 (NM_004656.4) (Illumina TruSight Hereditary Cancer Panel'
288+ normal_record . raw_fields [ 'overall2' ] = 'Normal'
289+ normal_record . raw_fields [ 'teststatus' ] = 'Molecular analysis shows no evidence of the familial pathogenic variant in the BAP1 gene'
290+ processor = variant_processor_for ( normal_record )
291+ genocolorectal2 = processor . process_variants_from_report
292+ assert_equal 1 , genocolorectal2 . size
293+ assert_equal 1 , genocolorectal2 [ 0 ] . attribute_map [ 'teststatus' ]
294+ assert_equal 517 , genocolorectal2 [ 0 ] . attribute_map [ 'gene' ]
295+ end
296+
179297 private
180298
181299 def variant_processor_for ( record )
0 commit comments