diff --git a/R/survival_cut_cox_km.R b/R/survival_cut_cox_km.R index 475e67a..a5a26fb 100644 --- a/R/survival_cut_cox_km.R +++ b/R/survival_cut_cox_km.R @@ -35,8 +35,8 @@ point_cut <- function(exprSet_hub,meta){ ##' caculate log_rank test p values for genes ##' ##' @inheritParams point_cut +##' @inheritParams t_choose ##' @param cut.point logical , use cut_point or not, if FALSE,use median by defult -##' @param pvalue_cutoff p value cut off ,0.05 by defult ##' @importFrom survival Surv ##' @importFrom survival survdiff ##' @export diff --git a/R/t_choose.R b/R/t_choose.R index 8558009..3c2a94e 100644 --- a/R/t_choose.R +++ b/R/t_choose.R @@ -6,6 +6,7 @@ ##' @param genes a vector with some genes ##' @param up_only keep up genes in the result only ##' @param down_only keep down genes in the result only +##' @param pvalue_cutoff p value cut off ,0.05 by defult ##' @export ##' @return a vector with diffrencial expressed genes ##' @author Xiaojie Sun @@ -23,7 +24,8 @@ ##' \code{\link{geo_download}};\code{\link{draw_volcano}};\code{\link{draw_venn}} -t_choose <- function(genes,exp,group_list,up_only = F,down_only = F){ +t_choose <- function(genes,exp,group_list,up_only = F,down_only = F,pvalue_cutoff = 0.05){ + if(up_only&down_only)stop("please change neither up_only or down_only to FALSE") table(genes %in% rownames(exp)) exp_small = exp[rownames(exp) %in% genes,] dat = data.frame(t(exp_small)) @@ -32,15 +34,15 @@ t_choose <- function(genes,exp,group_list,up_only = F,down_only = F){ t.test(dat[,i] ~group_list)$p.value }) names(p_v) = colnames(dat)[-ncol(dat)] - table(p_v<0.05) - exp_genes = names(p_v[p_v < 0.05]) + table(p_v0 return(k) }) - up_genes = genes[p_v <0.05 & es_up] + up_genes = genes[p_v