Skip to content

Commit fb6af9f

Browse files
Updates to catch new genotype str (#179)
1 parent 13d5211 commit fb6af9f

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

lib/import/brca/providers/sheffield/sheffield_handler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,12 +391,12 @@ def process_fullscreen_records(genotype, record, genotypes)
391391
genotype_str = record.raw_fields['genotype']
392392
if mlpa_fail?(record)
393393
process_mlpa_fail_full_screen(genotype, record, genotypes)
394+
elsif positive_cdna?(genotype_str) || positive_exonvariant?(genotype_str)
395+
process_variant_fs_records(genotype, record, genotypes)
394396
elsif normal?(record)
395397
process_normal_full_screen(genotype, record, genotypes)
396398
elsif failed_test?(record)
397399
process_failed_full_screen(genotype, record, genotypes)
398-
elsif positive_cdna?(genotype_str) || positive_exonvariant?(genotype_str)
399-
process_variant_fs_records(genotype, record, genotypes)
400400
else
401401
# else give a test status of 4 (unknown)
402402
add_other_genes_with_status(@genes_set, genotype, genotypes, 4)

lib/import/helpers/brca/providers/rcu/rcu_constants.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ module RcuConstants
246246
([a-z\s]+(?<mutationtype>del(etion)?|duplicati?on|dup(licated)?))?/ix
247247

248248
NORMAL_VAR_REGEX = %r{(?<not>no|not)[a-z /]+
249-
(?<det>detect|report|detet|mutation)+}ix
249+
(?<det>detect|report|detet|mutation|identified)+}ix
250250
# rubocop:enable Lint/MixedRegexpCaptureTypes
251251
end
252252
end

test/lib/import/brca/providers/sheffield/sheffield_handler_test.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,24 @@ def setup
293293
assert_equal 'Targeted BRCA mutation test', genotypes[0].attribute_map['genetictestscope']
294294
end
295295

296+
test 'normal_full_screen_not_identified_case' do
297+
normal_fs_not_identfied_record = build_raw_record('pseudo_id1' => 'bob')
298+
normal_fs_not_identfied_record.raw_fields['genetictestscope'] = 'R208 :: BRCA1 and BRCA2 testing at high familial risk'
299+
normal_fs_not_identfied_record.raw_fields['karyotypingmethod'] = 'R208.1 :: NGS in Leeds'
300+
normal_fs_not_identfied_record.raw_fields['genotype'] = 'A hereditary (germline) genetic cause for this individual’s cancer has not been identified;'
301+
@handler.add_test_scope_from_geno_karyo(@genotype, normal_fs_not_identfied_record)
302+
genotypes = @handler.process_variants_from_record(@genotype, normal_fs_not_identfied_record)
303+
assert_equal 3, genotypes.size
304+
assert_equal 1, genotypes[0].attribute_map['teststatus']
305+
assert_equal 1, genotypes[1].attribute_map['teststatus']
306+
assert_equal 1, genotypes[2].attribute_map['teststatus']
307+
assert_equal 7, genotypes[0].attribute_map['gene']
308+
assert_equal 8, genotypes[1].attribute_map['gene']
309+
assert_equal 3186, genotypes[2].attribute_map['gene']
310+
assert_nil genotypes[0].attribute_map['proteinimpact']
311+
assert_nil genotypes[1].attribute_map['codingdnasequencechange']
312+
end
313+
296314
private
297315

298316
def clinical_json

0 commit comments

Comments
 (0)