File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -540,6 +540,22 @@ GDCprepare_clinic <- function(
540
540
clin $ primary_pathology <- NULL
541
541
}
542
542
543
+ # Update clinical data with follow-ups: days_to_last_followup and vital_status
544
+ message(" Updating days_to_last_followup and vital_status from follow_up information using last entry" )
545
+ followup <- parseFollowup(files ,xpath ,clinical.info )
546
+
547
+ followup_last <- followup %> % dplyr :: group_by(bcr_patient_barcode ) %> % dplyr :: summarise(
548
+ days_to_last_followup = max(as.numeric(days_to_last_followup ),na.rm = TRUE ),
549
+ vital_status = vital_status [
550
+ ifelse(
551
+ any(followup $ days_to_last_followup %in% " " ),
552
+ which(followup $ days_to_last_followup %in% " " ),
553
+ which.max(days_to_last_followup )
554
+ )
555
+ ]
556
+ )
557
+ clin $ days_to_last_followup <- followup_last $ days_to_last_followup [match(clin $ bcr_patient_barcode ,followup_last $ bcr_patient_barcode )]
558
+ clin $ vital_status <- followup_last $ vital_status [match(clin $ bcr_patient_barcode ,followup_last $ bcr_patient_barcode )]
543
559
}
544
560
545
561
if (tolower(clinical.info ) == " sample" ) {
You can’t perform that action at this time.
0 commit comments