From f40a068a3551df8ace8885ba1eb999af061d96ff Mon Sep 17 00:00:00 2001 From: tiagochst Date: Sun, 13 Nov 2016 20:00:03 -0200 Subject: [PATCH] Finishing to clean functions with old TCGAquery_clinic --- R/TCGAanalyze.R | 4 +--- R/TCGAquery_clinical.R | 18 ------------------ man/TCGAanalyze_SurvivalKM.Rd | 4 +--- man/TCGAquery_clinicFilt.Rd | 3 +-- 4 files changed, 3 insertions(+), 26 deletions(-) diff --git a/R/TCGAanalyze.R b/R/TCGAanalyze.R index 62bbda9f0..12a7c1602 100644 --- a/R/TCGAanalyze.R +++ b/R/TCGAanalyze.R @@ -168,14 +168,12 @@ TCGAanalyze_Preprocessing <- function(object, #' @export #' @return table with survival genes pvalues from KM. #' @examples -#' \dontrun{ -#' clinical_patient_Cancer <- TCGAquery_clinic("brca","clinical_patient") +#' clinical_patient_Cancer <- GDCquery_clinic("TCGA-BRCA","clinical") #' dataBRCAcomplete <- log2(BRCA_rnaseqv2) #' # Selecting only 10 genes for example #' dataBRCAcomplete <- dataBRCAcomplete[1:10,] #' tabSurvKM<-TCGAanalyze_SurvivalKM(clinical_patient_Cancer,dataBRCAcomplete, #' Genelist = rownames(dataBRCAcomplete), Survresult = FALSE,ThreshTop=0.67,ThreshDown=0.33) -#' } TCGAanalyze_SurvivalKM<-function(clinical_patient,dataGE,Genelist, Survresult, ThreshTop=0.67, ThreshDown=0.33,p.cut=0.05){ diff --git a/R/TCGAquery_clinical.R b/R/TCGAquery_clinical.R index fb9945855..d72b34097 100644 --- a/R/TCGAquery_clinical.R +++ b/R/TCGAquery_clinical.R @@ -516,23 +516,6 @@ parseXML <- function(files, xpath, clinical.info ){ return(clin) } -update.clinical.with.last.followup <- function(clin){ - - for(disease in unique(clin$disease)){ - aux <- clinical.table[,disease] - files <- rownames(clinical.table[which(aux==1),]) - # get last follow up files not nte - files <- sort(files[grepl("follow",files) & !grepl("nte",files)],decreasing = T)[1] - - follow <- TCGAquery_clinic(disease,files) - - colnames(follow) [colnames(follow) %in% colnames(clin)] - aux <- plyr::ddply(follow, .(bcr_patient_barcode), function(x) x[c(nrow(x)), ]) - aux <- aux[aux$bcr_patient_barcode %in% clin$bcr_patient_barcode,colnames(aux) %in% colnames(clin)] - clin[na.omit(match(aux$bcr_patient_barcode,clin$bcr_patient_barcode)),match(colnames(aux),colnames(clin))] <- aux - } - return(clin) -} #' @title Filter samples using clinical data #' @description @@ -540,7 +523,6 @@ update.clinical.with.last.followup <- function(clin){ #' Filters available: HER, ER,gender,PR, stage. #' @param barcode List of barcodes #' @param clinical_patient_data clinical_patient_data obtained with clinic function -#' Ex: clinical_patient_data <- TCGAquery_clinic("LGG","clinical_patient") #' @param HER her2 neu immunohistochemistry receptor status: "Positive" or "Negative" #' @param gender "MALE" or "FEMALE" #' @param PR Progesterone receptor status: "Positive" or "Negative" diff --git a/man/TCGAanalyze_SurvivalKM.Rd b/man/TCGAanalyze_SurvivalKM.Rd index b64c67a28..821e2289b 100644 --- a/man/TCGAanalyze_SurvivalKM.Rd +++ b/man/TCGAanalyze_SurvivalKM.Rd @@ -45,13 +45,11 @@ from survival package } } \examples{ -\dontrun{ - clinical_patient_Cancer <- TCGAquery_clinic("brca","clinical_patient") + clinical_patient_Cancer <- GDCquery_clinic("TCGA-BRCA","clinical") dataBRCAcomplete <- log2(BRCA_rnaseqv2) # Selecting only 10 genes for example dataBRCAcomplete <- dataBRCAcomplete[1:10,] tabSurvKM<-TCGAanalyze_SurvivalKM(clinical_patient_Cancer,dataBRCAcomplete, Genelist = rownames(dataBRCAcomplete), Survresult = FALSE,ThreshTop=0.67,ThreshDown=0.33) } -} diff --git a/man/TCGAquery_clinicFilt.Rd b/man/TCGAquery_clinicFilt.Rd index fe59374c8..a5f4f4bc5 100644 --- a/man/TCGAquery_clinicFilt.Rd +++ b/man/TCGAquery_clinicFilt.Rd @@ -10,8 +10,7 @@ TCGAquery_clinicFilt(barcode, clinical_patient_data, HER = NULL, ER = NULL, \arguments{ \item{barcode}{List of barcodes} -\item{clinical_patient_data}{clinical_patient_data obtained with clinic function -Ex: clinical_patient_data <- TCGAquery_clinic("LGG","clinical_patient")} +\item{clinical_patient_data}{clinical_patient_data obtained with clinic function} \item{HER}{her2 neu immunohistochemistry receptor status: "Positive" or "Negative"}