|
2 | 2 | #' @importFrom GEOquery getGEO |
3 | 3 | #' @importFrom RColorBrewer brewer.pal |
4 | 4 | #' @importFrom plot3D scatter3D |
5 | | -#' @importFrom plotrix draw.ellipse |
| 5 | +#' @importFrom plotrix draw.ellipse draw.circle |
6 | 6 | #' @importFrom impute impute.knn |
7 | | -#' @importFrom umap umap |
| 7 | +#' @importFrom umap umap umap.defaults |
8 | 8 | #' @importFrom rhdf5 H5Fopen H5Fclose |
9 | 9 | #' @importFrom DESeq2 DESeqDataSetFromTximport DESeq |
10 | 10 | #' @importFrom ComplexHeatmap Heatmap |
|
15 | 15 | #' @importFrom arm bayesglm |
16 | 16 | #' @importFrom reshape melt |
17 | 17 | #' @importFrom ordinal clm clmm |
18 | | -#' @importFrom rmarkdown render |
| 18 | +#' @importFrom rmarkdown render pandoc_available html_document |
19 | 19 | #' @importFrom Matrix rowSums |
20 | 20 | #' @importFrom SummarizedExperiment assay |
21 | 21 | #' @importFrom lme4 lmer |
22 | 22 | #' @importFrom grDevices col2rgb colorRampPalette dev.off pdf rgb |
23 | 23 | #' @importFrom graphics abline arrows axis barplot boxplot hist image layout legend lines mtext par points polygon rect segments strheight stripchart strwidth text |
24 | | -#' @importFrom stats IQR aggregate as.dendrogram as.dist cutree density dist fisher.test gaussian glm hclust kmeans ks.test lm median model.matrix na.omit order.dendrogram p.adjust pchisq pnorm prcomp pt qnorm quantile sd |
| 24 | +#' @importFrom stats IQR aggregate as.dendrogram as.dist cutree density dist fisher.test gaussian glm hclust kmeans ks.test lm median model.matrix na.omit order.dendrogram p.adjust pchisq pnorm prcomp pt qnorm quantile sd splinefun |
25 | 25 | #' @importFrom utils read.delim write.table |
26 | 26 |
|
27 | 27 | ################################ |
@@ -3815,12 +3815,12 @@ draw.eset.QC <- function(eset,outdir = '.',do.logtransform = FALSE,intgroup=NULL |
3815 | 3815 | use_mat <- log2(use_mat) |
3816 | 3816 | } |
3817 | 3817 | if(generate_html==TRUE){ |
3818 | | - if(pandoc_available()==FALSE){ |
| 3818 | + if(rmarkdown::pandoc_available()==FALSE){ |
3819 | 3819 | stop('pandoc not available, please set Sys.setenv(RSTUDIO_PANDOC=$pandoc_installed_path), or set generate_html=FALSE') |
3820 | 3820 | } |
3821 | 3821 | output_rmd_file <- sprintf('%s/%sQC.Rmd',outdir,prefix) |
3822 | 3822 | file.copy(from=system.file('Rmd/eset_QC.Rmd',package = "NetBID2"),to=output_rmd_file) |
3823 | | - rmarkdown::render(output_rmd_file, html_document(toc = TRUE)) |
| 3823 | + rmarkdown::render(output_rmd_file, rmarkdown::html_document(toc = TRUE)) |
3824 | 3824 | return(TRUE) |
3825 | 3825 | } |
3826 | 3826 | ## pca |
@@ -3920,7 +3920,7 @@ draw.meanSdPlot <- function(eset){ |
3920 | 3920 | sd_g_l_m <- base::rowMeans(sd_g_l) |
3921 | 3921 | # col=get_transparent(brewer.pal(8,'Set1')[2],alpha=0.1) |
3922 | 3922 | par(mai=c(1,1,1,2)) |
3923 | | - dat <- spline(x=mean_g_l_m,y=sd_g_v,n=n*10) |
| 3923 | + dat <- stats::spline(x=mean_g_l_m,y=sd_g_v,n=n*10) |
3924 | 3924 | graphics::plot(y~x,data=dat,type='l',col=brewer.pal(8,'Set1')[1],lwd=2,xlab='rank(mean)',ylab='sd', |
3925 | 3925 | ylim=c(0,base::max(sd_g)),xlim=c(0,base::max(mean_g)),cex.lab=1.2) |
3926 | 3926 | pp <- par()$usr |
@@ -3967,7 +3967,7 @@ draw.correlation <- function(use_mat,class_label,main='',correlation_strategy='p |
3967 | 3967 | uni_class <- base::unique(class_label) |
3968 | 3968 | class_label <- class_label[order(factor(class_label,levels=uni_class))] |
3969 | 3969 | use_mat <- use_mat[,names(class_label)] |
3970 | | - cor_res <- cor(use_mat,method=correlation_strategy) |
| 3970 | + cor_res <- stats::cor(use_mat,method=correlation_strategy) |
3971 | 3971 | cc1 <- get.class.color(class_label,use_color=use_color,pre_define=pre_define); |
3972 | 3972 | cc1 <- get_transparent(cc1,0.5); |
3973 | 3973 | p1 <- cumsum(base::table(class_label)[uni_class]); p1 <- c(0,p1) |
@@ -4292,7 +4292,7 @@ draw.umap.kmeans <- function(mat=NULL,all_k=NULL,obs_label=NULL, |
4292 | 4292 | if(base::length(base::setdiff(all_k,2:base::length(obs_label)))>0){ |
4293 | 4293 | message('some value in all_k exceed the maximum sample size, check and re-try !');return(FALSE); |
4294 | 4294 | } |
4295 | | - ori_cc <- umap.defaults; |
| 4295 | + ori_cc <- umap::umap.defaults; |
4296 | 4296 | ori_cc$n_epochs <- 2000; |
4297 | 4297 | ori_cc$n_neighbors <- base::min(15,round(ncol(mat)/2)); |
4298 | 4298 | if(plot_type=='3D') ori_cc$n_components <- 3 |
@@ -4529,7 +4529,7 @@ get_clustComp_MICA <- function(outdir, all_k, obs_label, prjname = NULL,strategy |
4529 | 4529 | all_k_res <- list() |
4530 | 4530 | for (k in all_k) { |
4531 | 4531 | use_file <- sprintf('%s/%s_k%s_ClusterMem.txt', |
4532 | | - outdir,prjname,use_k,prjname) |
| 4532 | + outdir,prjname,k,prjname) |
4533 | 4533 | d1 <- read.delim(use_file, stringsAsFactors = FALSE) |
4534 | 4534 | ##Score |
4535 | 4535 | rownames(d1) <- d1$id |
@@ -6075,7 +6075,7 @@ draw.bubblePlot <- function(driver_list=NULL,show_label=driver_list,Z_val=NULL,d |
6075 | 6075 | cc_r <- matrix(z2col(f_mat2,n_len=30,sig_thre=qnorm(1-0.1)),ncol=ncol(f_mat2),byrow = FALSE) |
6076 | 6076 | for(i in 1:nrow(f_mat1)){ |
6077 | 6077 | for(j in 1:ncol(f_mat1)){ |
6078 | | - draw.circle(i-0.5,j-0.5,radius=f_mat1[i,j]/2,col=cc_r[i,j]) |
| 6078 | + plotrix::draw.circle(i-0.5,j-0.5,radius=f_mat1[i,j]/2,col=cc_r[i,j]) |
6079 | 6079 | } |
6080 | 6080 | } |
6081 | 6081 | ## draw circle legend |
@@ -8073,14 +8073,14 @@ draw.network.QC <- function(igraph_obj,outdir=NULL,prefix="",directed=TRUE,weigh |
8073 | 8073 | } |
8074 | 8074 | net <- igraph_obj |
8075 | 8075 | if(generate_html==TRUE){ |
8076 | | - if(pandoc_available()==FALSE){ |
| 8076 | + if(rmarkdown::pandoc_available()==FALSE){ |
8077 | 8077 | stop('pandoc not available, please set Sys.setenv(RSTUDIO_PANDOC=$pandoc_installed_path), or set generate_html=FALSE') |
8078 | 8078 | } |
8079 | 8079 | directed <- directed |
8080 | 8080 | weighted <- weighted |
8081 | 8081 | output_rmd_file <- sprintf('%s/%snetQC.Rmd',outdir,prefix) |
8082 | 8082 | file.copy(from=system.file('Rmd/net_QC.Rmd',package = "NetBID2"),to=output_rmd_file) |
8083 | | - rmarkdown::render(output_rmd_file, html_document(toc = TRUE)) |
| 8083 | + rmarkdown::render(output_rmd_file, rmarkdown::html_document(toc = TRUE)) |
8084 | 8084 | return(TRUE) |
8085 | 8085 | } |
8086 | 8086 | ### |
@@ -8976,7 +8976,7 @@ NetBID.lazyMode.DriverEstimation <- function(project_main_dir=NULL,project_name= |
8976 | 8976 | print('Current db info:') |
8977 | 8977 | print(db_info) |
8978 | 8978 | if(!intgroup %in% colnames(Biobase::pData(cal.eset))){ |
8979 | | - message(sprintf('%s not included in the Biobase::pData(cal.eset), please check and re-try!',use_comp));return(FALSE) |
| 8979 | + message(sprintf('%s not included in the Biobase::pData(cal.eset), please check and re-try!',intgroup));return(FALSE) |
8980 | 8980 | } |
8981 | 8981 | phe <- Biobase::pData(cal.eset) |
8982 | 8982 | G1 <- rownames(phe)[which(phe[,intgroup]==G1_name)];G0 <- rownames(phe)[which(phe[,intgroup]==G0_name)]; |
|
0 commit comments