Browse code

Momentary fix for issue #616. TARGET-NBL DNA methylation cases has a suffix that is breaking the match. Is this the same for all platforms ?

Tiago Silva authored on 25/01/2024 17:19:40
Showing 1 changed files

... ...
@@ -945,7 +945,9 @@ readDNAmethylation <- function(
945 945
 }
946 946
 
947 947
 # Barcode example MMRF_1358_1_BM_CD138pos_T1_TSMRU_L02337
948
-colDataPrepareMMRF <- function(barcode){
948
+colDataPrepareMMRF <- function(
949
+        barcode
950
+){
949 951
     DataFrame(
950 952
         barcode = barcode,
951 953
         sample = barcode,
... ...
@@ -953,8 +955,9 @@ colDataPrepareMMRF <- function(barcode){
953 955
     )
954 956
 }
955 957
 
956
-colDataPrepareTARGET <- function(barcode){
957
-
958
+colDataPrepareTARGET <- function(
959
+        barcode
960
+){
958 961
 
959 962
     message("Adding description to TARGET samples")
960 963
     tissue.code <- c(
... ...
@@ -1281,6 +1284,14 @@ colDataPrepare <- function(barcode){
1281 1284
 
1282 1285
     if(any(ret$project_id %in% c("CMI-MBC","TARGET-NBL"),na.rm = T)) {
1283 1286
         idx <- match(barcode,ret$bcr_patient_barcode)
1287
+        # Workaround for the moment, still need to understand the barcode (cases)
1288
+        # is TARGET-30-PAPKXS-01A-01D and not TARGET-30-PAPKXS-01A
1289
+        if(all(is.na(idx))){
1290
+            idx <- match(
1291
+                stringr::str_sub(barcode,1,unique(stringr::str_length(ret$bcr_patient_barcode))),
1292
+                ret$bcr_patient_barcode
1293
+            )
1294
+        }
1284 1295
     }
1285 1296
 
1286 1297