Skip to content

Commit

Permalink
Finishing to clean functions with old TCGAquery_clinic
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagochst committed Nov 13, 2016
1 parent 62e1a69 commit f40a068
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 26 deletions.
4 changes: 1 addition & 3 deletions R/TCGAanalyze.R
Original file line number Diff line number Diff line change
Expand Up @@ -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){

Expand Down
18 changes: 0 additions & 18 deletions R/TCGAquery_clinical.R
Original file line number Diff line number Diff line change
Expand Up @@ -516,31 +516,13 @@ 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
#' This function will return the samples that matches all filters.
#' 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"
Expand Down
4 changes: 1 addition & 3 deletions man/TCGAanalyze_SurvivalKM.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions man/TCGAquery_clinicFilt.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f40a068

Please sign in to comment.