Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
xjsun1221 committed Sep 5, 2021
1 parent ffc6b15 commit 532b90b
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 13 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ Suggests:
Rtsne
Depends:R (>= 3.5.0)
RoxygenNote: 7.1.1
Language: 1en-US
2 changes: 1 addition & 1 deletion R/1_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ draw_venn <- function(x,name,color = c("#2874C5","#f87669","#e6b707","#868686","
##'
##' @inheritParams draw_pca
##' @param method one of kruskal.test,aov,t.test and wilcox.test
##' @param width wdith of boxplot and error bar
##' @param width width of boxplot and error bar
##' @param sort whether the boxplot will be sorted
##' @param drop whether to discard insignificant values
##' @param pvalue_cutoff if drop = TRUE,genes with p-values below the threshold will be drawn
Expand Down
2 changes: 2 additions & 0 deletions R/2_geo_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
##' @importFrom dplyr %>%
##' @export
##' @examples
##' \dontrun{
##' gse = "GSE42872"
##' a = geo_download(gse,destdir=tempdir())
##' b = geo_download(gse,by_annopbrobe = FALSE,destdir=tempdir())
##' }
##' @seealso
##' \code{\link{find_anno}}

Expand Down
6 changes: 6 additions & 0 deletions R/6_multi_deg_all.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
##' @author Xiaojie Sun
##' @export
##' @examples
##' \dontrun{
##' #two group
##' gse = "GSE42872"
##' geo = geo_download(gse,destdir=tempdir())
Expand All @@ -26,6 +27,7 @@
##' ids = AnnoProbe::idmap(geo$gpl,destdir = tempdir())
##' deg = multi_deg(geo$exp,group_list,ids,adjust = FALSE)
##' cgs = get_cgs(deg)
##' }
##' @seealso
##' \code{\link{geo_download}};\code{\link{draw_volcano}};\code{\link{draw_venn}}

Expand Down Expand Up @@ -62,6 +64,7 @@ get_cgs <- function(deg){
##' @importFrom patchwork plot_layout
##' @export
##' @examples
##' \dontrun{
##' #two group
##' gse = "GSE42872"
##' geo = geo_download(gse,destdir=tempdir())
Expand All @@ -82,6 +85,7 @@ get_cgs <- function(deg){
##' deg = multi_deg(geo$exp,group_list,ids,adjust = FALSE)
##' draw_volcano2(deg)
##' draw_volcano2(deg,color = c("darkgreen","grey","darkred"))
##' }
##' @seealso
##' \code{\link{geo_download}};\code{\link{draw_volcano}};\code{\link{draw_venn}}

Expand Down Expand Up @@ -134,6 +138,7 @@ draw_volcano2 = function(deg,
##' @importFrom pheatmap pheatmap
##' @export
##' @examples
##' \dontrun{
##' gse = "GSE474"
##' geo = geo_download(gse,destdir=tempdir())
##' geo$exp[1:4,1:4]
Expand All @@ -145,6 +150,7 @@ draw_volcano2 = function(deg,
##' ids <- AnnoProbe::idmap(geo$gpl,destdir = tempdir())
##' deg = multi_deg(geo$exp,group_list,ids,adjust = FALSE)
##' draw_heatmap2(geo$exp,group_list,deg)
##' }
##' @seealso
##' \code{\link{draw_pca}};\code{\link{draw_volcano}};\code{\link{draw_venn}}

Expand Down
6 changes: 5 additions & 1 deletion R/7_quick_double_enrich.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@
##' @importFrom ggplot2 scale_x_discrete
##' @export
##' @examples
##' \dontrun{
##' head(genes)
##' g = quick_enrich(genes,destdir = tempdir())
##' names(g)
##' g[[1]][1:4,1:4]
##' g[[3]]
##' g[[4]]
##' }
##' @seealso
##' \code{\link{double_enrich}}

Expand Down Expand Up @@ -91,7 +93,9 @@ quick_enrich <- function(genes,
##' @importFrom ggplot2 theme
##' @export
##' @examples
##' # double_enrich(deg)
##' \dontrun{
##' double_enrich(deg)
##' }
##' @seealso
##' \code{\link{quick_enrich}}

Expand Down
18 changes: 9 additions & 9 deletions R/8_tcga_group_trans_exp.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

make_tcga_group <- function(exp){
k1 = stringr::str_starts(colnames(exp),"TCGA")
if(!any(k1))stop("no tcga samples detected,please check it")
if(!any(k1))stop("no TCGA samples detected,please check it")
k2 = suppressWarnings(as.numeric(stringr::str_sub(colnames(exp),14,15))<10)
group_list = ifelse(k1&k2,"tumor","normal")
group_list = factor(group_list,levels = c("normal","tumor"))
Expand All @@ -24,12 +24,12 @@ make_tcga_group <- function(exp){

##' trans_exp
##'
##' transform rownames of tcga or tcga_gtex expression set from gdc or xena,from ensembl id to gene symbol
##' transform rownames of TCGA or TCGA_Gtex expression set from gdc or xena,from ensembl id to gene symbol
##'
##' @param exp tcga or tcga_gtex expression set from gdc or xena
##' @param exp TCGA or TCGA_Gtex expression set from gdc or xena
##' @param mrna_only only keep mrna rows in result
##' @param lncrna_only only keep lncrna rows in result
##' @param gtex logical,whether including gtex data
##' @param gtex logical,whether including Gtex data
##' @return a transformed expression set with symbol
##' @author Xiaojie Sun
##' @importFrom stringr str_detect
Expand Down Expand Up @@ -99,7 +99,7 @@ utils::globalVariables(c("lnc_anno","mRNA_anno","lnc_annov23","mRNA_annov23"))
##'
##' transform rownames for microarray expression matrix
##'
##' @param exp tcga or tcga_gtex expression set from gdc or xena
##' @param exp TCGA or TCGA_Gtex expression set from gdc or xena
##' @param ids data.frame with original rownames and new rownames
##' @param from colname for original rownames
##' @param to colname for new rownames
Expand Down Expand Up @@ -133,7 +133,7 @@ trans_array = function(exp,ids,from = "probe_id",
##'
##' drop duplicated samples from the same patients
##'
##' @param exp tcga or tcga_gtex expression set from gdc or xena
##' @param exp TCGA or TCGA_Gtex expression set from gdc or xena
##' @return a transformed expression set without duplicated samples
##' @author Xiaojie Sun
##' @export
Expand Down Expand Up @@ -166,10 +166,10 @@ sam_filter = function(exp){

##' match_exp_cl
##'
##' match exp and clinical data from tcga
##' match exp and clinical data from TCGA
##'
##' @param exp tcga expression set
##' @param cl tcga clinical data.frame
##' @param exp TCGA expression set
##' @param cl TCGA clinical data.frame
##' @param id_column which column contains patient ids, column number or colnmn name.
##' @param sample_centric logical,deault T,keep all samples from the same patients.if FALSE,keep only one tumor sample for one patient.
##' @return a transformed clinical data.frame with sample ids.
Expand Down
4 changes: 3 additions & 1 deletion man/double_enrich.Rd

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

2 changes: 2 additions & 0 deletions man/draw_heatmap2.Rd

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

2 changes: 2 additions & 0 deletions man/draw_volcano2.Rd

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

2 changes: 2 additions & 0 deletions man/geo_download.Rd

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

2 changes: 2 additions & 0 deletions man/get_cgs.Rd

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

2 changes: 2 additions & 0 deletions man/quick_enrich.Rd

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

0 comments on commit 532b90b

Please sign in to comment.