Skip to content

Commit b9d50f4

Browse files
Feature/leeds crc new (#166)
* Updates to run two leeds hanlder pre and post 2025 * Leeds colorectal new handler FS * reverting removal of TACSTD1 as Birmingham uses it * Targ rules coded * rubocop fix for safenavigation * genes_panel method rubocopped * More rubocop fixes * tests added * fixed cdna regex * populating variantgenotype in table * more refinements * rubocop fixes * more rubocop fixes * rubocop fixes * Pr Review comment done on versioning the handlers * Remove older test files * Alignment fixed * Fix broken tests
1 parent 1dc6669 commit b9d50f4

11 files changed

Lines changed: 970 additions & 25 deletions

File tree

lib/import/brca/providers/leeds/leeds_handler_new_format.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ def classify_variant_pathogenicity(variantpathclass)
384384
end
385385

386386
def classify_protein_impact
387-
require 'pry'
388387
case @value1
389388
when /C1/
390389
1

lib/import/brca/scripts/bash/Import_all_brca_interactive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ MBIS=$1
5454
PROV='RR8'
5555
IFS=$'\n'
5656
for x in $(find $DIRPATH/$FILEPATH -path "*/$PROV/*" -type f \
57-
\( -name "*BRCA*.pseudo" -o -type f -name "*Other*.pseudo" \) \
57+
\( -name "*BRCA*.pseudo" -o -type f -iname "*Other*.pseudo" \) \
5858
\( -path "*/202[5-9]/*" -o -path "*/203[0-9]/*" \) \
5959
! -name "bede6d1385c0ae9db4fe61fe9b07d58f86e2dc60_24.11.2021 to 31.03.2025_BRCA_DATA__2021_11_24__to__2025_03_31_b.xlsx.pseudo")
6060
do

lib/import/colorectal/core/colorectal_handler_mapping.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module Core
44
# Provides the handler appropriate for the dataformat from each center
55
class ColorectalHandlerMapping
66
HANDLER_MAPPING = {
7-
'RR8' => Import::Colorectal::Providers::Leeds::LeedsHandlerColorectal,
7+
'RR8_V1_PRE2025' => Import::Colorectal::Providers::Leeds::LeedsHandlerColorectalV1,
8+
'RR8_V2_POST2025' => Import::Colorectal::Providers::Leeds::LeedsHandlerColorectalV2,
89
'RNZ' => Import::Colorectal::Providers::Salisbury::SalisburyHandlerColorectal,
910
'RTD' => Import::Colorectal::Providers::Newcastle::NewcastleHandlerColorectal,
1011
'RX1' => Import::Colorectal::Providers::Nottingham::NottinghamHandlerColorectal,

lib/import/colorectal/core/genocolorectal.rb

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,16 @@ class Genocolorectal < Import::Germline::Genotype
1616
#--------------------- Schema code mapping tables --------------------------
1717

1818
COLORECTAL_MAP = { 'APC' => 358,
19+
'BAP1' => 517,
1920
'BMPR1A' => 577,
2021
'EPCAM' => 1432,
21-
'TACSTD1' => 1432,
22+
'TACSTD1' => 1432, #Old symbol for EPCAM
23+
'FH' => 1590,
24+
'FLCN' => 1603,
25+
'MET' => 50,
2226
'MLH1' => 2744,
2327
'MSH2' => 2804,
28+
'MSH3' => 2805,
2429
'MSH6' => 2808,
2530
'MUTYH' => 2850,
2631
'PMS2' => 3394,
@@ -42,14 +47,21 @@ class Genocolorectal < Import::Germline::Genotype
4247
'RAD51D' => 3616,
4348
'VHL' => 83,
4449
'ATM' => 451,
45-
'SCG5' => 5092 }.freeze
50+
'SCG5' => 5092,
51+
'SDHB' => 68
52+
}.freeze
4653

4754
COLORECTAL_REGEX = /(?<apc>APC)|
55+
(?<bap1>BAP1)|
4856
(?<bmpr>BMPR1A)|
4957
(?<epcam>EPCAM)|
50-
(?<tacstd1>TACSTD1)|
58+
(?<tacstd1>TACSTD1)| #Old symbol for EPCAM
59+
(?<fh>FH)|
60+
(?<flcn>FLCN)|
61+
(?<met>MET)|
5162
(?<mlh1>MLH1)|
5263
(?<msh2>MSH2)|
64+
(?<msh3>MSH3)|
5365
(?<msh6>MSH6)|
5466
(?<mutyh>MUTYH)|
5567
(?<pms2>PMS2)|
@@ -71,15 +83,16 @@ class Genocolorectal < Import::Germline::Genotype
7183
(?<rad51d>RAD51D)|
7284
(?<vhl>VHL) |
7385
(?<atm>ATM) |
74-
(?<scg5>SCG5)/ix # Added by Francesco
86+
(?<scg5>SCG5)|
87+
(?<sdhb>SDHB)/ix # Added by Francesco
7588

7689
# ------------------------ Interogators ------------------------------
7790

7891
def add_gene_colorectal(colorectal_input)
7992
case colorectal_input
8093
when Integer
81-
if [1432, 358, 577, 2744, 2804, 2808, 2850, 3394, 7, 8, 79, 3186, 5019,
82-
3408, 5000, 62, 72, 76, 1882, 3108, 794, 83, 5019, 451].include? colorectal_input
94+
if [1432, 358, 517, 577, 2744, 2804, 2805, 2808, 2850, 3394, 7, 8, 79, 3186, 5019, 1603, 50, 68,
95+
3408, 5000, 62, 72, 76, 1882, 3108, 794, 83, 5019, 451, 1590, 5092].include? colorectal_input
8396

8497
@attribute_map['gene'] = colorectal_input
8598
@logger.debug "SUCCESSFUL gene parse for #{colorectal_input}"

lib/import/colorectal/providers/leeds/leeds_handler_colorectal.rb renamed to lib/import/colorectal/providers/leeds/leeds_handler_colorectal_v1.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ module Colorectal
33
module Providers
44
module Leeds
55
# rubocop:disable Metrics/ClassLength
6-
# Leeds importer for colorectal
7-
class LeedsHandlerColorectal < Import::Germline::ProviderHandler
6+
# Leeds importer for colorectal (pre-2025 format)
7+
class LeedsHandlerColorectalV1 < Import::Germline::ProviderHandler
88
include Import::Helpers::Colorectal::Providers::Rr8::Constants
99

1010
def initialize(batch)
@@ -53,6 +53,9 @@ def populate_and_persist_genotype(record)
5353
add_varclass
5454
add_organisationcode_testresult(genocolorectal)
5555
res = process_variants_from_record(genocolorectal, record)
56+
# correcting ebatch provider and registry to RR8 (from RR8_V1_PRE2025) to allow data to persist in the database
57+
@batch.provider = 'RR8'
58+
@batch.registryid = 'RR8'
5659
res.map { |cur_genotype| @persister.integrate_and_store(cur_genotype) }
5760
end
5861

0 commit comments

Comments
 (0)