├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── ImageGP.Rproj ├── LICENSE ├── Makefile ├── NAMESPACE ├── R ├── RDA.R ├── WGCNA.R ├── enrich.R ├── flowerplot.R ├── ggsci.R ├── pca.R ├── plot.R ├── singlecell.R ├── sp_EulerDiagrams.R ├── sp_barplot.R ├── sp_boxplot.R ├── sp_corrplot.R ├── sp_dendrogram.R ├── sp_enrichment.R ├── sp_hclust.R ├── sp_histogram.R ├── sp_inflectionpoint.R ├── sp_lines.R ├── sp_manhattan2.R ├── sp_pca.R ├── sp_pcoa.R ├── sp_pheatmap.R ├── sp_raincloud.R ├── sp_scatter.R ├── sp_tree.R ├── sp_upsetView.R ├── sp_vennDiagram.R ├── sp_vennDiagram2.R ├── sp_vennDiagram3.R ├── sp_volcano.R ├── statistics.R ├── transcriptome.R ├── utilities.R ├── waterfalls.R └── zzz.R ├── README.md ├── build.r ├── man ├── DESeq2_ysx.Rd ├── Matrix2colCorrelation.Rd ├── WGCNA_GeneModuleTraitCoorelation.Rd ├── WGCNA_MEs_traitCorrelationHeatmap.Rd ├── WGCNA_ModuleGeneTraitHeatmap.Rd ├── WGCNA_coexprNetwork.Rd ├── WGCNA_cytoscape.Rd ├── WGCNA_dataCheck.Rd ├── WGCNA_dataFilter.Rd ├── WGCNA_filterTrait.Rd ├── WGCNA_hubgene.Rd ├── WGCNA_moduleTraitPlot.Rd ├── WGCNA_onestep.Rd ├── WGCNA_readindata.Rd ├── WGCNA_sampleClusterDetectOutlier.Rd ├── WGCNA_saveModuleAndMe.Rd ├── WGCNA_softpower.Rd ├── base_plot_save.Rd ├── checkAndInstallPackages.Rd ├── clusterSampleHeatmap2.Rd ├── clusterSamplePheatmap.Rd ├── clusterSampleUpperTriPlot.Rd ├── dataFilter.Rd ├── dataFilter2.Rd ├── deseq2normalizedExpr.Rd ├── dh.Rd ├── draw_colnames_custom.Rd ├── enrichCustomizedPathway.Rd ├── enrichGO_model.Rd ├── enrichKEGG_model.Rd ├── find_coordinates.Rd ├── flower_plot.Rd ├── flower_plot_inner.Rd ├── generateAbundanceDF.Rd ├── generate_color_list.Rd ├── generate_shapes.Rd ├── get_lower_tri.Rd ├── get_matched_columns_based_on_value.Rd ├── get_upper_tri.Rd ├── ggsci_to_json.Rd ├── match_two_df.Rd ├── merge_data_with_auto_matched_column.Rd ├── mixedToFloat.Rd ├── multipleGroupDEgenes.Rd ├── normalizedExpr2DistribBoxplot.Rd ├── numCheck.Rd ├── pca_run.Rd ├── rankPlot.Rd ├── readscount2deseq.Rd ├── salmon2deseq.Rd ├── shapiro.test2.Rd ├── sp.is.null.Rd ├── sp_EulerDiagrams.Rd ├── sp_barplot.Rd ├── sp_boxplot.Rd ├── sp_corrplot.Rd ├── sp_current_time.Rd ├── sp_dendextend.Rd ├── sp_determine_log_add.Rd ├── sp_diff_test.Rd ├── sp_enrichment.Rd ├── sp_get_ggplot_limits.Rd ├── sp_ggplot_add_vline_hline.Rd ├── sp_ggplot_facet.Rd ├── sp_ggplot_layout.Rd ├── sp_hclust.Rd ├── sp_histogram.Rd ├── sp_lines.Rd ├── sp_load_font.Rd ├── sp_manhattan2_plot.Rd ├── sp_manual_color_ggplot2.Rd ├── sp_manual_fill_ggplot2.Rd ├── sp_multiple_group_diff_test.Rd ├── sp_pca.Rd ├── sp_pcoa.Rd ├── sp_pheatmap.Rd ├── sp_raincloud.Rd ├── sp_rda.Rd ├── sp_readTable.Rd ├── sp_read_in_long_wide_matrix.Rd ├── sp_scatterplot.Rd ├── sp_set_factor_order.Rd ├── sp_string2vector.Rd ├── sp_transfer_one_column.Rd ├── sp_tree_plot.Rd ├── sp_upsetview.Rd ├── sp_vennDiagram.Rd ├── sp_vennDiagram2.Rd ├── sp_vennDiagram3.Rd ├── sp_volcano_plot.Rd ├── sp_writeTable.Rd ├── stackVlnPlot.Rd ├── stackVlnSeuratPlot.Rd ├── twoGroupDEgenes.Rd ├── value.identical.Rd ├── volcanoPlot.Rd ├── waterfalls_plot.Rd └── widedataframe2boxplot.Rd ├── test ├── DESeq2_usage.Rmd ├── Plotusage.Rmd ├── WGCNA_usage.Rmd └── test.Rmd └── vignettes ├── .significance.txt ├── Euler.txt ├── LiverFemaleClean.txt ├── Metadata_traitData.txt ├── Plot.R ├── Plot.Rmd ├── Plot.sh ├── Set.data ├── TraitsClean.txt ├── WGCNA_check.Rmd ├── bar.data ├── bar.txt ├── barplot_demo4.txt ├── box.data ├── boxplot_singlecell.txt ├── deseq2.Rmd ├── enrichment.data ├── exprMat.txt ├── exprTable.annocol.txt ├── exprTable.annorow.txt ├── exprTable.txt ├── exprTable.txt.pheatmap.pdf.reordered.txt ├── exprTable.txt.reordered.txt ├── exprTable2.txt ├── exprTableWithReps.txt ├── goeast.enrich.txt ├── group_pcoa.data ├── histogram.data ├── histogram.demo1.txt ├── inflectionpoint.txt ├── iqtree.aligned.fa ├── iqtree.treefile ├── line.data ├── manhattan.data ├── metadata.txt ├── otuabundance.txt ├── otuabundancephenodata.txt ├── pca.data ├── pca_group.data ├── pcoa.data ├── pheatmap.pdf.reordered.txt ├── scatter.txt ├── scatter3.txt ├── scatter_demo1.txt ├── scatter_demo2.txt ├── sp_heatmap.reordered.txt ├── test.Rmd ├── test_statistics.R ├── tree.attribute ├── upset.txt ├── upset.wide.data ├── upsetview.data ├── vennDiagram.data └── volcano.txt /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | build 3 | vignettes/*.txt 4 | vignettes/*.pdf 5 | vignettes/*.xls 6 | vignettes/*.zip 7 | *.txt 8 | tmp 9 | *.RData 10 | */*.RData 11 | ggsci_colors.json 12 | 13 | bin/py2 14 | .history 15 | .swp 16 | ./.history 17 | __pycache__ 18 | # History files 19 | .Rhistory 20 | .Rapp.history 21 | 22 | # Session Data files 23 | .RData 24 | 25 | # Example code in package build process 26 | *-Ex.R 27 | 28 | # Output files from R CMD build 29 | /*.tar.gz 30 | 31 | # Output files from R CMD check 32 | /*.Rcheck/ 33 | 34 | # RStudio files 35 | .Rproj.user/ 36 | .DS_Store 37 | 38 | # produced vignettes 39 | vignettes/*.html 40 | vignettes/*.pdf 41 | 42 | # OAuth2 token, see https://github.com/hadley/httr/releases/tag/v0.3 43 | .httr-oauth 44 | 45 | # knitr and R markdown default cache directories 46 | /*_cache/ 47 | /cache/ 48 | 49 | # Temporary files created by R markdown 50 | *.utf8.md 51 | *.knit.md 52 | 53 | # Shiny token, see https://shiny.rstudio.com/articles/shinyapps.html 54 | rsconnect/ 55 | 56 | test/*.txt 57 | 58 | test_wgcna 59 | 60 | # Python: 61 | *.py[cod] 62 | *.so 63 | *.egg 64 | *.egg-info 65 | dist 66 | build 67 | 68 | *.pdf 69 | *.log 70 | 71 | Plot_files/ 72 | 73 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: ImageGP 2 | Type: Package 3 | Title: For ImageGP cloud platform (https://www.bic.ac.cn/BIC) 4 | Version: 0.2.1 5 | Author: Chen Tong 6 | Authors@R: c(person("Chen", "Tong", email = "chentong_biology@163.com", 7 | role = c("aut", "cre")), 8 | person("Fan", "Mingjie", email = "train@ehbio.com", 9 | role = c("aut"))) 10 | Maintainer: The package maintainer 11 | Description: For ImageGP cloud platform. 12 | License: GPL-2 13 | Encoding: UTF-8 14 | LazyData: true 15 | VignetteBuilder: knitr 16 | RoxygenNote: 7.3.2 17 | Roxygen: list(markdown = TRUE) 18 | URL: https://www.bic.ac.cn/BIC 19 | Depends: 20 | R (>= 3.1) 21 | Imports: 22 | ggplot2, 23 | pheatmap, 24 | grid, 25 | dplyr, 26 | stringr 27 | Suggests: 28 | WGCNA, 29 | DESeq2, 30 | RColorBrewer, 31 | gplots, 32 | amap, 33 | reshape2, 34 | ggrepel, 35 | BiocParallel, 36 | cowplot, 37 | readr, 38 | knitr, 39 | VennDiagram, 40 | UpSetR 41 | -------------------------------------------------------------------------------- /ImageGP.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | ProjectId: adaea030-f60f-40d9-9e9b-de1cfc9f1add 3 | 4 | RestoreWorkspace: Default 5 | SaveWorkspace: Default 6 | AlwaysSaveHistory: Default 7 | 8 | EnableCodeIndexing: Yes 9 | UseSpacesForTab: Yes 10 | NumSpacesForTab: 2 11 | Encoding: UTF-8 12 | 13 | RnwWeave: Sweave 14 | LaTeX: pdfLaTeX 15 | 16 | AutoAppendNewline: Yes 17 | StripTrailingWhitespace: Yes 18 | 19 | BuildType: Package 20 | PackageUseDevtools: Yes 21 | PackageInstallArgs: --no-multiarch --with-keep.source 22 | PackageRoxygenize: rd,collate,namespace 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Chen Tong 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PKG_VERSION=$(shell grep -i ^version ./DESCRIPTION | cut -d : -d \ -f 2) 2 | PKG_NAME=$(shell grep -i ^package ./DESCRIPTION | cut -d : -d \ -f 2) 3 | 4 | R_FILES := $(wildcard ./R/*.R) 5 | PKG_FILES := ./DESCRIPTION ./NAMESPACE $(R_FILES) README.md 6 | 7 | .PHONY: tarball install check clean roxygen 8 | 9 | 10 | sourcetar: 11 | zip -r ../$(PKG_NAME)_$(PKG_VERSION).zip $(PKG_FILES) man test 12 | #zip -d $(PKG_NAME)_$(PKG_VERSION).zip .Rproj.user/* 13 | 14 | tarball: $(PKG_NAME)_$(PKG_VERSION).tar.gz 15 | $(PKG_NAME)_$(PKG_VERSION).tar.gz: $(PKG_FILES) 16 | R CMD build . 17 | 18 | all: check install 19 | 20 | check: roxygen $(PKG_NAME)_$(PKG_VERSION).tar.gz 21 | R CMD check $(PKG_NAME)_$(PKG_VERSION).tar.gz 22 | 23 | install: roxygen $(PKG_NAME)_$(PKG_VERSION).tar.gz 24 | R CMD INSTALL $(PKG_NAME)_$(PKG_VERSION).tar.gz 25 | 26 | roxygen: 27 | Rscript -e "library(roxygen2);roxygenize('.')" 28 | 29 | clean: 30 | -rm -f $(PKG_NAME)_*.tar.gz 31 | -rm -r -f $(PKG_NAME).Rcheck 32 | 33 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(DESeq2_ysx) 4 | export(GeomFlatViolin) 5 | export(Matrix2colCorrelation) 6 | export(WGCNA_GeneModuleTraitCoorelation) 7 | export(WGCNA_MEs_traitCorrelationHeatmap) 8 | export(WGCNA_ModuleGeneTraitHeatmap) 9 | export(WGCNA_coexprNetwork) 10 | export(WGCNA_cytoscape) 11 | export(WGCNA_dataCheck) 12 | export(WGCNA_dataFilter) 13 | export(WGCNA_filterTrait) 14 | export(WGCNA_hubgene) 15 | export(WGCNA_moduleTraitPlot) 16 | export(WGCNA_onestep) 17 | export(WGCNA_readindata) 18 | export(WGCNA_sampleClusterDetectOutlier) 19 | export(WGCNA_saveModuleAndMe) 20 | export(WGCNA_softpower) 21 | export(base_plot_save) 22 | export(checkAndInstallPackages) 23 | export(clusterSampleHeatmap2) 24 | export(clusterSamplePheatmap) 25 | export(clusterSampleUpperTriPlot) 26 | export(dataFilter) 27 | export(dataFilter2) 28 | export(deseq2normalizedExpr) 29 | export(dh) 30 | export(draw_colnames_custom) 31 | export(enrichCustomizedPathway) 32 | export(enrichGO_model) 33 | export(enrichKEGG_model) 34 | export(find_coordinates) 35 | export(flower_plot) 36 | export(flower_plot_inner) 37 | export(generateAbundanceDF) 38 | export(generate_color_list) 39 | export(generate_shapes) 40 | export(get_lower_tri) 41 | export(get_matched_columns_based_on_value) 42 | export(get_upper_tri) 43 | export(ggsci_to_json) 44 | export(match_two_df) 45 | export(merge_data_with_auto_matched_column) 46 | export(mixedToFloat) 47 | export(multipleGroupDEgenes) 48 | export(normalizedExpr2DistribBoxplot) 49 | export(numCheck) 50 | export(pca_run) 51 | export(rankPlot) 52 | export(readscount2deseq) 53 | export(salmon2deseq) 54 | export(shapiro.test2) 55 | export(sp.is.null) 56 | export(sp_EulerDiagrams) 57 | export(sp_barplot) 58 | export(sp_boxplot) 59 | export(sp_corrplot) 60 | export(sp_current_time) 61 | export(sp_dendextend) 62 | export(sp_determine_log_add) 63 | export(sp_diff_test) 64 | export(sp_enrichment) 65 | export(sp_get_ggplot_limits) 66 | export(sp_ggplot_add_vline_hline) 67 | export(sp_ggplot_facet) 68 | export(sp_ggplot_layout) 69 | export(sp_hclust) 70 | export(sp_histogram) 71 | export(sp_lines) 72 | export(sp_load_font) 73 | export(sp_manhattan2_plot) 74 | export(sp_manual_color_ggplot2) 75 | export(sp_manual_fill_ggplot2) 76 | export(sp_multiple_group_diff_test) 77 | export(sp_pca) 78 | export(sp_pcoa) 79 | export(sp_pheatmap) 80 | export(sp_raincloud) 81 | export(sp_rda) 82 | export(sp_readTable) 83 | export(sp_read_in_long_wide_matrix) 84 | export(sp_scatterplot) 85 | export(sp_set_factor_order) 86 | export(sp_string2vector) 87 | export(sp_transfer_one_column) 88 | export(sp_tree_plot) 89 | export(sp_upsetview) 90 | export(sp_vennDiagram) 91 | export(sp_vennDiagram2) 92 | export(sp_vennDiagram3) 93 | export(sp_volcano_plot) 94 | export(sp_writeTable) 95 | export(stackVlnPlot) 96 | export(stackVlnSeuratPlot) 97 | export(twoGroupDEgenes) 98 | export(value.identical) 99 | export(volcanoPlot) 100 | export(waterfalls_plot) 101 | export(widedataframe2boxplot) 102 | import(dplyr) 103 | import(ggplot2) 104 | import(grDevices) 105 | import(pheatmap) 106 | importFrom(dplyr,"%>%") 107 | importFrom(dplyr,group_by) 108 | importFrom(dplyr,mutate) 109 | importFrom(dplyr,summarize) 110 | importFrom(reshape2,melt) 111 | -------------------------------------------------------------------------------- /R/pca.R: -------------------------------------------------------------------------------- 1 | # www.ehbio.com/Training 2 | # Some useful keyboard shortcuts for package authoring: 3 | # 4 | # Build and Reload Package: 'Ctrl + Shift + B' 5 | # Check Package: 'Ctrl + Shift + E' 6 | # Test Package: 'Ctrl + Shift + T' 7 | # Generate DOC: 'Ctrl + Shift + Alt + r' 8 | 9 | #' Title 10 | #' 11 | #' @param rlogMat xx 12 | #' @param sample xx 13 | #' @param ehbio_output_prefix xx 14 | #' 15 | #' @return xx 16 | #' @export 17 | #' 18 | #' @examples 19 | #' 20 | #' pca_run(data) 21 | #' 22 | pca_run <- function(rlogMat, sample, ehbio_output_prefix){ 23 | 24 | #print("PCA analysis") 25 | formulaV <- c("conditions") 26 | # 27 | topn = 5000 28 | rlogMat_nrow = nrow(rlogMat) 29 | if (topn > rlogMat_nrow){ 30 | topn = rlogMat_nrow 31 | } 32 | # 33 | pca_mat = rlogMat[1:topn,] 34 | pca_mat <- as.data.frame(t(pca_mat)) 35 | # 36 | pca <- prcomp(pca_mat, scale=T) 37 | # 38 | pca_x = pca$x 39 | # 40 | pca_individual = data.frame(samp=rownames(pca_x), pca_x, sample) 41 | # 42 | write.table(pca_individual, file=paste0(ehbio_output_prefix,".DESeq2.pca_individuals.xls"), sep="\t", quote=F, row.names=F, col.names=T) 43 | # 44 | pca_percentvar <- formatC(pca$sdev^2 * 100 / sum( pca$sdev^2)) 45 | # 46 | # 47 | if (length(formulaV)==1) { 48 | p <- ggplot(pca_individual, aes(PC1, PC2, color=conditions)) 49 | } else if (length(formulaV==2)) { 50 | p <- ggplot(pca_data, aes(PC1, PC2, color=conditions, 51 | shape=conditions)) 52 | } 53 | # 54 | p = p + geom_point(size=3) + 55 | xlab(paste0("PC1: ", pca_percentvar[1], "% variance")) + 56 | ylab(paste0("PC2: ", pca_percentvar[2], "% variance")) + 57 | geom_text_repel(aes(label=samp), show.legend=F) + 58 | theme_classic() + 59 | theme(legend.position="top", legend.title=element_blank()) 60 | # 61 | p 62 | ggsave(p, filename=paste0(ehbio_output_prefix,".DESeq2.normalized.rlog.pca.pdf"),width=13.5,height=15,units=c("cm")) 63 | # 64 | pca_percentvar <- data.frame(PC=colnames(pca_x), Variance=pca_percentvar) 65 | write.table(pca_percentvar, file=paste0(ehbio_output_prefix,".DESeq2.pca_pc_weights.xls"), sep="\t", quote=F, row.names=F, col.names=T) 66 | } 67 | -------------------------------------------------------------------------------- /R/singlecell.R: -------------------------------------------------------------------------------- 1 | 2 | # Some useful keyboard shortcuts for package authoring: 3 | # 4 | # Build and Reload Package: 'Ctrl + Shift + B' 5 | # Check Package: 'Ctrl + Shift + E' 6 | # Test Package: 'Ctrl + Shift + T' 7 | # Generate DOC: 'Ctrl + Shift + Alt + r' 8 | 9 | 10 | 11 | #' Get stacked violin plot for seurat object 12 | #' 13 | #' @param object Seurat object 14 | #' @param features A vector of genes to plot 15 | #' @param slot_name default scale.data, accept data, count 16 | #' 17 | #' @return a ggplot2 object 18 | #' @export 19 | #' 20 | #' @examples 21 | #' 22 | #' stackVlnSeuratPlot(object = pbmc, features = top10$gene[c(1,3,5)]) 23 | #' 24 | stackVlnSeuratPlot <- function(object, features, slot_name="scale.data"){ 25 | feature_expr <- as.data.frame(t(as.data.frame(slot(object@assays$RNA, slot_name))[features,])) 26 | feature_expr$Cluster <- as.vector(object@active.ident) 27 | feature_expr <- reshape2::melt(feature_expr, id.vars=c("Cluster"), 28 | variable.name="Gene", value.name="Expr") 29 | p <- stackVlnPlot(feature_expr, x="Cluster", y="Expr", facets="Gene") 30 | p 31 | } 32 | 33 | 34 | 35 | #' Get stack violin plot for a normal matrix 36 | #' 37 | #' @param data 38 | #' 39 | #' At least three columns needed. 40 | #' 41 | #' ``` 42 | #' Gene Expr Cluster 43 | #' Sox2 2 1 44 | #' Sox2 1.5 1 45 | #' Sox2 1.2 1 46 | #' Sox2 1.2 1 47 | #' Sox2 20 2 48 | #' Sox2 21 2 49 | #' Sox2 22 2 50 | #' Sox2 23 2 51 | #' Sox2 0.4 3 52 | #' Sox2 0.2 3 53 | #' Sox3 2 1 54 | #' Sox3 2 2 55 | #' Sox3 2 3 56 | #' 57 | #' ``` 58 | #' 59 | #' @inheritParams ggplot2::aes 60 | #' @inheritParams ggplot2::facet_wrap 61 | #' 62 | #' @return a ggplot2 object 63 | #' @export 64 | #' 65 | #' @examples 66 | #' 67 | #' random_v <- c(rnorm(10, mean=1, sd=0.1), rnorm(10, mean=5), rnorm(20, mean=10), 68 | #' rnorm(10, mean=10), rnorm(10, mean=0.2, sd=0.01), rnorm(20, mean=1)) 69 | #' data <- data.frame(Gene=c(paste0('SOX', rep(2,40)), paste0('SOX', rep(3,40))), 70 | #' Expr=random_v, Cluster=rep(c(rep(1,10), rep(2,10),rep(3,20)),2)) 71 | #' stackVlnPlot(data, x="Cluster", y="Expr", facets="Gene") 72 | #' 73 | stackVlnPlot <- function(data, x, y, facets, fill=NULL){ 74 | if(is.null(fill)){ 75 | fill = x 76 | } 77 | data[[x]] <- as.factor(data[[x]]) 78 | p <- ggplot(data, aes_string(x=x,y=y, fill=fill)) + 79 | geom_violin(scale="width") + 80 | facet_wrap(facets, ncol=1, scales="free_y", strip.position = "left", 81 | labeller = as_labeller(unique(data[facets]))) + 82 | theme(strip.background = element_blank(), 83 | strip.placement = "outside", 84 | # Customize theme so that is black & white style as requested 85 | panel.background = element_rect(fill = NA, colour = 'black'), 86 | panel.grid = element_blank()) + 87 | ylab("") 88 | p 89 | } 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /R/sp_dendrogram.R: -------------------------------------------------------------------------------- 1 | #' Hierarchical cluster diagram 2 | #' 3 | #' @param data A data frame. 4 | #' @param group_variable Specifies a column as group. 5 | #' @param branch_order Specify branch order. 6 | #' @param method The agglomeration method to be used. This should be (an unambiguous abbreviation of) one of "ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC). 7 | #' @param k Number of groups. 8 | #' @param labels_size Labels size. 9 | #' @param shape Tree or circles. 10 | #' @param pic_title Title of the graph. 11 | #' @param pic_flip TRUE for horizontal, FALSE for vertical. Default TRUE. 12 | #' @param node_size Node size. 13 | #' @param legend_site Legend site. Optional, "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center". 14 | #' @param ... 15 | #' 16 | #' @return NULL 17 | #' @export 18 | #' 19 | #' @examples data<-matrix(rnorm(200),nrow = 50) 20 | #' rownames(data)<- paste0("dendextend", 1:50) 21 | #' colnames(data)<- paste0("zhou", 1:4) 22 | #' sp_dendextend(data = data,k = 3,labels_size = 0.3) 23 | #' 24 | #' 25 | #' data<- data.frame(ID = letters[1:5], apple = runif(50), banana = runif(50), watermelon = runif(50)) 26 | #' sp_dendextend(data = data, k = 5, method = "single", shape = "circle") 27 | #' 28 | 29 | 30 | sp_dendextend <- function(data, 31 | group_variable = NULL, 32 | branch_order = NULL, 33 | method = "complete", 34 | k = k, 35 | labels_size = 0.5, 36 | shape = "tree", 37 | pic_title = NULL, 38 | pic_flip = TRUE, 39 | node_size = 0.007, 40 | legend_site = "topleft", 41 | saveplot = NULL, 42 | ...) { 43 | if (class(data)[1] == "character") { 44 | data <- sp_readTable(data, row.names = NULL) 45 | } 46 | 47 | if (!sp.is.null(group_variable)) { 48 | # subset(data, select =-"Species") 49 | matrix_data <- 50 | data[, -which(names(data) %in% c(group_variable))] 51 | group_data <- data[, group_variable] 52 | } 53 | 54 | dist_data <- dist(matrix_data) 55 | hc_data <- hclust(dist_data, method = method) 56 | 57 | dend <- as.dendrogram(hc_data) 58 | 59 | # order it the closest we can to the order of the observations: 60 | if (!sp.is.null(branch_order)) { 61 | dend <- 62 | dendextend::rotate(dend, order = as.character(branch_order)) 63 | } 64 | 65 | # Color the branches based on the clusters: 66 | dend <- 67 | dendextend::color_branches(dend, k = k)#, groupLabels=iris_species) 68 | 69 | if (!sp.is.null(group_variable)) { 70 | # Manually match the labels, as much as possible, to the real classification of the flowers: 71 | labels_colors(dend) <- 72 | rainbow_hcl(k)[sort_levels_values(as.numeric(as.factor(data[, group_variable]))[order.dendrogram(dend)])] 73 | } 74 | 75 | if (!sp.is.null(group_variable)) { 76 | # We shall add the flower type to the labels: 77 | labels(dend) <- 78 | paste(as.character(group_data)[order.dendrogram(dend)], 79 | "(", labels(dend), ")", 80 | sep = "") 81 | } 82 | 83 | dend <- hang.dendrogram(dend, hang_height = 0.1) 84 | dend <- dendextend::set(dend, "labels_cex", labels_size) 85 | 86 | if (!sp.is.null(saveplot)) { 87 | base_plot_save(saveplot, ...) 88 | } 89 | if (shape == "tree") { 90 | plot( 91 | dend, 92 | main = pic_title, 93 | horiz = pic_flip, 94 | nodePar = list(cex = node_size) 95 | ) 96 | if (!sp.is.null(group_variable) || !sp.is.null(legend_site)) { 97 | group_data <- rev(levels(as.factor(data[, group_variable]))) 98 | legend(legend_site, legend = group_data, fill = rainbow_hcl(k)) 99 | } 100 | } else { 101 | par(mar = rep(0, 4)) 102 | circlize_dendrogram(dend) 103 | } 104 | if (!sp.is.null(saveplot)) { 105 | dev.off() 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /R/sp_hclust.R: -------------------------------------------------------------------------------- 1 | #' Hierarchical cluster diagram 2 | #' 3 | #' @param data A matrix file or an object. 4 | #' @param method Clustering method :"ward.D", "single", "complete", "average", "mcquitty", "median", "centroid", "ward.D2" 5 | #' @param thresholdZ.k Threshold for defining outliers. First compute the overall 6 | #' corelation of one sample to other samples. Then do Z-score transfer for all 7 | #' correlation values. The samples with corelation values less than given value 8 | #' would be treated as outliers. 9 | #' Default -2.5 meaning -2.5 std. 10 | #' @param ... 11 | #' 12 | #' @return A data frame. 13 | #' @export 14 | #' 15 | #' @examples 16 | #' x = runif(10) 17 | #' y = runif(10) 18 | #' data=cbind(x, y) 19 | #' rownames(data) = paste("exam", 1:10) 20 | #' sp_hclust(data) 21 | #' 22 | sp_hclust <- function (data, 23 | method = "average", 24 | thresholdZ.k = -2.5, 25 | saveplot = NULL, 26 | debug = FALSE, 27 | ...) { 28 | if (debug) { 29 | argg <- c(as.list(environment()), list(...)) 30 | print(argg) 31 | } 32 | if ("character" %in% class(data)) { 33 | datExpr <- sp_readTable(data, row.names = NULL) 34 | } else { 35 | datExpr <- data 36 | } 37 | A = WGCNA::adjacency(t(datExpr), type = "distance") 38 | # this calculates the whole network connectivity 39 | k = as.numeric(apply(A, 2, sum)) - 1 40 | # standardized connectivity 41 | Z.k = scale(k) 42 | # Designate samples as outlying if their Z.k value is below the threshold 43 | # thresholdZ.k = -5 # often -2.5 44 | 45 | if (thresholdZ.k > 0) { 46 | cat("\tThe program will transfer positive thresholdZ.k to their negative values.\n") 47 | thresholdZ.k = -1 * thresholdZ.k 48 | } 49 | 50 | cat("\tThreshold for detecting outlier samples are", 51 | thresholdZ.k, 52 | "\n") 53 | # the color vector indicates outlyingness (red) 54 | outlierColor = ifelse(Z.k < thresholdZ.k, "red", "black") 55 | 56 | # calculate the cluster tree using flahsClust or hclust 57 | sampleTree = hclust(as.dist(1 - A), method = method) 58 | 59 | if (!sp.is.null(saveplot)) { 60 | base_plot_save(saveplot, ...) 61 | } 62 | plotDendroAndColors( 63 | sampleTree, 64 | groupLabels = names(outlierColor), 65 | colors = outlierColor, 66 | main = "Sample dendrogram" 67 | ) 68 | if (!sp.is.null(saveplot)) { 69 | dev.off() 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /R/sp_inflectionpoint.R: -------------------------------------------------------------------------------- 1 | # 计算拐点, 代码取自ROSE 2 | numPts_below_line <- function(myVector, slope, x) { 3 | yPt <- myVector[x] 4 | b <- yPt - (slope * x) 5 | xPts <- 1:length(myVector) 6 | return(sum(myVector <= (xPts * slope + b))) 7 | } 8 | 9 | sp_inflectionpoint <- function (data, 10 | which_col, 11 | slope = NULL, 12 | color_plot = "red", 13 | color_abline = 8, 14 | color_point = 2, 15 | type = "l", 16 | lower = 1, 17 | lty = 2, 18 | saveplot = NULL, 19 | keep_point = "greater", 20 | ...) 21 | { 22 | 23 | if ("character" %in% class(data)) { 24 | enhancer = sp_readTable(data, header = F) 25 | } else { 26 | enhancer <- data 27 | } 28 | 29 | # head(enhancer) 30 | 31 | H3K27ac = sort(enhancer[, which_col]) 32 | 33 | 34 | if (!is.null(saveplot)) { 35 | base_plot_save(saveplot, ...) 36 | } 37 | 38 | plot(H3K27ac, col = color_plot, type = type) 39 | 40 | 41 | inputVector <- H3K27ac 42 | #set those regions with more control than ranking equal to zero 43 | inputVector[inputVector < 0] <- 0 44 | 45 | # This is the slope of the line we want to slide. This is the diagonal. 46 | if (sp.is.null(slope)) { 47 | slope <- (max(inputVector) - min(inputVector)) / length(inputVector) 48 | } 49 | # Find the x-axis point where a line passing through that point has the minimum number 50 | # of points below it. (ie. tangent)。 51 | # 该点就是切点 52 | xPt <- floor( 53 | optimize( 54 | numPts_below_line, 55 | lower = 1, 56 | upper = length(inputVector), 57 | myVector = inputVector, 58 | slope = slope 59 | )[[1]] 60 | ) 61 | 62 | y_cutoff <- 63 | inputVector[xPt] #The y-value at this x point. This is our cutoff. 64 | 65 | b <- y_cutoff - (slope * xPt) 66 | abline(v = xPt, 67 | h = y_cutoff, 68 | lty = lty, 69 | col = color_abline) 70 | points(xPt, 71 | y_cutoff, 72 | pch = 16, 73 | cex = 0.9, 74 | col = color_point) 75 | abline(coef = c(b, slope), col = 2) 76 | title( 77 | paste( 78 | "x=", 79 | xPt, 80 | "\ny=", 81 | signif(y_cutoff, 3), 82 | "\nFold over Median=", 83 | signif(y_cutoff / median(inputVector), 3), 84 | "x\nFold over Mean=", 85 | signif(y_cutoff / mean(inputVector), 3), 86 | "x", 87 | sep = "" 88 | ) 89 | ) 90 | 91 | #Number of regions with zero signal 92 | axis(4, 93 | sum(inputVector == 0), 94 | sum(inputVector == 0), 95 | col.axis = "blue", 96 | col = "blue") 97 | 98 | 99 | 100 | ## 超级增强子cluster 101 | if (keep_point == "greater") { 102 | keeppoint <- enhancer[enhancer[, which_col] >= y_cutoff, ] 103 | } else if (keep_point == "little"){ 104 | keeppoint <- enhancer[enhancer[, which_col] < y_cutoff, ] 105 | } 106 | write.table( 107 | keeppoint, 108 | file = "keep_point.xls", 109 | sep = "\t", 110 | quote = F, 111 | row.names = F 112 | ) 113 | 114 | if (!is.null(saveplot)) { 115 | dev.off() 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /R/waterfalls.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | #' Generate waterfall plot using R package waterfalls. 4 | #' 5 | #' @param waterfallsinput A data.frame containing two columns, 6 | #' one with the values, the other with the labels. 7 | #' @param labels the labels corresponding to each vector, marked on the x-axis. 8 | #' @param values a numeric vector making up the heights of the rectangles in the waterfall. 9 | #' @param rect_text_labels (character) a character vector of the same length as values that are placed on the rectangles. 10 | #' @param rect_text_size size of the text in the rectangles. 11 | #' @param put_rect_text_outside_when_value_below (numeric) the text labels accompanying a rectangle of this height 12 | #' will be placed outside the box: below if it's negative; above if it's positive. 13 | #' @param calc_total (logical, default: FALSE) should the final pool of the waterfall be calculated (and placed on the chart). 14 | #' @param draw_lines (logical, default: TRUE) should lines be drawn between successive rectangles. 15 | #' @param fill_colours Colours to be used to fill the rectangles, in order. 16 | #' Disregarded if fill_by_sign is TRUE (the default). 17 | #' @param lines_anchors a character vector of length two specifying the horizontal placement of the drawn lines relative to the preceding and successive rectangles, respectively. 18 | #' @param linetype the linetype for the draw_lines. 19 | #' @param total_rect_color the color of the final rectangle. 20 | #' @param total_rect_text (character) the text in the middle of the rectangle of the total rectangle. 21 | #' @param total_rect_text_color the color of the final rectangle's label text. 22 | #' @param total_axis_text (character) the text appearing on the axis underneath the total rectangle. 23 | #' @param rect_width (numeric) the width of the rectangle, relative to the space between each label factor. 24 | #' @param draw_axis_x (character) one of "none", "behind", "front" whether to draw an x.axis line and whether to draw it behind or in front of the rectangles, default is behind. 25 | #' @param rect_border the border around each rectangle. Choose NA if no border is desired. 26 | #' @param x_label The X axis name 27 | #' @param y_label The Y axis name 28 | #' @param ... 29 | #' 30 | #' @return pdf image 31 | #' @export 32 | #' 33 | #' @examples 34 | #' 35 | #' waterfallsinput <- "test.file" 36 | #' waterfalls_plot(waterfallsinput) 37 | #' 38 | waterfalls_plot <- function(waterfallsinput, sep="\t", row.names=NULL, header=T, 39 | quote="", comment="", check.names=F,labels,values=NULL, 40 | rect_text_labels='',rect_text_size=1, 41 | put_rect_text_outside_when_value_below=1, 42 | calc_total=FALSE, draw_lines=TRUE, fill_colours=NULL, 43 | lines_anchors=c("right", "left"), 44 | linetype="dashed", total_rect_color="black", 45 | total_rect_text_color="white", 46 | total_axis_text="Total", total_rect_text, 47 | rect_width = 0.9,draw_axis.x="behind", 48 | rect_border="white",scale_y_to_waterfall= TRUE, 49 | fill_by_sign=FALSE, theme_text_family="", 50 | x_label=NULL,y_label=NULL,...){ 51 | 52 | 53 | data_m <- read.table(waterfallsinput,sep=sep, row.names=row.names, header=header, 54 | quote=quote, comment=comment, check.names=check.names) 55 | 56 | rect_text_labels = paste(levels(data_m[,1]),'\n',data_m[,2]) 57 | 58 | if (is.null(values)){ 59 | p_waterfalls<-waterfall(.data = data_m, 60 | rect_text_labels=rect_text_labels) 61 | } else { 62 | p_waterfalls<-waterfall(values=values, 63 | rect_text_labels=rect_text_labels) 64 | } 65 | 66 | 67 | if (!is.null(x_label)){ 68 | p_waterfalls <- p_waterfalls + xlab(x_label) 69 | } 70 | 71 | if (!is.null(y_label)){ 72 | p_waterfalls <- p_waterfalls + ylab(y_label) 73 | } 74 | 75 | ggsave(paste0(waterfallsinput,"waterfalls.pdf"),plot=p_waterfalls) 76 | 77 | } 78 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | .onAttach <- function(libname, pkgname){ 2 | packageStartupMessage(paste0("Welcome to ImageGP package which is the base package for plot functions of https://www.bic.ac.cn/BIC. \n", 3 | "This package does not require you install all depended packages, ", 4 | "since one may not need all functions in this package.\n", 5 | "However, when there is a message implying some functions are missing,", 6 | "please install these packages manually.\n", 7 | "Or more specially, check Plot.Rmd in vignettes first.\n") 8 | ) 9 | } 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ImageGP 2 | 3 | This is the core code of ImageGP (new version , old version ) web site. 4 | 5 | 6 | ## Install 7 | 8 | ### Install from GitHub 9 | 10 | Github: https://github.com/Tong-Chen/ImageGP 11 | 12 | ``` 13 | # install.packages("devtools") 14 | devtools::install_github("Tong-Chen/ImageGP") 15 | ``` 16 | 17 | ### Install from Gitee 18 | 19 | Gitee: https://gitee.com/ct5869/ImageGP 20 | 21 | ``` 22 | # install.packages("devtools") 23 | devtools::install_git("https://gitee.com/ct5869/ImageGP") 24 | ``` 25 | 26 | 27 | -------------------------------------------------------------------------------- /build.r: -------------------------------------------------------------------------------- 1 | 2 | devtools::document(roclets=c('rd', 'collate', 'namespace')) 3 | 4 | 5 | -------------------------------------------------------------------------------- /man/Matrix2colCorrelation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{Matrix2colCorrelation} 4 | \alias{Matrix2colCorrelation} 5 | \title{Get ordered column correlation matrix from input dataframe. Normally used 6 | to do sample corealtion of gene expression or OTU abundance matrix.} 7 | \usage{ 8 | Matrix2colCorrelation(mat, method = "pearson", digits = 4, cor_file = NULL) 9 | } 10 | \arguments{ 11 | \item{mat}{A dataframe.} 12 | 13 | \item{method}{Type of correlation coefficient given to \code{\link{cor}}. 14 | Default "pearson".} 15 | 16 | \item{digits}{Number of decimial digits (given to \code{\link{round}}) to keep (default 4).} 17 | 18 | \item{cor_file}{Save ordered correlation matrix to given file name.} 19 | } 20 | \value{ 21 | A list containing ordered column correlation matrix and hcluster result. 22 | } 23 | \description{ 24 | Get ordered column correlation matrix from input dataframe. Normally used 25 | to do sample corealtion of gene expression or OTU abundance matrix. 26 | } 27 | \examples{ 28 | 29 | df = generateAbundanceDF() 30 | Matrix2colCorrelation(df) 31 | 32 | } 33 | -------------------------------------------------------------------------------- /man/WGCNA_GeneModuleTraitCoorelation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_GeneModuleTraitCoorelation} 4 | \alias{WGCNA_GeneModuleTraitCoorelation} 5 | \title{Genes correlated with both traits an modules.} 6 | \usage{ 7 | WGCNA_GeneModuleTraitCoorelation( 8 | datExpr, 9 | MEs_col, 10 | geneTraitCor, 11 | traitData, 12 | net, 13 | corType = "bicor", 14 | prefix = "ehbio", 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{datExpr}{ Expression data. A matrix (preferred) or 20 | data frame in which columns are genes and rows ar samples. NAs are 21 | allowed, but not too many. See \code{checkMissingData} below and details.} 22 | 23 | \item{MEs_col}{Module epigenes generated in \code{\link{WGCNA_saveModuleAndMe}}.} 24 | 25 | \item{geneTraitCor}{A dataframe generated by \code{\link{WGCNA_ModuleGeneTraitHeatmap}}} 26 | 27 | \item{traitData}{Sample attributes data frame. 28 | Or the "traitData" generated in \code{\link{WGCNA_readindata}}.} 29 | 30 | \item{net}{\code{\link{WGCNA_coexprNetwork}} or \code{\link[WGCNA]{blockwiseModules}} returned WGCNA object.} 31 | 32 | \item{corType}{character string specifying the correlation to be used. Allowed values are (unique 33 | abbreviations of) \code{"pearson"} and \code{"bicor"}, corresponding to Pearson and bidweight 34 | midcorrelation, respectively. Missing values are handled using the \code{pairwise.complete.obs} option. } 35 | 36 | \item{prefix}{prefix for output files.} 37 | 38 | \item{...}{Additional parameters given to plot output (\code{\link{pdf}}, \code{\link{png}},...) like "width", "height", .etc.} 39 | } 40 | \description{ 41 | Genes correlated with both traits an modules. 42 | } 43 | \examples{ 44 | 45 | df = generateAbundanceDF(nSample=30, nGrp=3, sd=5) 46 | datExpr <- WGCNA_dataFilter(df) 47 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 48 | power <- WGCNA_softpower(datExpr) 49 | net <- WGCNA_coexprNetwork(datExpr, power) 50 | WGCNA_saveModuleAndMe(net, datExpr) 51 | cyt <- WGCNA_cytoscape(net, power, datExpr) 52 | hubgene <- WGCNA_hubgene(cyt) 53 | 54 | #2 55 | exprMat <- "test.file" 56 | wgcnaL <- WGCNA_readindata(exprMat) 57 | 58 | traitData <- 'trait.file' 59 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 60 | datExpr <- wgcnaL$datExpr 61 | traitData <- wgcnaL$traitData 62 | WGCNA_dataCheck(datExpr) 63 | datExpr <- WGCNA_dataFilter(datExpr) 64 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 65 | # datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors) 66 | power <- WGCNA_softpower(datExpr) 67 | net <- WGCNA_coexprNetwork(datExpr, power) 68 | MEs_col <- WGCNA_saveModuleAndMe(net, datExpr) 69 | WGCNA_MEs_traitCorrelationHeatmap(MEs_col, traitData=traitData) 70 | cyt <- WGCNA_cytoscape(net, power, datExpr) 71 | hubgene <- WGCNA_hubgene(cyt) 72 | WGCNA_moduleTraitPlot(MEs_col, traitData=traitData) 73 | geneTraitCor <- WGCNA_ModuleGeneTraitHeatmap(datExpr, traitData, net) 74 | WGCNA_GeneModuleTraitCoorelation(datExpr, MEs_col, geneTraitCor, traitData, net) 75 | 76 | } 77 | -------------------------------------------------------------------------------- /man/WGCNA_MEs_traitCorrelationHeatmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_MEs_traitCorrelationHeatmap} 4 | \alias{WGCNA_MEs_traitCorrelationHeatmap} 5 | \title{Heatmap showing correlation among MEs and traits.} 6 | \usage{ 7 | WGCNA_MEs_traitCorrelationHeatmap(MEs_col, traitData, saveplot = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{MEs_col}{Module epigenes generated in \code{\link{WGCNA_saveModuleAndMe}}.} 11 | 12 | \item{traitData}{Sample attributes data frame. 13 | Or the "traitData" generated in \code{\link{WGCNA_readindata}}.} 14 | 15 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 16 | 17 | \item{...}{Additional parameters given to plot output (\code{\link{pdf}}, \code{\link{png}},...) like "width", "height", .etc.} 18 | } 19 | \description{ 20 | Heatmap showing correlation among MEs and traits. 21 | } 22 | \examples{ 23 | 24 | df = generateAbundanceDF(nSample=30, nGrp=3, sd=5) 25 | datExpr <- WGCNA_dataFilter(df) 26 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 27 | power <- WGCNA_softpower(datExpr) 28 | net <- WGCNA_coexprNetwork(datExpr, power) 29 | WGCNA_saveModuleAndMe(net, datExpr) 30 | 31 | #2 32 | exprMat <- "test.file" 33 | wgcnaL <- WGCNA_readindata(exprMat) 34 | 35 | traitData <- 'trait.file' 36 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 37 | datExpr <- wgcnaL$datExpr 38 | WGCNA_dataCheck(datExpr) 39 | datExpr <- WGCNA_dataFilter(datExpr) 40 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 41 | # datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors) 42 | power <- WGCNA_softpower(datExpr) 43 | net <- WGCNA_coexprNetwork(datExpr, power) 44 | MEs_col <- WGCNA_saveModuleAndMe(net, datExpr) 45 | WGCNA_MEs_traitCorrelationHeatmap(MEs_col, traitData=wgcnaL$traitData) 46 | 47 | } 48 | -------------------------------------------------------------------------------- /man/WGCNA_ModuleGeneTraitHeatmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_ModuleGeneTraitHeatmap} 4 | \alias{WGCNA_ModuleGeneTraitHeatmap} 5 | \title{Plot gene module relationship and correlation with traits.} 6 | \usage{ 7 | WGCNA_ModuleGeneTraitHeatmap( 8 | datExpr, 9 | traitData = NULL, 10 | net, 11 | corType = "bicor", 12 | prefix = "ehbio", 13 | saveplot = NULL, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{datExpr}{ Expression data. A matrix (preferred) or 19 | data frame in which columns are genes and rows ar samples. NAs are 20 | allowed, but not too many. See \code{checkMissingData} below and details.} 21 | 22 | \item{traitData}{Sample attributes data frame. 23 | Or the "traitData" generated in \code{\link{WGCNA_readindata}}.} 24 | 25 | \item{net}{\code{\link{WGCNA_coexprNetwork}} or \code{\link[WGCNA]{blockwiseModules}} returned WGCNA object.} 26 | 27 | \item{corType}{character string specifying the correlation to be used. Allowed values are (unique 28 | abbreviations of) \code{"pearson"} and \code{"bicor"}, corresponding to Pearson and bidweight 29 | midcorrelation, respectively. Missing values are handled using the \code{pairwise.complete.obs} option. } 30 | 31 | \item{prefix}{prefix for output files.} 32 | 33 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 34 | 35 | \item{...}{Additional parameters given to plot output (\code{\link{pdf}}, \code{\link{png}},...) like "width", "height", .etc.} 36 | } 37 | \value{ 38 | A dataframe geneTraitCor 39 | } 40 | \description{ 41 | Plot gene module relationship and correlation with traits. 42 | } 43 | \examples{ 44 | 45 | 46 | df = generateAbundanceDF(nSample=30, nGrp=3, sd=5) 47 | datExpr <- WGCNA_dataFilter(df) 48 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 49 | power <- WGCNA_softpower(datExpr) 50 | net <- WGCNA_coexprNetwork(datExpr, power) 51 | WGCNA_saveModuleAndMe(net, datExpr) 52 | cyt <- WGCNA_cytoscape(net, power, datExpr) 53 | hubgene <- WGCNA_hubgene(cyt) 54 | 55 | #2 56 | exprMat <- "test.file" 57 | wgcnaL <- WGCNA_readindata(exprMat) 58 | 59 | traitData <- 'trait.file' 60 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 61 | datExpr <- wgcnaL$datExpr 62 | traitData <- wgcnaL$traitData 63 | WGCNA_dataCheck(datExpr) 64 | datExpr <- WGCNA_dataFilter(datExpr) 65 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 66 | # datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors) 67 | power <- WGCNA_softpower(datExpr) 68 | net <- WGCNA_coexprNetwork(datExpr, power) 69 | MEs_col <- WGCNA_saveModuleAndMe(net, datExpr) 70 | WGCNA_MEs_traitCorrelationHeatmap(MEs_col, traitData=traitData) 71 | cyt <- WGCNA_cytoscape(net, power, datExpr) 72 | hubgene <- WGCNA_hubgene(cyt) 73 | WGCNA_moduleTraitPlot(MEs_col, traitData=traitData) 74 | geneTraitCor <- WGCNA_ModuleGeneTraitHeatmap(datExpr, traitData, net) 75 | 76 | 77 | } 78 | -------------------------------------------------------------------------------- /man/WGCNA_cytoscape.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_cytoscape} 4 | \alias{WGCNA_cytoscape} 5 | \title{Export WGCNA resullt for cytoscape input edges and nodes.} 6 | \usage{ 7 | WGCNA_cytoscape( 8 | net, 9 | power, 10 | datExpr, 11 | TOM_plot = NULL, 12 | prefix = "ehbio", 13 | fulledge = F 14 | ) 15 | } 16 | \arguments{ 17 | \item{net}{\code{\link{WGCNA_coexprNetwork}} or \code{\link[WGCNA]{blockwiseModules}} returned WGCNA object.} 18 | 19 | \item{power}{ soft-thresholding power for network construction. } 20 | 21 | \item{datExpr}{ Expression data. A matrix (preferred) or 22 | data frame in which columns are genes and rows ar samples. NAs are 23 | allowed, but not too many. See \code{checkMissingData} below and details.} 24 | 25 | \item{TOM_plot}{Get TOM plot and save to file given here like 'tomplot.pdf'.} 26 | 27 | \item{prefix}{prefix for output files.} 28 | 29 | \item{fulledge}{Output all edges (very large). Default FALSE. Only output edges whithin modules.} 30 | } 31 | \value{ 32 | A list with edgeData and nodeData as two elements. 33 | } 34 | \description{ 35 | Export WGCNA resullt for cytoscape input edges and nodes. 36 | } 37 | \examples{ 38 | 39 | df = generateAbundanceDF(nSample=30, nGrp=3, sd=5) 40 | datExpr <- WGCNA_dataFilter(df) 41 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 42 | power <- WGCNA_softpower(datExpr) 43 | net <- WGCNA_coexprNetwork(datExpr, power) 44 | WGCNA_saveModuleAndMe(net, datExpr) 45 | cyt <- WGCNA_cytoscape(net, power, datExpr) 46 | 47 | #2 48 | exprMat <- "test.file" 49 | wgcnaL <- WGCNA_readindata(exprMat) 50 | 51 | traitData <- 'trait.file' 52 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 53 | datExpr <- wgcnaL$datExpr 54 | WGCNA_dataCheck(datExpr) 55 | datExpr <- WGCNA_dataFilter(datExpr) 56 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 57 | # datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors) 58 | power <- WGCNA_softpower(datExpr) 59 | net <- WGCNA_coexprNetwork(datExpr, power) 60 | MEs_col <- WGCNA_saveModuleAndMe(net, datExpr) 61 | WGCNA_MEs_traitCorrelationHeatmap(MEs_col, traitData=wgcnaL$traitData) 62 | cyt <- WGCNA_cytoscape(net, power, datExpr) 63 | 64 | } 65 | -------------------------------------------------------------------------------- /man/WGCNA_dataCheck.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_dataCheck} 4 | \alias{WGCNA_dataCheck} 5 | \title{This is used to read in and check the distribution of WGCNA data in case there is 6 | systematic shift of expression data (espacially for data from different detection 7 | platforms).} 8 | \usage{ 9 | WGCNA_dataCheck(datExpr, ...) 10 | } 11 | \arguments{ 12 | \item{datExpr}{Normal gene expression matrix (gene x sample).} 13 | 14 | \item{...}{Other parameters given to \code{\link{widedataframe2boxplot}}.} 15 | } 16 | \value{ 17 | A ggplo2 object. 18 | } 19 | \description{ 20 | This is used to read in and check the distribution of WGCNA data in case there is 21 | systematic shift of expression data (espacially for data from different detection 22 | platforms). 23 | } 24 | \examples{ 25 | 26 | exprMat <- "test.file" 27 | wgcnaL <- WGCNA_readindata(exprMat) 28 | 29 | traitData <- 'trait.file' 30 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 31 | datExpr <- wgcnaL$datExpr 32 | WGCNA_dataCheck(datExpr) 33 | 34 | } 35 | -------------------------------------------------------------------------------- /man/WGCNA_dataFilter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_dataFilter} 4 | \alias{WGCNA_dataFilter} 5 | \title{Filter data for WGCNA input to increase computing efficiency without loosing too 6 | many information.} 7 | \usage{ 8 | WGCNA_dataFilter(wgcnaL, ...) 9 | } 10 | \arguments{ 11 | \item{wgcnaL}{A matrix or an object return by \code{WGCNA_readindata}.} 12 | 13 | \item{...}{Parameters given to \code{dataFilter}.} 14 | } 15 | \value{ 16 | A dataframe (samples x genes). 17 | } 18 | \description{ 19 | Filter data for WGCNA input to increase computing efficiency without loosing too 20 | many information. 21 | } 22 | \examples{ 23 | 24 | exprMat <- "test.file" 25 | wgcnaL <- WGCNA_readindata(exprMat) 26 | 27 | traitData <- 'trait.file' 28 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 29 | datExpr <- wgcnaL$datExpr 30 | WGCNA_dataCheck(datExpr) 31 | datExpr <- WGCNA_dataFilter(datExpr) 32 | 33 | } 34 | -------------------------------------------------------------------------------- /man/WGCNA_filterTrait.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_filterTrait} 4 | \alias{WGCNA_filterTrait} 5 | \title{Keep samples in trait data the same of exprMat.} 6 | \usage{ 7 | WGCNA_filterTrait(datExpr, trait) 8 | } 9 | \arguments{ 10 | \item{datExpr}{expression matrix} 11 | 12 | \item{trait}{trait data matrix} 13 | } 14 | \value{ 15 | balanced trait data frame 16 | } 17 | \description{ 18 | Keep samples in trait data the same of exprMat. 19 | } 20 | \examples{ 21 | 22 | traitData = WGCNA_filterTrait(datExpr, traitData) 23 | traitColor = WGCNA_filterTrait(datExpr, traitColor) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /man/WGCNA_hubgene.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_hubgene} 4 | \alias{WGCNA_hubgene} 5 | \title{Get top x hub genes for each module.} 6 | \usage{ 7 | WGCNA_hubgene(cyt, top_hub_n = 20, prefix = "ehbio") 8 | } 9 | \arguments{ 10 | \item{cyt}{A list containing two elements (edgeData and nodeData) generated by 11 | \code{WGCNA_cytoscape} (specifically onle whithin module 12 | interactions are kept in edgeData).} 13 | 14 | \item{top_hub_n}{A number to get top x hub genes.} 15 | 16 | \item{prefix}{prefix for output files.} 17 | } 18 | \value{ 19 | A dataframe containing selected hub genes. 20 | } 21 | \description{ 22 | Get top x hub genes for each module. 23 | } 24 | \examples{ 25 | 26 | df = generateAbundanceDF(nSample=30, nGrp=3, sd=5) 27 | datExpr <- WGCNA_dataFilter(df) 28 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 29 | power <- WGCNA_softpower(datExpr) 30 | net <- WGCNA_coexprNetwork(datExpr, power) 31 | WGCNA_saveModuleAndMe(net, datExpr) 32 | cyt <- WGCNA_cytoscape(net, power, datExpr) 33 | hubgene <- WGCNA_hubgene(cyt) 34 | 35 | #2 36 | exprMat <- "test.file" 37 | wgcnaL <- WGCNA_readindata(exprMat) 38 | 39 | traitData <- 'trait.file' 40 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 41 | datExpr <- wgcnaL$datExpr 42 | WGCNA_dataCheck(datExpr) 43 | datExpr <- WGCNA_dataFilter(datExpr) 44 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 45 | # datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors) 46 | power <- WGCNA_softpower(datExpr) 47 | net <- WGCNA_coexprNetwork(datExpr, power) 48 | MEs_col <- WGCNA_saveModuleAndMe(net, datExpr) 49 | WGCNA_MEs_traitCorrelationHeatmap(MEs_col, traitData=wgcnaL$traitData) 50 | cyt <- WGCNA_cytoscape(net, power, datExpr) 51 | hubgene <- WGCNA_hubgene(cyt) 52 | 53 | } 54 | -------------------------------------------------------------------------------- /man/WGCNA_moduleTraitPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_moduleTraitPlot} 4 | \alias{WGCNA_moduleTraitPlot} 5 | \title{Module-trait heatmap} 6 | \usage{ 7 | WGCNA_moduleTraitPlot( 8 | MEs_col, 9 | traitData = NULL, 10 | corType = "bicor", 11 | saveplot = NULL, 12 | prefix = "ehbio", 13 | angle_x = 90, 14 | up_color = c("red", "white", "blue"), 15 | down_color = c("green", "white"), 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{MEs_col}{Module epigenes generated in \code{\link{WGCNA_saveModuleAndMe}}.} 21 | 22 | \item{traitData}{Sample attributes data frame. 23 | Or the "traitData" generated in \code{\link{WGCNA_readindata}}.} 24 | 25 | \item{corType}{character string specifying the correlation to be used. Allowed values are (unique 26 | abbreviations of) \code{"pearson"} and \code{"bicor"}, corresponding to Pearson and bidweight 27 | midcorrelation, respectively. Missing values are handled using the \code{pairwise.complete.obs} option. } 28 | 29 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 30 | 31 | \item{prefix}{prefix for output files.} 32 | 33 | \item{angle_x}{Rotation angle for x-axis labels} 34 | 35 | \item{up_color}{Vector of colours to use for upper triangles (which representing pearson correlations values).} 36 | 37 | \item{down_color}{Vector of colours to use for lower triangles (which representing significance p-values).} 38 | 39 | \item{...}{Additional parameters given to plot output (\code{\link{pdf}}, \code{\link{png}},...) like "width", "height", .etc.} 40 | } 41 | \value{ 42 | A dataframe. 43 | } 44 | \description{ 45 | Module-trait heatmap 46 | } 47 | \examples{ 48 | 49 | df = generateAbundanceDF(nSample=30, nGrp=3, sd=5) 50 | datExpr <- WGCNA_dataFilter(df) 51 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 52 | power <- WGCNA_softpower(datExpr) 53 | net <- WGCNA_coexprNetwork(datExpr, power) 54 | WGCNA_saveModuleAndMe(net, datExpr) 55 | cyt <- WGCNA_cytoscape(net, power, datExpr) 56 | hubgene <- WGCNA_hubgene(cyt) 57 | 58 | #2 59 | exprMat <- "test.file" 60 | wgcnaL <- WGCNA_readindata(exprMat) 61 | 62 | traitData <- 'trait.file' 63 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 64 | datExpr <- wgcnaL$datExpr 65 | traitData <- wgcnaL$traitData 66 | WGCNA_dataCheck(datExpr) 67 | datExpr <- WGCNA_dataFilter(datExpr) 68 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 69 | # datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors) 70 | power <- WGCNA_softpower(datExpr) 71 | net <- WGCNA_coexprNetwork(datExpr, power) 72 | MEs_col <- WGCNA_saveModuleAndMe(net, datExpr) 73 | WGCNA_MEs_traitCorrelationHeatmap(MEs_col, traitData=traitData) 74 | cyt <- WGCNA_cytoscape(net, power, datExpr) 75 | hubgene <- WGCNA_hubgene(cyt) 76 | WGCNA_moduleTraitPlot(MEs_col, traitData=traitData) 77 | 78 | 79 | } 80 | -------------------------------------------------------------------------------- /man/WGCNA_sampleClusterDetectOutlier.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_sampleClusterDetectOutlier} 4 | \alias{WGCNA_sampleClusterDetectOutlier} 5 | \title{Sample cluster and outlier detection} 6 | \usage{ 7 | WGCNA_sampleClusterDetectOutlier( 8 | wgcnaL, 9 | thresholdZ.k = -2.5, 10 | saveplot = NULL, 11 | removeOutlier = F, 12 | traitColors = NULL, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{wgcnaL}{A matrix or an object return by \code{WGCNA_readindata}. A transformed gene expression matrix normally output by \code{WGCNA_dataFilter}. 18 | Samples x Genes.} 19 | 20 | \item{thresholdZ.k}{Threshold for defining outliers. First compute the overall 21 | corelation of one sample to other samples. Then do Z-score transfer for all 22 | correlation values. The samples with corelation values less than given value 23 | would be treated as outliers. 24 | Default -2.5 meaning -2.5 std.} 25 | 26 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 27 | 28 | \item{removeOutlier}{Remove outlier samples. Normally this should be only performed if 29 | no suitable soft power can be found.} 30 | 31 | \item{traitColors}{Sample attributes data frame transferred by 32 | \code{\link[WGCNA]{numbers2colors}} or generated in \code{\link{WGCNA_readindata}}.} 33 | 34 | \item{...}{Additional parameters given to plot output (\code{\link{pdf}}, \code{\link{png}},...) like "width", "height", .etc.} 35 | } 36 | \value{ 37 | A data frame. 38 | } 39 | \description{ 40 | Sample cluster and outlier detection 41 | } 42 | \examples{ 43 | 44 | df = generateAbundanceDF(nSample=30, nGrp=3) 45 | datExpr <- WGCNA_dataFilter(df) 46 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 47 | 48 | 49 | exprMat <- "test.file" 50 | wgcnaL <- WGCNA_readindata(exprMat) 51 | 52 | traitData <- 'trait.file' 53 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 54 | datExpr <- wgcnaL$datExpr 55 | WGCNA_dataCheck(datExpr) 56 | datExpr <- WGCNA_dataFilter(datExpr) 57 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 58 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors) 59 | 60 | } 61 | -------------------------------------------------------------------------------- /man/WGCNA_saveModuleAndMe.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_saveModuleAndMe} 4 | \alias{WGCNA_saveModuleAndMe} 5 | \title{Save gene-module relationships, MEs and plot module correlations.} 6 | \usage{ 7 | WGCNA_saveModuleAndMe(net, datExpr, prefix = "ehbio", saveplot = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{net}{\code{\link{WGCNA_coexprNetwork}} or \code{\link[WGCNA]{blockwiseModules}} returned WGCNA object.} 11 | 12 | \item{datExpr}{ Expression data. A matrix (preferred) or 13 | data frame in which columns are genes and rows ar samples. NAs are 14 | allowed, but not too many. See \code{checkMissingData} below and details.} 15 | 16 | \item{prefix}{prefix for output files.} 17 | 18 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 19 | 20 | \item{...}{Additional parameters given to plot output (\code{\link{pdf}}, \code{\link{png}},...) like "width", "height", .etc.} 21 | } 22 | \description{ 23 | Save gene-module relationships, MEs and plot module correlations. 24 | } 25 | \examples{ 26 | 27 | df = generateAbundanceDF(nSample=30, nGrp=3, sd=5) 28 | datExpr <- WGCNA_dataFilter(df) 29 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 30 | power <- WGCNA_softpower(datExpr) 31 | net <- WGCNA_coexprNetwork(datExpr, power) 32 | WGCNA_saveModuleAndMe(net, datExpr) 33 | 34 | #2 35 | exprMat <- "test.file" 36 | wgcnaL <- WGCNA_readindata(exprMat) 37 | 38 | traitData <- 'trait.file' 39 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 40 | datExpr <- wgcnaL$datExpr 41 | WGCNA_dataCheck(datExpr) 42 | datExpr <- WGCNA_dataFilter(datExpr) 43 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 44 | # datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors) 45 | power <- WGCNA_softpower(datExpr) 46 | net <- WGCNA_coexprNetwork(datExpr, power) 47 | MEs_col <- WGCNA_saveModuleAndMe(net, datExpr) 48 | 49 | 50 | } 51 | -------------------------------------------------------------------------------- /man/WGCNA_softpower.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{WGCNA_softpower} 4 | \alias{WGCNA_softpower} 5 | \title{Select soft power, the minimum number to get scale Free Topology Model Fit value (R2) larger than 0.85.} 6 | \usage{ 7 | WGCNA_softpower( 8 | datExpr, 9 | networkType = "signed", 10 | saveplot = NULL, 11 | maxPower = NULL, 12 | RsquaredCut = 0.85, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{networkType}{Default "signed". Allowed values are (unique abbreviations of) 18 | "unsigned", "signed", "signed hybrid". Correlation and distance are transformed as 19 | follows: 20 | \enumerate{ 21 | \item for type = "unsigned", adjacency = |cor|^power; 22 | \item for type = "signed", adjacency = (0.5 * (1+cor) )^power; 23 | \item for type = "signed hybrid", adjacency = cor^power if cor>0 and 0 otherwise; 24 | } 25 | 26 | and for type = "distance", adjacency = (1-(dist/max(dist))^2)^power.} 27 | 28 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 29 | 30 | \item{maxPower}{Specify maximum power to check. Default 30 for "unsigned" network 31 | and 40 for other type. Any number less than 20 would be treated as 20.} 32 | 33 | \item{RsquaredCut}{R2 for defining scale-free network (default 0.85). Any number larger than 1 would be treated as 0.99.} 34 | 35 | \item{...}{Additional parameters given to plot output (\code{\link{pdf}}, \code{\link{png}},...) like "width", "height", .etc.} 36 | } 37 | \value{ 38 | A list 39 | } 40 | \description{ 41 | Select soft power, the minimum number to get scale Free Topology Model Fit value (R2) larger than 0.85. 42 | } 43 | \examples{ 44 | 45 | df = generateAbundanceDF(nSample=30, nGrp=3, sd=5) 46 | datExpr <- WGCNA_dataFilter(df) 47 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 48 | power <- WGCNA_softpower(datExpr) 49 | 50 | #2 51 | exprMat <- "test.file" 52 | wgcnaL <- WGCNA_readindata(exprMat) 53 | 54 | traitData <- 'trait.file' 55 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 56 | datExpr <- wgcnaL$datExpr 57 | WGCNA_dataCheck(datExpr) 58 | datExpr <- WGCNA_dataFilter(datExpr) 59 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 60 | #datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors) 61 | power <- WGCNA_softpower(datExpr) 62 | 63 | } 64 | -------------------------------------------------------------------------------- /man/base_plot_save.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{base_plot_save} 4 | \alias{base_plot_save} 5 | \title{Generate suitable output graphics device by file suffix.} 6 | \usage{ 7 | base_plot_save(saveplot, ...) 8 | } 9 | \arguments{ 10 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 11 | 12 | \item{...}{Additional parameters given to plot output (\code{\link{pdf}}, \code{\link{png}},...) like "width", "height", .etc.} 13 | } 14 | \description{ 15 | Generate suitable output graphics device by file suffix. 16 | } 17 | \examples{ 18 | 19 | base_plot_save("a.pdf") 20 | # will simplify run (pdf("a.pdf)) 21 | 22 | } 23 | -------------------------------------------------------------------------------- /man/checkAndInstallPackages.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{checkAndInstallPackages} 4 | \alias{checkAndInstallPackages} 5 | \title{Check and install given packages} 6 | \usage{ 7 | checkAndInstallPackages( 8 | packageL, 9 | site = "https://mirrors.tuna.tsinghua.edu.cn/CRAN" 10 | ) 11 | } 12 | \arguments{ 13 | \item{package}{A list containing names and install-names of each package. 14 | (instll-names is only required for packages from github.) 15 | Like list(package1=c("ggplot2")) or 16 | list(packages1=c("ggplot2"), package2=c("ImageGP", "git_user/ImageGP"))} 17 | } 18 | \description{ 19 | Check and install given packages 20 | } 21 | \examples{ 22 | 23 | checkAndInstallPackages(list(package1=c("ggplot2"))) 24 | 25 | checkAndInstallPackages(list(packages1=c("ggplot2"), package2=c("ImageGP", "git_user/ImageGP"))) 26 | 27 | } 28 | -------------------------------------------------------------------------------- /man/clusterSampleHeatmap2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{clusterSampleHeatmap2} 4 | \alias{clusterSampleHeatmap2} 5 | \title{Compute and plot column correlation matrix. Normally used 6 | to do sample corealtion of gene expression or OTU abundance matrix.} 7 | \usage{ 8 | clusterSampleHeatmap2( 9 | mat, 10 | method = "pearson", 11 | digits = 4, 12 | cor_file = NULL, 13 | saveplot = NULL, 14 | ... 15 | ) 16 | } 17 | \arguments{ 18 | \item{mat}{A dataframe.} 19 | 20 | \item{method}{Type of correlation coefficient given to \code{\link{cor}}. 21 | Default "pearson".} 22 | 23 | \item{digits}{Number of decimial digits (given to \code{\link{round}}) to keep (default 4).} 24 | 25 | \item{cor_file}{Save ordered correlation matrix to given file name.} 26 | 27 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 28 | 29 | \item{...}{Additional parameters given to plot output (\code{\link{pdf}}, \code{\link{png}},...) like "width", "height", .etc.} 30 | } 31 | \value{ 32 | Nothing 33 | } 34 | \description{ 35 | Compute and plot column correlation matrix. Normally used 36 | to do sample corealtion of gene expression or OTU abundance matrix. 37 | } 38 | \examples{ 39 | 40 | df = generateAbundanceDF() 41 | clusterSampleHeatmap2(df) 42 | 43 | } 44 | -------------------------------------------------------------------------------- /man/clusterSamplePheatmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{clusterSamplePheatmap} 4 | \alias{clusterSamplePheatmap} 5 | \title{Compute and plot column correlation matrix. Normally used 6 | to do sample corealtion of gene expression or OTU abundance matrix.} 7 | \usage{ 8 | clusterSamplePheatmap( 9 | mat, 10 | method = "pearson", 11 | digits = 4, 12 | sampleAnno = NA, 13 | cellsize = NULL, 14 | cor_file = NULL, 15 | saveplot = NA, 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{mat}{A dataframe.} 21 | 22 | \item{method}{Type of correlation coefficient given to \code{\link{cor}}. 23 | Default "pearson".} 24 | 25 | \item{digits}{Number of decimial digits (given to \code{\link{round}}) to keep (default 4).} 26 | 27 | \item{sampleAnno}{Add sample attribute to plot. Accept a dataframe with 28 | rownames as "\code{colnames(mat)}".} 29 | 30 | \item{cor_file}{Save ordered correlation matrix to given file name.} 31 | 32 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 33 | 34 | \item{...}{Additional parameters given to \code{\link[pheatmap]{pheatmap}} like "width", "height", .etc.} 35 | 36 | \item{Size}{of cells. Default autodetect. This is used to get square plot.} 37 | } 38 | \value{ 39 | Nothing 40 | } 41 | \description{ 42 | Compute and plot column correlation matrix. Normally used 43 | to do sample corealtion of gene expression or OTU abundance matrix. 44 | } 45 | \examples{ 46 | 47 | df = generateAbundanceDF() 48 | clusterSamplePheatmap(df) 49 | 50 | } 51 | -------------------------------------------------------------------------------- /man/clusterSampleUpperTriPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{clusterSampleUpperTriPlot} 4 | \alias{clusterSampleUpperTriPlot} 5 | \title{Compute and plot column correlation matrix. Normally used 6 | to do sample corealtion of gene expression or OTU abundance matrix.} 7 | \usage{ 8 | clusterSampleUpperTriPlot( 9 | mat, 10 | method = "pearson", 11 | digits = 4, 12 | cor_file = NULL, 13 | saveplot = NULL, 14 | width = 13.5, 15 | height = 15, 16 | ... 17 | ) 18 | } 19 | \arguments{ 20 | \item{mat}{A dataframe.} 21 | 22 | \item{method}{Type of correlation coefficient given to \code{\link{cor}}. 23 | Default "pearson".} 24 | 25 | \item{digits}{Number of decimial digits (given to \code{\link{round}}) to keep (default 4).} 26 | 27 | \item{cor_file}{Save ordered correlation matrix to given file name.} 28 | 29 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 30 | 31 | \item{width}{Picture width in "cm".} 32 | 33 | \item{height}{Picture height in "cm".} 34 | 35 | \item{...}{Additional parameters given to \code{\link[ggplot2]{ggsave}}.} 36 | } 37 | \value{ 38 | A ggplot2 object 39 | } 40 | \description{ 41 | Compute and plot column correlation matrix. Normally used 42 | to do sample corealtion of gene expression or OTU abundance matrix. 43 | } 44 | \examples{ 45 | 46 | df = generateAbundanceDF() 47 | clusterSampleUpperTriPlot(df) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /man/dataFilter.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{dataFilter} 4 | \alias{dataFilter} 5 | \title{Filter low variance genes by given minimal \code{\link{mad}} value or keep top 6 | number/percent genes with bigger variances.} 7 | \usage{ 8 | dataFilter( 9 | datExpr, 10 | minimal_mad = NULL, 11 | top_mad_n = 0.75, 12 | rmVarZero = T, 13 | noLessThan = NULL, 14 | value_type = mad 15 | ) 16 | } 17 | \arguments{ 18 | \item{datExpr}{Normal gene expression matrix (gene x sample).} 19 | 20 | \item{minimal_mad}{Minimal allowed mad value.} 21 | 22 | \item{top_mad_n}{An integer larger than 1 will be used to get top x genes (like top 5000). 23 | A float number less than 1 will be used to get top x fraction genes (like top 0.7 of 24 | all genes).} 25 | 26 | \item{rmVarZero}{Default TRUE. Remove genes with variance as 0. Normally for PCA or 27 | correlation analysis.} 28 | 29 | \item{noLessThan}{Specify the lowest number of genes to be kept. Default \code{NULL} meaning no lower limit.} 30 | 31 | \item{value_type}{Specify the way for statistical computation. Default mad, accept mean, var.} 32 | } 33 | \value{ 34 | A dataframe. 35 | } 36 | \description{ 37 | Filter low variance genes by given minimal \code{\link{mad}} value or keep top 38 | number/percent genes with bigger variances. 39 | } 40 | \examples{ 41 | 42 | df = generateAbundanceDF(nSample=30, nGrp=3) 43 | dataFilter(df) 44 | 45 | } 46 | -------------------------------------------------------------------------------- /man/dataFilter2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{dataFilter2} 4 | \alias{dataFilter2} 5 | \title{Filter low variance genes by given minimal \code{\link{mad}} or \code{\link{var}} or 6 | other statistical value or keep top 7 | number/percent genes with bigger variances.} 8 | \usage{ 9 | dataFilter2( 10 | datExpr, 11 | minimal_threshold = NULL, 12 | top_n = 1, 13 | rmVarZero = F, 14 | noLessThan = NULL, 15 | statistical_value_type = mad, 16 | keep_filtered_as_others = F, 17 | fillna = NULL 18 | ) 19 | } 20 | \arguments{ 21 | \item{datExpr}{Normal gene expression matrix (gene x sample).} 22 | 23 | \item{minimal_threshold}{Minimal allowed statistical value.} 24 | 25 | \item{top_n}{An integer larger than 1 will be used to get top x genes (like top 5000). 26 | A float number less than 1 will be used to get top x fraction genes (like top 0.7 of 27 | all genes).} 28 | 29 | \item{rmVarZero}{Default TRUE. Remove genes with variance as 0. Normally for PCA or 30 | correlation analysis.} 31 | 32 | \item{noLessThan}{Specify the lowest number of genes to be kept. Default \code{NULL} meaning no lower limit.} 33 | 34 | \item{statistical_value_type}{Specify the way for statistical computation. Default mad, accept mean, var, sum, median.} 35 | 36 | \item{keep_filtered_as_others}{Get sums of all filtered items as an new item - Others. Default FALSE.} 37 | 38 | \item{fillna}{Fill NA with specified value.} 39 | } 40 | \value{ 41 | A dataframe. 42 | } 43 | \description{ 44 | Filter low variance genes by given minimal \code{\link{mad}} or \code{\link{var}} or 45 | other statistical value or keep top 46 | number/percent genes with bigger variances. 47 | } 48 | \examples{ 49 | 50 | df = generateAbundanceDF(nSample=30, nGrp=3) 51 | dataFilter2(df) 52 | 53 | } 54 | -------------------------------------------------------------------------------- /man/deseq2normalizedExpr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transcriptome.R 3 | \name{deseq2normalizedExpr} 4 | \alias{deseq2normalizedExpr} 5 | \title{To output normalized results to files named by given "output_prefix", 6 | and also return a list containing normalized counts for downstream analysis.} 7 | \usage{ 8 | deseq2normalizedExpr( 9 | dds, 10 | output_prefix = "ehbio", 11 | rlog = T, 12 | vst = F, 13 | savemat = T, 14 | design = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{dds}{\code{\link{salmon2deseq}} or \code{\link{readscount2deseq}} or 19 | \code{\link[DESeq2]{DESeq}} generated dataset.} 20 | 21 | \item{output_prefix}{A string, will be used as output file name prefix.} 22 | 23 | \item{rlog}{Get "rlog" transformed value for downstream correlation like analysis.} 24 | 25 | \item{vst}{Get "vst" transformed value for downstream correlation like analysis. Normally faster than "rlog".} 26 | 27 | \item{savemat}{Save normalized and rlog/vst matrix to file. Default T. 28 | The file would be named like \code{output_prefix.DESeq2.normalized.xls}, 29 | \code{output_prefix.DESeq2.normalized.rlog.xls}.} 30 | } 31 | \value{ 32 | A list containing normalized expression values and/or rlog, vst transformed normalized expression values. 33 | } 34 | \description{ 35 | To output normalized results to files named by given "output_prefix", 36 | and also return a list containing normalized counts for downstream analysis. 37 | } 38 | \examples{ 39 | 40 | nomrexpr <- deseq2normalizedExpr(dds) 41 | 42 | } 43 | -------------------------------------------------------------------------------- /man/dh.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/WGCNA.R 3 | \name{dh} 4 | \alias{dh} 5 | \title{Transfer day to hours} 6 | \usage{ 7 | dh(x) 8 | } 9 | \arguments{ 10 | \item{x}{A string like 1d,2d} 11 | } 12 | \value{ 13 | A number 14 | } 15 | \description{ 16 | Transfer day to hours 17 | } 18 | \examples{ 19 | 20 | dh('1d') 21 | 22 | } 23 | -------------------------------------------------------------------------------- /man/draw_colnames_custom.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_pheatmap.R 3 | \name{draw_colnames_custom} 4 | \alias{draw_colnames_custom} 5 | \title{Pheatmap function only for inner usages} 6 | \usage{ 7 | draw_colnames_custom(coln, gaps, xtics_angle = 0, ...) 8 | } 9 | \arguments{ 10 | \item{coln}{Nothing} 11 | 12 | \item{gaps}{Nothing} 13 | 14 | \item{xtics_angle}{Nothing} 15 | 16 | \item{...}{Nothing} 17 | } 18 | \value{ 19 | A grob 20 | } 21 | \description{ 22 | Pheatmap function only for inner usages 23 | } 24 | \examples{ 25 | 26 | #Ignore 27 | 28 | } 29 | -------------------------------------------------------------------------------- /man/enrichCustomizedPathway.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/enrich.R 3 | \name{enrichCustomizedPathway} 4 | \alias{enrichCustomizedPathway} 5 | \title{Enrichment of customrized pathway or annotation for any organism.} 6 | \usage{ 7 | enrichCustomizedPathway( 8 | de_file, 9 | anno_file, 10 | output_prefix = NULL, 11 | pvalueCutoff = 0.05, 12 | qvalueCutoff = 0.2 13 | ) 14 | } 15 | \arguments{ 16 | \item{de_file}{Two columns file with first column containing DE genes and second column with group names.} 17 | 18 | \item{anno_file}{Two columns file with first column of annotations or pathways and second columns of genes within this annotation or pathway.} 19 | 20 | \item{output_prefix}{Output prefix.} 21 | 22 | \item{pvalueCutoff}{Default 0.05} 23 | 24 | \item{qvalueCutoff}{Default 0.2} 25 | 26 | \item{setReadable}{Transfer gene ids to gene symbol. Default True.} 27 | 28 | \item{typeL}{A vector with default ad c("BP", "MF", "CC").} 29 | } 30 | \description{ 31 | Enrichment of customrized pathway or annotation for any organism. 32 | } 33 | \examples{ 34 | enrichCustomizedPathway(de_file, output_prefix=output_prefix) 35 | } 36 | -------------------------------------------------------------------------------- /man/enrichGO_model.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/enrich.R 3 | \name{enrichGO_model} 4 | \alias{enrichGO_model} 5 | \title{GO enrichment for model organism.} 6 | \usage{ 7 | enrichGO_model( 8 | de_file, 9 | org_db = "org.Hs.eg.db", 10 | output_prefix = NULL, 11 | pvalueCutoff = 0.05, 12 | qvalueCutoff = 0.2, 13 | setReadable = TRUE, 14 | typeL = c("BP", "MF", "CC") 15 | ) 16 | } 17 | \arguments{ 18 | \item{de_file}{Two columns file with first column containing DE genes and second column with group names.} 19 | 20 | \item{org_db}{R annotation package like org.Hs.eg.db.} 21 | 22 | \item{output_prefix}{Output prefix.} 23 | 24 | \item{pvalueCutoff}{Default 0.05} 25 | 26 | \item{qvalueCutoff}{Default 0.2} 27 | 28 | \item{setReadable}{Transfer gene ids to gene symbol. Default True.} 29 | 30 | \item{typeL}{A vector with default ad c("BP", "MF", "CC").} 31 | } 32 | \description{ 33 | GO enrichment for model organism. 34 | } 35 | \examples{ 36 | enrichGO_model(de_file, output_prefix=output_prefix) 37 | } 38 | -------------------------------------------------------------------------------- /man/enrichKEGG_model.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/enrich.R 3 | \name{enrichKEGG_model} 4 | \alias{enrichKEGG_model} 5 | \title{KEGG enrichment for model organism.} 6 | \usage{ 7 | enrichKEGG_model( 8 | de_file, 9 | org_db = "org.Hs.eg.db", 10 | output_prefix = NULL, 11 | organism = "human", 12 | pvalueCutoff = 0.05, 13 | qvalueCutoff = 0.2, 14 | setReadable = TRUE 15 | ) 16 | } 17 | \arguments{ 18 | \item{org_db}{R annotation package like org.Hs.eg.db.} 19 | 20 | \item{output_prefix}{Output prefix.} 21 | 22 | \item{organism}{KEGG supported organisms like human, mouse.} 23 | 24 | \item{pvalueCutoff}{Default 0.05} 25 | 26 | \item{qvalueCutoff}{Default 0.2} 27 | 28 | \item{setReadable}{Transfer gene ids to gene symbol. Default True.} 29 | 30 | \item{Two}{columns file with first column containing DE genes and second column with group names.} 31 | } 32 | \value{ 33 | A dataframe containing top 10 enriched terms. 34 | } 35 | \description{ 36 | KEGG enrichment for model organism. 37 | } 38 | \examples{ 39 | enrichKEGG_model(de_file, output_prefix=output_prefix) 40 | } 41 | -------------------------------------------------------------------------------- /man/find_coordinates.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_pheatmap.R 3 | \name{find_coordinates} 4 | \alias{find_coordinates} 5 | \title{Pheatmap function only for inner usages} 6 | \usage{ 7 | find_coordinates(n, gaps, m = 1:n) 8 | } 9 | \arguments{ 10 | \item{n}{Nothing} 11 | 12 | \item{gaps}{Nothing} 13 | 14 | \item{m}{Nothing} 15 | } 16 | \value{ 17 | A list 18 | } 19 | \description{ 20 | Pheatmap function only for inner usages 21 | } 22 | \examples{ 23 | 24 | #Ignore 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/flower_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/flowerplot.R 3 | \name{flower_plot} 4 | \alias{flower_plot} 5 | \title{Flower plot could be treated as one kind of venn diagram but only showing common items 6 | like OTUs or genes among all groups and total items (or total items excluding common 7 | items) for each group.} 8 | \usage{ 9 | flower_plot( 10 | input, 11 | sep = "\\t", 12 | row.names = NULL, 13 | header = T, 14 | quote = "", 15 | comment = "", 16 | check.names = F, 17 | item_variable = NULL, 18 | set_variable = NULL, 19 | start = 90, 20 | a = 0.5, 21 | b = 2, 22 | r = 1, 23 | group_color = "Spectral", 24 | group_color_alpha = 0.6, 25 | label_total_num_items = TRUE, 26 | saveplot = NULL, 27 | label = "core", 28 | common_color = "white", 29 | common_color_alpha = 1, 30 | saveppt = FALSE, 31 | ... 32 | ) 33 | } 34 | \arguments{ 35 | \item{input}{Input data file (first line as header line, the first column is the name of 36 | genes or OTUs or otehr things one wants to compare, the second column is the group name which genes belong to, 37 | tab seperated) 38 | 39 | \if{html}{\out{
}}\preformatted{Gene Sample 40 | g1 Set1 41 | a1 Set3 42 | b4 Set1 43 | . 44 | . 45 | c1 Set3 46 | }\if{html}{\out{
}}} 47 | 48 | \item{start}{Start position of first ellipse. Default 90 represents starting from 0 clock.} 49 | 50 | \item{a, b}{ 51 | Vectors, radii of the ellypses along the two axes in user units. 52 | } 53 | 54 | \item{r}{Set the size of the center circle.} 55 | 56 | \item{group_color}{Set the color of the petal ellipse (each group), with input format,like:c('#6181BD4E','#F348004E','#64A10E4E'...) or 57 | supply a RColorBrewer color set like "Set1", "Set2", "Set3", "YlOrRd" 58 | (check http://www.sthda.com/english/wiki/colors-in-r for more).} 59 | 60 | \item{group_color_alpha}{The transparency of each ellipse color. Default 0.6.} 61 | 62 | \item{label_total_num_items}{Label total number of items in for each group (when True) or label number of items in each group 63 | after substracting numbe of common items.} 64 | 65 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 66 | 67 | \item{label}{The name of the center circle.} 68 | 69 | \item{common_color}{The color of the center circle. Default "white".} 70 | 71 | \item{...}{Parameters givento \code{\link{base_plot_save}}} 72 | 73 | \item{common_col_alpha}{The transparency of common circle color. Default 0.6.} 74 | } 75 | \value{ 76 | An image 77 | } 78 | \description{ 79 | Flower plot could be treated as one kind of venn diagram but only showing common items 80 | like OTUs or genes among all groups and total items (or total items excluding common 81 | items) for each group. 82 | } 83 | \examples{ 84 | 85 | flowerinput <- "test.file" 86 | flower(flowerinput) 87 | 88 | } 89 | -------------------------------------------------------------------------------- /man/flower_plot_inner.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/flowerplot.R 3 | \name{flower_plot_inner} 4 | \alias{flower_plot_inner} 5 | \title{Flower plot could be treated as one kind of venn diagram but only showing common items 6 | like OTUs or genes among all groups and total items (or total items excluding common 7 | items) for each group.} 8 | \usage{ 9 | flower_plot_inner( 10 | sample, 11 | total_num, 12 | core_num, 13 | start = 90, 14 | a = 0.5, 15 | b = 2, 16 | r = 1, 17 | group_color = rgb(135, 206, 235, 150, max = 255), 18 | group_color_alpha = 0.6, 19 | common_color_alpha = 0.6, 20 | label = "core", 21 | common_color = "white", 22 | ... 23 | ) 24 | } 25 | \arguments{ 26 | \item{sample}{A vector of sample names. 27 | 28 | Like 29 | 30 | \if{html}{\out{
}}\preformatted{c("Grp1", "Grp2", "Grp3") 31 | }\if{html}{\out{
}}} 32 | 33 | \item{total_num}{Number of total or specififc items for each group. 34 | 35 | like 36 | 37 | \if{html}{\out{
}}\preformatted{c(20, 30, 40) 38 | }\if{html}{\out{
}}} 39 | 40 | \item{core_num}{Number of items common to all groups.} 41 | 42 | \item{start}{Start position of first ellipse. Default 90 represents starting from 0 clock.} 43 | 44 | \item{a, b}{ 45 | Vectors, radii of the ellypses along the two axes in user units. 46 | } 47 | 48 | \item{r}{Set the size of the center circle.} 49 | 50 | \item{group_color}{Set the color of the petal ellipse (each group), with input format,like:c('#6181BD4E','#F348004E','#64A10E4E'...) or 51 | supply a RColorBrewer color set like "Set1", "Set2", "Set3", "YlOrRd" 52 | (check http://www.sthda.com/english/wiki/colors-in-r for more).} 53 | 54 | \item{label}{The name of the center circle.} 55 | 56 | \item{common_color}{The color of the center circle. Default "white".} 57 | 58 | \item{...}{ 59 | Additional arguments passed to \code{\link{polygon}}. 60 | } 61 | } 62 | \value{ 63 | A pdf image. 64 | } 65 | \description{ 66 | Modified from http://blog.sciencenet.cn/blog-3406804-1159241.html 67 | } 68 | \details{ 69 | This function is not planned for public usages. 70 | } 71 | \examples{ 72 | flower_plot_inner(sample = sample_id, total_num = total_num, core_num = core_num) 73 | 74 | } 75 | -------------------------------------------------------------------------------- /man/generateAbundanceDF.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{generateAbundanceDF} 4 | \alias{generateAbundanceDF} 5 | \title{Generate gene expression table or otu abundance table with given samle information for test.} 6 | \usage{ 7 | generateAbundanceDF( 8 | type = "Gene", 9 | mean = 20, 10 | nGene = 15, 11 | nGrp = 2, 12 | nSample = 3 13 | ) 14 | } 15 | \arguments{ 16 | \item{type}{Generate gene expression or OTU abundance. Only affect rownames.} 17 | 18 | \item{mean}{Mean value of abundance given to \code{\link{rnorm}}.} 19 | 20 | \item{nGene}{Number of genes or OTUs.} 21 | 22 | \item{nGrp}{Number of sample groups.} 23 | 24 | \item{nSample}{Number of sample replications for each group.} 25 | 26 | \item{sd}{Standard deviations given to \code{\link{rnorm}}.} 27 | } 28 | \value{ 29 | A dataframe. 30 | } 31 | \description{ 32 | Generate gene expression table or otu abundance table with given samle information for test. 33 | } 34 | \examples{ 35 | 36 | df = generateAbundanceDF() 37 | 38 | } 39 | -------------------------------------------------------------------------------- /man/generate_color_list.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{generate_color_list} 4 | \alias{generate_color_list} 5 | \title{Generate color code} 6 | \usage{ 7 | generate_color_list( 8 | color, 9 | number, 10 | alpha = 1, 11 | constantColor = F, 12 | reverseColorList = F 13 | ) 14 | } 15 | \arguments{ 16 | \item{color}{Colors like c('red', 'blue', '#6181BD') or 17 | a RColorBrewer color set like "BrBG" "PiYG" "PRGn" "PuOr" 18 | "RdBu" "RdGy" "RdYlBu" "RdYlGn" "Spectral" "Accent" 19 | "Dark2" "Paired" "Pastel1" "Pastel2" "Set1" 20 | "Set2" "Set3" "Blues" "BuGn" "BuPu" 21 | "GnBu" "Greens" "Greys" "Oranges" "OrRd" "PuBu" 22 | "PuBuGn" "PuRd" "Purples" "RdPu" "Reds" 23 | "YlGn" "YlGnBu" "YlOrBr" "YlOrRd" 24 | (check http://www.sthda.com/english/wiki/colors-in-r for more).} 25 | 26 | \item{number}{Number of colors to return.} 27 | 28 | \item{alpha}{Generate an alpha transparency values for return colors. 0 means fully transparent and 1 means opaque. Default 1.} 29 | 30 | \item{reverseColorList}{Get the reverse of generated color list.} 31 | } 32 | \value{ 33 | A color vector 34 | } 35 | \description{ 36 | Generate color code 37 | } 38 | \examples{ 39 | 40 | generate_color_list('red', 5) 41 | generate_color_list(c('green', 'red'), 5) 42 | generate_color_list(c('green', 'red'), 5, alpha=0.5) 43 | generate_color_list("Set3", 5) 44 | 45 | } 46 | -------------------------------------------------------------------------------- /man/generate_shapes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{generate_shapes} 4 | \alias{generate_shapes} 5 | \title{Generate shape symbols for large number of groups for ggplot2} 6 | \usage{ 7 | generate_shapes(data, shape_variable) 8 | } 9 | \arguments{ 10 | \item{data}{A data frame} 11 | 12 | \item{shape_variable}{The variable treated as shape groups} 13 | } 14 | \value{ 15 | A vector contains all group symbols 16 | } 17 | \description{ 18 | Generate shape symbols for large number of groups for ggplot2 19 | } 20 | \examples{ 21 | 22 | # Not run 23 | 24 | } 25 | -------------------------------------------------------------------------------- /man/get_lower_tri.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{get_lower_tri} 4 | \alias{get_lower_tri} 5 | \title{Get lower triangle of the correlation matrix (from web)} 6 | \usage{ 7 | get_lower_tri(cormat) 8 | } 9 | \arguments{ 10 | \item{cormat}{A data frame} 11 | } 12 | \value{ 13 | A data frame 14 | } 15 | \description{ 16 | Get lower triangle of the correlation matrix (from web) 17 | } 18 | \examples{ 19 | 20 | df = generateAbundanceDF() 21 | df_cor = Matrix2colCorrelation(df) 22 | get_lower_tri(df_cor) 23 | 24 | } 25 | -------------------------------------------------------------------------------- /man/get_matched_columns_based_on_value.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{get_matched_columns_based_on_value} 4 | \alias{get_matched_columns_based_on_value} 5 | \title{Detect pairs of columns with same unique values (order does not matter) in two dataframes.} 6 | \usage{ 7 | get_matched_columns_based_on_value( 8 | df1, 9 | df2, 10 | only_allow_one_match = F, 11 | treat_fully_contain_as_identical = T 12 | ) 13 | } 14 | \arguments{ 15 | \item{df1}{Dataframe1} 16 | 17 | \item{df2}{Dataframe2} 18 | 19 | \item{only_allow_one_match}{Default FALSE. This parameters is designed to get only one pair of matched columns 20 | between two dataframes to supply as parameters for \link{merge} function (when TRUE).} 21 | } 22 | \value{ 23 | A dataframe containing names of matched columns. Or a vetor containing names of matched columns 24 | when \code{only_allow_one_match} is \code{TRUE} and there do have one match. 25 | } 26 | \description{ 27 | Detect pairs of columns with same unique values (order does not matter) in two dataframes. 28 | } 29 | \examples{ 30 | 31 | vec1 <- data.frame(col1=c('a','a','b','d'), a=c(1,2,3,4)) 32 | vec2 <- data.frame(col2=c('d','d','a','b'), b=c(1,2,4,5),a=c(1,2,3,4)) 33 | get_matched_columns_based_on_value(vec1, vec2) 34 | 35 | # match_1 match_2 36 | # DF1 col1 a 37 | # DF2 col2 a 38 | 39 | vec2 <- data.frame(col2=c('d','d','a','b')) 40 | get_matched_columns_based_on_value(vec1, vec2) 41 | 42 | # match_1 43 | # DF1 col1 44 | # DF2 col2 45 | 46 | get_matched_columns_based_on_value(vec1, vec2, only_allow_one_match = T) 47 | 48 | # "col1" "col2" 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /man/get_upper_tri.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{get_upper_tri} 4 | \alias{get_upper_tri} 5 | \title{Get upper triangle of the correlation matrix (from web)} 6 | \usage{ 7 | get_upper_tri(cormat) 8 | } 9 | \arguments{ 10 | \item{cormat}{A data frame} 11 | } 12 | \value{ 13 | A data fram 14 | } 15 | \description{ 16 | Get upper triangle of the correlation matrix (from web) 17 | } 18 | \examples{ 19 | 20 | df = generateAbundanceDF() 21 | df_cor = Matrix2colCorrelation(df) 22 | get_upper_tri(df_cor) 23 | 24 | } 25 | -------------------------------------------------------------------------------- /man/ggsci_to_json.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{ggsci_to_json} 4 | \alias{ggsci_to_json} 5 | \title{GGSCI object for json} 6 | \usage{ 7 | ggsci_to_json() 8 | } 9 | \value{ 10 | A color vector 11 | } 12 | \description{ 13 | GGSCI object for json 14 | } 15 | \examples{ 16 | 17 | ggsci_to_json() 18 | 19 | } 20 | -------------------------------------------------------------------------------- /man/match_two_df.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{match_two_df} 4 | \alias{match_two_df} 5 | \title{Extract same rows of two data.frame with same order.} 6 | \usage{ 7 | match_two_df(df1, df2, way = "row-row") 8 | } 9 | \arguments{ 10 | \item{df1}{Dataframe 1} 11 | 12 | \item{df2}{Dataframe 2} 13 | 14 | \item{way}{\code{row-row (default)}: Extract same rows of two data.frame with same order. 15 | \code{col-row}: Extarct same columns in df1 with rows in df2 and with same order} 16 | } 17 | \value{ 18 | A list in format like list(df1=df1, df2=df2) 19 | } 20 | \description{ 21 | Extract same rows of two data.frame with same order. 22 | } 23 | \examples{ 24 | 25 | NULL 26 | 27 | } 28 | -------------------------------------------------------------------------------- /man/merge_data_with_auto_matched_column.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{merge_data_with_auto_matched_column} 4 | \alias{merge_data_with_auto_matched_column} 5 | \title{Check matched columns between two data frames and try to merge them.} 6 | \usage{ 7 | merge_data_with_auto_matched_column(df1, df2, ...) 8 | } 9 | \arguments{ 10 | \item{df1}{Dataframe 1} 11 | 12 | \item{df2}{Dataframe 2} 13 | 14 | \item{...}{Extra parameters given to \code{\link[base]{merge}}.} 15 | } 16 | \value{ 17 | merged dataframe 18 | } 19 | \description{ 20 | Check matched columns between two data frames and try to merge them. 21 | } 22 | \examples{ 23 | 24 | vec1 <- data.frame(col1=c('a','a','b','d'), a=c(1,2,3,6)) 25 | vec2 <- data.frame(col2=c('d','d','a','b'), b=c(1,2,4,5),a=c(1,2,3,4)) 26 | merge_data_with_auto_matched_column(vec1, vec2) 27 | 28 | } 29 | -------------------------------------------------------------------------------- /man/mixedToFloat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{mixedToFloat} 4 | \alias{mixedToFloat} 5 | \title{Transfer numeric string to numeric.} 6 | \usage{ 7 | mixedToFloat(x) 8 | } 9 | \arguments{ 10 | \item{x}{A string or a vector} 11 | } 12 | \value{ 13 | A number or a numeric vector 14 | } 15 | \description{ 16 | Transfer numeric string to numeric. 17 | } 18 | \examples{ 19 | 20 | mixedToFloat(3) 21 | 22 | mixedToFloat("-1/3") 23 | 24 | mixedToFloat(c("1","0.2","1/3","-1")) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/multipleGroupDEgenes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transcriptome.R 3 | \name{multipleGroupDEgenes} 4 | \alias{multipleGroupDEgenes} 5 | \title{DE genes analysis for multiple groups.} 6 | \usage{ 7 | multipleGroupDEgenes( 8 | dds, 9 | comparePairFile = NULL, 10 | design = "conditions", 11 | padj = 0.05, 12 | log2FC = 1, 13 | dropCol = c("lfcSE", "stat"), 14 | output_prefix = "ehbio", 15 | normalized_counts = NULL, 16 | lfcShrink = FALSE, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{dds}{\code{\link{DESeq}} function returned object.} 22 | 23 | \item{comparePairFile}{A file containing sample groups for comparing. Optional. 24 | If not given, the function will use \code{colData} information in \code{dds} 25 | and perform group compare for all possible combinations. 26 | 27 | \if{html}{\out{
}}\preformatted{groupA groupB 28 | groupA groupC 29 | groupC groupB 30 | }\if{html}{\out{
}}} 31 | 32 | \item{design}{The group column name. Default "conditions".} 33 | 34 | \item{padj}{Multiple-test corrected p-value. Default 0.05.} 35 | 36 | \item{log2FC}{Log2 transformed fold change. Default 1.} 37 | 38 | \item{dropCol}{Columns to drop in final output. Default \code{c("lfcSE", "stat")}. 39 | Other options \code{"ID", "baseMean", "log2FoldChange", "lfcSE", "stat", "pvalue", "padj"}. 40 | This has no specific usages except make the table clearer.} 41 | 42 | \item{output_prefix}{A string as prefix of output files.} 43 | 44 | \item{normalized_counts}{a data matrix of normalized counts or an object return by \link{deseq2normalizedExpr}. Default NULL.} 45 | 46 | \item{...}{Additional parameters given to \code{\link{ggsave}}.} 47 | } 48 | \description{ 49 | DE genes analysis for multiple groups. 50 | } 51 | \examples{ 52 | 53 | multipleGroupDEgenes(dds) 54 | 55 | } 56 | -------------------------------------------------------------------------------- /man/normalizedExpr2DistribBoxplot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transcriptome.R 3 | \name{normalizedExpr2DistribBoxplot} 4 | \alias{normalizedExpr2DistribBoxplot} 5 | \title{Plot distribution of normalzied expression to check the normalization effect of DESeq2.} 6 | \usage{ 7 | normalizedExpr2DistribBoxplot(normexpr, saveplot = NULL, ...) 8 | } 9 | \arguments{ 10 | \item{normexpr}{A list returned by \code{\link{deseq2normalizedExpr}}.} 11 | 12 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 13 | 14 | \item{...}{Additional parameters given to \code{\link{ggsave}}.} 15 | } 16 | \value{ 17 | A ggplot2 object 18 | } 19 | \description{ 20 | Plot distribution of normalzied expression to check the normalization effect of DESeq2. 21 | } 22 | \examples{ 23 | 24 | 25 | normexpr <- deseq2normalizedExpr(dds) 26 | normalizedExpr2DistribBoxplo(normexpr) 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /man/numCheck.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{numCheck} 4 | \alias{numCheck} 5 | \title{Check if given string or vector is all numeric} 6 | \usage{ 7 | numCheck(x) 8 | } 9 | \arguments{ 10 | \item{x}{A string or a vector} 11 | } 12 | \value{ 13 | TRUE or FALSE 14 | } 15 | \description{ 16 | Check if given string or vector is all numeric 17 | } 18 | \examples{ 19 | 20 | numCheck(3) 21 | 22 | numCheck("-1/3") 23 | 24 | numCheck(c("1","0.2","1/3","-1")) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/pca_run.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pca.R 3 | \name{pca_run} 4 | \alias{pca_run} 5 | \title{Title} 6 | \usage{ 7 | pca_run(rlogMat, sample, ehbio_output_prefix) 8 | } 9 | \arguments{ 10 | \item{rlogMat}{xx} 11 | 12 | \item{sample}{xx} 13 | 14 | \item{ehbio_output_prefix}{xx} 15 | } 16 | \value{ 17 | xx 18 | } 19 | \description{ 20 | Title 21 | } 22 | \examples{ 23 | 24 | pca_run(data) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/rankPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{rankPlot} 4 | \alias{rankPlot} 5 | \title{Rankplot for given column.} 6 | \usage{ 7 | rankPlot( 8 | data, 9 | order_col = "log2FoldChange", 10 | midpoint = 0, 11 | saveplot = NULL, 12 | label = NULL, 13 | alpha = 0.5, 14 | colorvector = c("green", "yellow", "red"), 15 | width = 13.5, 16 | height = 15, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{data}{A dataframe with effective row names.} 22 | 23 | \item{order_col}{Specify which column would be used for plot. Default "log2FoldChange".} 24 | 25 | \item{midpoint}{Specify the midpoint for color show. Default 0.} 26 | 27 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 28 | 29 | \item{label}{Label points. Accept a number to get top x points to label (both directions). 30 | Or a vector matched with rownames of dataframe to label specified points. 31 | Or a named vector to label specified points with new names.} 32 | 33 | \item{alpha}{Transparency value.} 34 | 35 | \item{colorvector}{A vector with length 2 to speicfy low and high colors. 36 | Or a vector with length 3 to specify low, middle and high colors. 37 | Default \code{c("green","yellow","red")}.} 38 | 39 | \item{width}{Picture width in "cm".} 40 | 41 | \item{height}{Picture height in "cm".} 42 | 43 | \item{...}{Additional parameters given to \code{\link[pheatmap]{pheatmap}} 44 | like "width", "height", .etc.} 45 | } 46 | \value{ 47 | A ggplot2 object 48 | } 49 | \description{ 50 | Rankplot for given column. 51 | } 52 | \examples{ 53 | 54 | a <- data.frame(log2FoldChange=rnorm(1000), row.names=paste0("ImageGP",1:1000)) 55 | 56 | ## Raw plot 57 | 58 | rankPlot(a) 59 | 60 | ## Label top 10 61 | 62 | rankPlot(a, label=10) 63 | 64 | ## Label specified points 65 | 66 | rankPlot(a, label=c("ImageGP1","ImageGP2","ImageGP10")) 67 | 68 | ## Label specified points with new names 69 | 70 | b <- c("A","B","C") 71 | names(b) <- c("ImageGP1","ImageGP2","ImageGP10") 72 | rankPlot(a, label=b) 73 | 74 | } 75 | -------------------------------------------------------------------------------- /man/readscount2deseq.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transcriptome.R 3 | \name{readscount2deseq} 4 | \alias{readscount2deseq} 5 | \title{Iniitialize a DESeq2 object from raw reads count matrix.} 6 | \usage{ 7 | readscount2deseq( 8 | count_matrix_file, 9 | sampleFile, 10 | design, 11 | covariate = NULL, 12 | filter = NULL, 13 | rundeseq = T 14 | ) 15 | } 16 | \arguments{ 17 | \item{count_matrix_file}{A multiple column file with the first column as gene 18 | names (must be unique) and other columns as gene expression reads count in 19 | related samples. 20 | 21 | \if{html}{\out{
}}\preformatted{Gene untrt_N61311 untrt_N052611 ... trt_N61311 trt_N052611 ... 22 | GeneA 2 3 ... 10 20 ... 23 | GeneB 2 3 ... 100 220 ... 24 | GeneC 12 33 ... 10 20 ... 25 | GeneD 222 301 ... 10 20 ... 26 | }\if{html}{\out{
}}} 27 | 28 | \item{sampleFile}{A file containing at least two columns. The first column is sample name just 29 | like the first column of \code{salmon_file_list}. Other columns are sample attributes. 30 | Normally one of sample attributes should contain the group information each sample belongs to. 31 | 32 | One simple example (conditions represent group information) 33 | 34 | \if{html}{\out{
}}\preformatted{Samp conditions 35 | untrt_N61311 untrt 36 | untrt_N052611 untrt 37 | untrt_N080611 untrt 38 | untrt_N061011 untrt 39 | trt_N61311 trt 40 | trt_N052611 trt 41 | trt_N080611 trt 42 | trt_N061011 trt 43 | }\if{html}{\out{
}} 44 | 45 | Another example (3rd column meaning samples from two batches) 46 | 47 | \if{html}{\out{
}}\preformatted{Samp conditions batch 48 | untrt_N61311 untrt A 49 | untrt_N052611 untrt A 50 | untrt_N080611 untrt B 51 | untrt_N061011 untrt B 52 | trt_N61311 trt A 53 | trt_N052611 trt A 54 | trt_N080611 trt B 55 | trt_N061011 trt B 56 | }\if{html}{\out{
}}} 57 | 58 | \item{design}{A column name from "sampleFile" like "conditions" in example. 59 | This will be used as group variable for DE tests. Currently only simple 60 | design is allowed. If one wants to model multiple variables, construct 61 | one representation of super variable as indicated in 62 | \url{https://support.bioconductor.org/p/67600/#67612} may be useful.} 63 | 64 | \item{covariate}{Names of columns containing informations maybe covariates 65 | like batch effects or other sample info. Multiple covariates should be 66 | supplied as a vector.} 67 | 68 | \item{filter}{Filter genes with low read counts. Default genes with total 69 | reads count lower than half of number of samples will be filtered out. 70 | One can give any number here. Normally default is OK. The DESeq2 will ao 71 | auto filter too. Check \url{https://www.bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html}.} 72 | 73 | \item{rundeseq}{Default \code{TRUE}. The function will perfrom deseq analysis 74 | using \code{\link[DESeq2]{DESeq}} and return analyzed DESeqDataSet object. 75 | If \code{FALSE}, just return a DESeqDataSet object and one can 76 | run \code{\link[DESeq2]{DESeq}}on it with more customed parameters.} 77 | } 78 | \value{ 79 | A DESeqDataSet object. 80 | } 81 | \description{ 82 | Iniitialize a DESeq2 object from raw reads count matrix. 83 | } 84 | \examples{ 85 | 86 | 87 | dds <- readscount2deseq(count_matrix_file, sampleFile, "conditions") 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /man/shapiro.test2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statistics.R 3 | \name{shapiro.test2} 4 | \alias{shapiro.test2} 5 | \title{An inner version of \code{shapiro.test} with two modifications.} 6 | \usage{ 7 | shapiro.test2(data, threshold = 1000) 8 | } 9 | \arguments{ 10 | \item{data}{A vector of observation values.} 11 | 12 | \item{threshold}{A number to define \strong{large} sample size. Default \code{1000}. For data with 13 | more than given \code{threshold} samples, always assume they past normality test,} 14 | } 15 | \value{ 16 | A logical value 17 | } 18 | \description{ 19 | \itemize{ 20 | \item Always return FALSE for sample size less than 3. 21 | \item Always return TRUE for sample size larger than given threshold (default 1000) 22 | } 23 | } 24 | \examples{ 25 | 26 | shapiro.test2(c(1,2,3,4)) 27 | 28 | } 29 | -------------------------------------------------------------------------------- /man/sp.is.null.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp.is.null} 4 | \alias{sp.is.null} 5 | \title{Check Null Object} 6 | \usage{ 7 | sp.is.null(x) 8 | } 9 | \arguments{ 10 | \item{x}{\code{NULL} object or \code{'null'} string} 11 | } 12 | \value{ 13 | True when x is \code{NULL} or \code{"NULL"} (case insensitive for character type) 14 | } 15 | \description{ 16 | Check Null Object 17 | } 18 | \examples{ 19 | 20 | sp.is.null('NULL') 21 | 22 | } 23 | -------------------------------------------------------------------------------- /man/sp_EulerDiagrams.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_EulerDiagrams.R 3 | \name{sp_EulerDiagrams} 4 | \alias{sp_EulerDiagrams} 5 | \title{Generate Euler diagrams (proposional)} 6 | \usage{ 7 | sp_EulerDiagrams( 8 | data, 9 | format = "items", 10 | intersection_variable = NULL, 11 | count_variable = NULL, 12 | item_variable = NULL, 13 | set_variable = NULL, 14 | type = c("counts"), 15 | shape = "circle", 16 | manual_color_vector = NULL, 17 | alpha = 1, 18 | legend.position = "right", 19 | font_quantities = 1, 20 | lty = 1, 21 | labels_font = 1, 22 | saveplot = NULL, 23 | saveppt = FALSE, 24 | ... 25 | ) 26 | } 27 | \arguments{ 28 | \item{data}{One filename or dataframe containing data in specified formats with header line.} 29 | 30 | \item{format}{\code{items} or \code{counts} with format specified above.} 31 | 32 | \item{intersection_variable}{Only used when \code{format=counts} to specify which column 33 | contains different types of interactions. For example data, first column name \code{Intersection} 34 | should be given here. Color should be specified for the appearance order of each set.} 35 | 36 | \item{count_variable}{Only used when \code{format=counts} to specify which column 37 | contains computed counts for different types of interactions. For example data, 38 | first column name \code{Count} should be given here.} 39 | 40 | \item{item_variable}{Only used when \code{format=items} to specify which column 41 | contains all items like genes or OTUs or species. For example data, first column 42 | name \code{Items} should be given here.} 43 | 44 | \item{set_variable}{Only used when \code{format=items} to specify which column 45 | contains group information of items. For example data, second column 46 | name \code{Group} should be given here. Color should be specified for the alphabetial 47 | order of each set.} 48 | 49 | \item{type}{Show \code{percent} or \code{counts} in the plot. Default \code{counts}.} 50 | 51 | \item{shape}{Use \code{circle} or \code{ellipse} in the plot. Default \code{circle}.} 52 | 53 | \item{alpha}{Generate an alpha transparency values for return colors. 0 means fully transparent and 1 means opaque. Default 1.} 54 | 55 | \item{legend.position}{Position of legend, accept top, bottom, left, right, none or c(0.8,0.8).} 56 | 57 | \item{font_quantities}{Font size for numbers in Euler plot. Default \code{1}.} 58 | 59 | \item{lty}{Line type of circle or ellipse edges from \code{1} to \code{6} represents \code{solid}, 60 | \code{dashed}, \code{dotted}, \code{dotdash}, \code{longdash} and \code{twodash} separately. Default \code{1}.} 61 | 62 | \item{labels_font}{Font size for labels in Euler plot. Default \code{1}.} 63 | 64 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 65 | 66 | \item{saveppt}{Output PPT format.} 67 | 68 | \item{...}{Other parameters given to base_plot_save} 69 | } 70 | \value{ 71 | a grid object 72 | } 73 | \description{ 74 | When \code{format} is \code{items}, \code{data} examples are 75 | 76 | \if{html}{\out{
}}\preformatted{Items Group 77 | g1 Set1 78 | g2 Set1 79 | a1 Set3 80 | a3 Set1 81 | b4 Set1 82 | g1 Set2 83 | h1 Set4 84 | }\if{html}{\out{
}} 85 | } 86 | \details{ 87 | When \code{format} is \code{counts}, \code{data} examples are 88 | 89 | \if{html}{\out{
}}\preformatted{Intersection Count 90 | Set1&Set2 2 91 | Set1&Set3&Set4&Set5 1 92 | Set3&Set5 2 93 | Set1 1 94 | Set2&Set4 1 95 | Set2&Set3&Set4 1 96 | Set2&Set5 1 97 | Set3 1 98 | Set5 1 99 | Set4&Set5 1 100 | Set4 2 101 | }\if{html}{\out{
}} 102 | } 103 | \examples{ 104 | 105 | NULL 106 | 107 | 108 | } 109 | -------------------------------------------------------------------------------- /man/sp_corrplot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_corrplot.R 3 | \name{sp_corrplot} 4 | \alias{sp_corrplot} 5 | \title{A visualization of a correlation matrix.} 6 | \usage{ 7 | sp_corrplot( 8 | data, 9 | method = "circle", 10 | type = "full", 11 | bg = "white", 12 | title = NULL, 13 | is.corr = FALSE, 14 | diag = TRUE, 15 | addCoef.col = NULL, 16 | addCoefasPercent = FALSE, 17 | order = "original", 18 | hclust.method = NULL, 19 | tl.pos = "n", 20 | tl.cex = 1, 21 | tl.col = "red", 22 | tl.srt = 90, 23 | cl.pos = NULL, 24 | cl.lim = NULL, 25 | cl.align.text = "c", 26 | saveplot = NULL, 27 | mar = c(0, 0, 0, 0), 28 | ... 29 | ) 30 | } 31 | \arguments{ 32 | \item{data}{Matrix or data file (with header line, the first column will be treated as row names, tab separated).} 33 | 34 | \item{method}{The visualization method of correlation matrix to be used. Currently, it supports seven methods, named "circle" (default), "square", "ellipse", "number", "pie", "shade" and "color".} 35 | 36 | \item{type}{Type, "full" (default), "upper" or "lower", display full matrix, lower triangular or upper triangular matrix.} 37 | 38 | \item{bg}{The background color.} 39 | 40 | \item{title}{Title of the graph.} 41 | 42 | \item{is.corr}{Logical, whether the input matrix is a correlation matrix or not. We can visualize the non-correlation matrix by setting is.corr = FALSE.} 43 | 44 | \item{diag}{Logical, whether display the correlation coefficients on the principal diagonal.} 45 | 46 | \item{addCoef.col}{Color of coefficients added on the graph. If NULL (default), add no coefficients.} 47 | 48 | \item{addCoefasPercent}{Logic, whether translate coefficients into percentage style for spacesaving.} 49 | 50 | \item{order}{The ordering method of the correlation matrix. "original" for original order (default). "AOE" for the angular order of the eigenvectors. "FPC" for the first principal component order. "hclust" for the hierarchical clustering order. "alphabet" for alphabetical order.} 51 | 52 | \item{hclust.method}{The agglomeration method to be used when order is hclust. This should be one of "ward", "ward.D", "ward.D2", "single", "complete", "average", "mcquitty", "median" or "centroid".} 53 | 54 | \item{tl.cex}{Numeric, for the size of text label (variable names).} 55 | 56 | \item{tl.col}{The color of text label.} 57 | 58 | \item{tl.srt}{Numeric, for text label string rotation in degrees.} 59 | 60 | \item{cl.pos}{Character or logical, position of color labels; If character, it must be one of "r" (default if type=="upper" or "full"), "b" (default if type=="lower") or "n", "n" means don't draw colorlabel.} 61 | 62 | \item{cl.lim}{The limits (x1, x2) in the colorlabel.} 63 | 64 | \item{cl.align.text}{"l", "c" (default) or "r", for number-label in colorlabel, "l" means left, "c" means center, and "r" means right.} 65 | 66 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 67 | 68 | \item{...}{} 69 | } 70 | \value{ 71 | a grid object 72 | } 73 | \description{ 74 | A visualization of a correlation matrix. 75 | } 76 | \examples{ 77 | data<-matrix(rnorm(100),nrow=20) 78 | rownames(data)<- paste0("corrtest", 1:20) 79 | colnames(data)<- paste0("zhou", 1:5) 80 | sp_corrplot(data, cl.align.text = "l") 81 | sp_corrplot(data,method="pie",type="lower",title="corrplot", cl.align.text = "l", mar=c(0,0,1,0)) 82 | sp_corrplot(data,method="ellipse",type="upper", cl.align.text = "l", tl.pos="td") 83 | } 84 | -------------------------------------------------------------------------------- /man/sp_current_time.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_current_time} 4 | \alias{sp_current_time} 5 | \title{Get current time in strign format} 6 | \usage{ 7 | sp_current_time(delim_left = "[", delim_right = "]") 8 | } 9 | \arguments{ 10 | \item{delim_left}{Default \code{[}.} 11 | 12 | \item{delim_right}{Default \verb{]}.} 13 | } 14 | \value{ 15 | A string 16 | } 17 | \description{ 18 | Get current time in strign format 19 | } 20 | \examples{ 21 | 22 | sp_current_time() 23 | 24 | } 25 | -------------------------------------------------------------------------------- /man/sp_dendextend.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_dendrogram.R 3 | \name{sp_dendextend} 4 | \alias{sp_dendextend} 5 | \title{Hierarchical cluster diagram} 6 | \usage{ 7 | sp_dendextend( 8 | data, 9 | group_variable = NULL, 10 | branch_order = NULL, 11 | method = "complete", 12 | k = k, 13 | labels_size = 0.5, 14 | shape = "tree", 15 | pic_title = NULL, 16 | pic_flip = TRUE, 17 | node_size = 0.007, 18 | legend_site = "topleft", 19 | saveplot = NULL, 20 | ... 21 | ) 22 | } 23 | \arguments{ 24 | \item{data}{A data frame.} 25 | 26 | \item{group_variable}{Specifies a column as group.} 27 | 28 | \item{branch_order}{Specify branch order.} 29 | 30 | \item{method}{The agglomeration method to be used. This should be (an unambiguous abbreviation of) one of "ward.D", "ward.D2", "single", "complete", "average" (= UPGMA), "mcquitty" (= WPGMA), "median" (= WPGMC) or "centroid" (= UPGMC).} 31 | 32 | \item{k}{Number of groups.} 33 | 34 | \item{labels_size}{Labels size.} 35 | 36 | \item{shape}{Tree or circles.} 37 | 38 | \item{pic_title}{Title of the graph.} 39 | 40 | \item{pic_flip}{TRUE for horizontal, FALSE for vertical. Default TRUE.} 41 | 42 | \item{node_size}{Node size.} 43 | 44 | \item{legend_site}{Legend site. Optional, "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center".} 45 | 46 | \item{...}{} 47 | } 48 | \description{ 49 | Hierarchical cluster diagram 50 | } 51 | \examples{ 52 | data<-matrix(rnorm(200),nrow = 50) 53 | rownames(data)<- paste0("dendextend", 1:50) 54 | colnames(data)<- paste0("zhou", 1:4) 55 | sp_dendextend(data = data,k = 3,labels_size = 0.3) 56 | 57 | 58 | data<- data.frame(ID = letters[1:5], apple = runif(50), banana = runif(50), watermelon = runif(50)) 59 | sp_dendextend(data = data, k = 5, method = "single", shape = "circle") 60 | 61 | } 62 | -------------------------------------------------------------------------------- /man/sp_determine_log_add.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_determine_log_add} 4 | \alias{sp_determine_log_add} 5 | \title{Determine the value to add befor log transform.} 6 | \usage{ 7 | sp_determine_log_add(data, ratio = 1) 8 | } 9 | \arguments{ 10 | \item{data}{A numerical dataframe or a vector} 11 | 12 | \item{ratio}{Minimum non-zero value would be used as add values. if \code{ratio} specified, 13 | the detected minimum non-zero multiple ratio would be returned.} 14 | } 15 | \value{ 16 | A numericalvalue 17 | } 18 | \description{ 19 | Determine the value to add befor log transform. 20 | } 21 | \examples{ 22 | 23 | sp_determine_log_add(c(1,2,3)) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /man/sp_diff_test.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statistics.R 3 | \name{sp_diff_test} 4 | \alias{sp_diff_test} 5 | \title{Perform statistical test using given methods.} 6 | \usage{ 7 | sp_diff_test( 8 | data, 9 | stat_value_variable, 10 | stat_group_variable, 11 | statistical_method = "aov", 12 | add_y = TRUE, 13 | statistical_threshold_for_letters = 0.05 14 | ) 15 | } 16 | \arguments{ 17 | \item{data}{A data matrix} 18 | 19 | \item{stat_value_variable}{The column represents the statistical value information.} 20 | 21 | \item{stat_group_variable}{The column represents the statistical group information.} 22 | 23 | \item{statistical_method}{Statistical method. For two groups, default . For more than two groups, default \if{html}{\out{}}.} 24 | 25 | \item{add_y}{Add positions for each statistical label.} 26 | 27 | \item{statistical_threshold_for_letters}{Threshold for treating as significance, default 0.05.} 28 | } 29 | \value{ 30 | A list. list(data=data, a data frame with statistical information, Tukey_HSD=Tukey_HSD) 31 | } 32 | \description{ 33 | Perform statistical test using given methods. 34 | } 35 | \examples{ 36 | NULL 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /man/sp_get_ggplot_limits.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_get_ggplot_limits} 4 | \alias{sp_get_ggplot_limits} 5 | \title{Get the x, y limits of a ggplot2 plot} 6 | \usage{ 7 | sp_get_ggplot_limits(p) 8 | } 9 | \arguments{ 10 | \item{p}{A ggplot2 object} 11 | } 12 | \value{ 13 | A list list(xmin = xmin, xmax = xmax, ymin = ymin, ymax = ymax) 14 | } 15 | \description{ 16 | Get the x, y limits of a ggplot2 plot 17 | } 18 | \examples{ 19 | ## Not run: 20 | sp_get_ggplot_limits(p) 21 | 22 | ## End(Not run) 23 | } 24 | -------------------------------------------------------------------------------- /man/sp_ggplot_add_vline_hline.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_ggplot_add_vline_hline} 4 | \alias{sp_ggplot_add_vline_hline} 5 | \title{Add hline or vline for ggplot2 object} 6 | \usage{ 7 | sp_ggplot_add_vline_hline( 8 | p, 9 | custom_vline_x_position = NULL, 10 | custom_vline_anno = NULL, 11 | custom_vline_anno_y_pos = NULL, 12 | custom_hline_y_position = NULL, 13 | custom_hline_anno = NULL, 14 | custom_hline_anno_x_pos = NULL, 15 | linetype = "dotted", 16 | size = 0.5, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{p}{A ggplot2 object} 22 | 23 | \item{custom_vline_x_position}{A vector of coordinates for vertical lines.} 24 | 25 | \item{custom_vline_anno}{Annotation text for each vertical line.} 26 | 27 | \item{custom_hline_y_position}{A vector of coordinates for horizontal lines.} 28 | 29 | \item{custom_hline_anno}{Annotation text for each horizontal line.} 30 | 31 | \item{...}{Extra parameters given to \code{geom_vline} and \code{geom_hline}} 32 | } 33 | \value{ 34 | A ggplot2 object 35 | } 36 | \description{ 37 | Add hline or vline for ggplot2 object 38 | } 39 | \examples{ 40 | 41 | ## Not run: 42 | sp_ggplot_add_vline_hline(p) 43 | 44 | ## End(Not run) 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /man/sp_ggplot_facet.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_ggplot_facet} 4 | \alias{sp_ggplot_facet} 5 | \title{Facet ggplot2 object} 6 | \usage{ 7 | sp_ggplot_facet( 8 | p, 9 | facet_variable = NULL, 10 | facet_ncol = NULL, 11 | facet_nrow = NULL, 12 | facet_scales = "fixed" 13 | ) 14 | } 15 | \arguments{ 16 | \item{p}{A ggplot2 object} 17 | 18 | \item{facet_variable}{Wrap plots by given column (one of column names should be specified). 19 | This is used to put multiple plot in one picture.} 20 | 21 | \item{facet_ncol}{The number of columns one want when \code{facet} is used. Default NULL.} 22 | 23 | \item{facet_nrow}{The number of rows one want when \code{facet} is used. Default NULL.} 24 | 25 | \item{facet_scales}{Paramter for scales for facet. Default \code{fixed} meaning each inner graph 26 | use same scale (x,y range), \code{free} (variable x, y ranges for each sub-plot), 27 | \code{free_x} (variable x ranges for each sub-plot), \code{free_y} (variable y ranges for each sub-plot).} 28 | } 29 | \value{ 30 | A ggplot2 object 31 | } 32 | \description{ 33 | Facet ggplot2 object 34 | } 35 | \examples{ 36 | 37 | ## Not run: 38 | sp_ggplot_facet(p, facet_variable) 39 | 40 | ## End(Not run) 41 | 42 | } 43 | -------------------------------------------------------------------------------- /man/sp_ggplot_layout.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_ggplot_layout} 4 | \alias{sp_ggplot_layout} 5 | \title{Change common layout of ggplot2 object} 6 | \usage{ 7 | sp_ggplot_layout( 8 | p, 9 | xtics_angle = 0, 10 | legend.position = "right", 11 | extra_ggplot2_cmd = NULL, 12 | filename = NULL, 13 | x_label = NULL, 14 | y_label = NULL, 15 | title = NULL, 16 | coordinate_flip = FALSE, 17 | ylim = NULL, 18 | width = 12, 19 | height = 6.18, 20 | fontname = "", 21 | base_font_size = 10, 22 | additional_theme = NULL, 23 | zoom_split = FALSE, 24 | zoom_xlim = NULL, 25 | zoom_ylim = NULL, 26 | saveppt = FALSE, 27 | savehtml = FALSE, 28 | ... 29 | ) 30 | } 31 | \arguments{ 32 | \item{p}{A ggplot2 object} 33 | 34 | \item{xtics_angle}{Rotation angle for a-axis. Default 0.} 35 | 36 | \item{legend.position}{Position of legend, accept top, bottom, left, right, none or c(0.8,0.8).} 37 | 38 | \item{extra_ggplot2_cmd}{Extra ggplot2 commands (currently unsupported)} 39 | 40 | \item{filename}{Output picture to given file.} 41 | 42 | \item{x_label}{Xlab label.} 43 | 44 | \item{y_label}{Ylab label.} 45 | 46 | \item{title}{Title of picture.} 47 | 48 | \item{coordinate_flip}{Flip cartesian coordinates so that horizontal becomes vertical, and vertical, horizontal. This is primarily useful for converting geoms and statistics which display y conditional on x, to x conditional on y.} 49 | 50 | \item{width}{Picture width (units: cm)} 51 | 52 | \item{height}{Picture height (units: cm)} 53 | 54 | \item{zoom_split}{If both x and y is given, should each axis zoom be shown separately as well? Defaults to FALSE.} 55 | 56 | \item{zoom_xlim}{Specific zoom ranges for x axis.} 57 | 58 | \item{zoom_ylim}{Specific zoom ranges for y axis.} 59 | 60 | \item{saveppt}{Output PPT format.} 61 | 62 | \item{savehtml}{Save the images as HTML files.} 63 | 64 | \item{...}{Extra parameters to \code{\link[ggplot2]{ggsave}}.} 65 | } 66 | \value{ 67 | A ggplot2 object 68 | } 69 | \description{ 70 | Change common layout of ggplot2 object 71 | } 72 | \examples{ 73 | 74 | ## Not run: 75 | sp_ggplot_layout(p) 76 | 77 | ## End(Not run) 78 | 79 | } 80 | -------------------------------------------------------------------------------- /man/sp_hclust.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_hclust.R 3 | \name{sp_hclust} 4 | \alias{sp_hclust} 5 | \title{Hierarchical cluster diagram} 6 | \usage{ 7 | sp_hclust( 8 | data, 9 | method = "average", 10 | thresholdZ.k = -2.5, 11 | saveplot = NULL, 12 | debug = FALSE, 13 | ... 14 | ) 15 | } 16 | \arguments{ 17 | \item{data}{A matrix file or an object.} 18 | 19 | \item{method}{Clustering method :"ward.D", "single", "complete", "average", "mcquitty", "median", "centroid", "ward.D2"} 20 | 21 | \item{thresholdZ.k}{Threshold for defining outliers. First compute the overall 22 | corelation of one sample to other samples. Then do Z-score transfer for all 23 | correlation values. The samples with corelation values less than given value 24 | would be treated as outliers. 25 | Default -2.5 meaning -2.5 std.} 26 | 27 | \item{...}{} 28 | } 29 | \value{ 30 | A data frame. 31 | } 32 | \description{ 33 | Hierarchical cluster diagram 34 | } 35 | \examples{ 36 | x = runif(10) 37 | y = runif(10) 38 | data=cbind(x, y) 39 | rownames(data) = paste("exam", 1:10) 40 | sp_hclust(data) 41 | 42 | } 43 | -------------------------------------------------------------------------------- /man/sp_load_font.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_load_font} 4 | \alias{sp_load_font} 5 | \title{Use showtext to load fonts} 6 | \usage{ 7 | sp_load_font(font_path) 8 | } 9 | \arguments{ 10 | \item{font_path}{Specify font type. Give a path for one font type file 11 | like '/etc/fonts/Arial.ttf' 12 | or 'HeiArial.ttc'(if in current directory), Default system default.} 13 | } 14 | \value{ 15 | font_name or null 16 | } 17 | \description{ 18 | Use showtext to load fonts 19 | } 20 | \examples{ 21 | 22 | ## Not run: 23 | sp_load_font(font_path="arial.tff") 24 | 25 | ## End(Not run) 26 | 27 | } 28 | -------------------------------------------------------------------------------- /man/sp_manhattan2_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_manhattan2.R 3 | \name{sp_manhattan2_plot} 4 | \alias{sp_manhattan2_plot} 5 | \title{Generating manhattan plot} 6 | \usage{ 7 | sp_manhattan2_plot( 8 | data, 9 | ID_var = "ID", 10 | FDR_var = "FDR", 11 | grp_var = "Phylum", 12 | sig_col = "level", 13 | status_col_level = c(), 14 | pvalue = 0.05, 15 | shape_col = NULL, 16 | color_var = NULL, 17 | alpha = 0.4, 18 | grp_var_order = c(), 19 | color_var_order = c(), 20 | shape_col_order = c(), 21 | log10_transform_fdr = TRUE, 22 | filename = NULL, 23 | point_label_var = "CTctctCT", 24 | title = "", 25 | x_label = NULL, 26 | y_label = "Negative log10 FDR", 27 | legend.position = "right", 28 | point_size = "ct___", 29 | ... 30 | ) 31 | } 32 | \arguments{ 33 | \item{data}{Data frame or data file (with header line, the first column will not be treated as the rowname, tab seperated).} 34 | 35 | \item{ID_var}{Name of ID column.} 36 | 37 | \item{FDR_var}{Name of FDR column.} 38 | 39 | \item{grp_var}{Group variable for ordering points.} 40 | 41 | \item{sig_col}{Significant column.Optional, in sample data significant.} 42 | 43 | \item{status_col_level}{Changing the order of status column values. Normally, the unique values of status column would be sorted alphabetically.} 44 | 45 | \item{pvalue}{Set the filter threshold for defining significance. Default "0.05".} 46 | 47 | \item{shape_col}{Column for points shapes.} 48 | 49 | \item{color_var}{Column for color points. Default the same as group variable.} 50 | 51 | \item{alpha}{Transparent alpha value.Default 0.4, Accept a float from 0(transparent), 1(opaque).} 52 | 53 | \item{grp_var_order}{Group variable order, like "'Rhizobiales', 'Actinomycetales'".} 54 | 55 | \item{color_var_order}{Color variable order. Default same as \code{grp_var}.} 56 | 57 | \item{shape_col_order}{Levels for shapes, like "'Sig','nonSig'".} 58 | 59 | \item{log10_transform_fdr}{Get \code{-log10(FDR)} for column given to \code{FDR_var}. Default FALSE, accept TRUE.} 60 | 61 | \item{filename}{Output picture to given file.} 62 | 63 | \item{point_label_var}{Name of columns containing labels for points.} 64 | 65 | \item{title}{Title of picture.} 66 | 67 | \item{x_label}{Xlab label.Default NULL.} 68 | 69 | \item{y_label}{Ylab label.Default "Negative log10 FDR".} 70 | 71 | \item{legend.position}{Position of legend, accept top, bottom, left, right, none or c(0.8,0.8).} 72 | 73 | \item{...}{} 74 | } 75 | \value{ 76 | A ggplot2 object 77 | } 78 | \description{ 79 | Generating manhattan plot 80 | } 81 | \examples{ 82 | 83 | 84 | ## Not run: 85 | manhattan_data = "manhattan.data" 86 | 87 | sp_manhattan2_plot(data=manhattan_data, ID_var='ID', FDR_var='FDR', title="test1", point_size=2, point_label_var = "Labels") 88 | ## End(Not run) 89 | } 90 | -------------------------------------------------------------------------------- /man/sp_manual_color_ggplot2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_manual_color_ggplot2} 4 | \alias{sp_manual_color_ggplot2} 5 | \title{Add manual color assignment for both categorical and numerical variable} 6 | \usage{ 7 | sp_manual_color_ggplot2( 8 | p, 9 | data, 10 | color_variable, 11 | manual_color_vector = NULL, 12 | alpha = 1 13 | ) 14 | } 15 | \arguments{ 16 | \item{p}{A ggplot2 object} 17 | 18 | \item{data}{Data matrix used for the ggplot2 object \code{p}} 19 | 20 | \item{color_variable}{Name of columns for color assignment} 21 | 22 | \item{manual_color_vector}{Manually set colors for each geom. 23 | Default NULL, meaning using ggplot2 default. 24 | Colors like c('red', 'blue', '#6181BD') (number of colors not matter) or 25 | a RColorBrewer color set like "BrBG" "PiYG" "PRGn" "PuOr" 26 | "RdBu" "RdGy" "RdYlBu" "RdYlGn" "Spectral" "Accent" 27 | "Dark2" "Paired" "Pastel1" "Pastel2" "Set1" 28 | "Set2" "Set3" "Blues" "BuGn" "BuPu" 29 | "GnBu" "Greens" "Greys" "Oranges" "OrRd" "PuBu" 30 | "PuBuGn" "PuRd" "Purples" "RdPu" "Reds" 31 | "YlGn" "YlGnBu" "YlOrBr" "YlOrRd" 32 | (check http://www.sthda.com/english/wiki/colors-in-r for more).} 33 | 34 | \item{alpha}{Color transparency (0-1). 0: opaque; 1: transparent.} 35 | } 36 | \value{ 37 | A ggplot2 object 38 | } 39 | \description{ 40 | Add manual color assignment for both categorical and numerical variable 41 | } 42 | \examples{ 43 | 44 | ## Not run: 45 | p <- sp_manual_color_ggplot2(p, data, color_variable, manual_color_vector) 46 | 47 | ## End(Not run) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /man/sp_manual_fill_ggplot2.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_manual_fill_ggplot2} 4 | \alias{sp_manual_fill_ggplot2} 5 | \title{Add manual fill-color assignment for both categorical and numerical variable} 6 | \usage{ 7 | sp_manual_fill_ggplot2( 8 | p, 9 | data, 10 | color_variable, 11 | manual_color_vector = NULL, 12 | alpha = 1 13 | ) 14 | } 15 | \arguments{ 16 | \item{p}{A ggplot2 object} 17 | 18 | \item{data}{Data matrix used for the ggplot2 object \code{p}} 19 | 20 | \item{color_variable}{Name of columns for color assignment} 21 | 22 | \item{manual_color_vector}{Manually set colors for each geom. 23 | Default NULL, meaning using ggplot2 default. 24 | Colors like c('red', 'blue', '#6181BD') (number of colors not matter) or 25 | a RColorBrewer color set like "BrBG" "PiYG" "PRGn" "PuOr" 26 | "RdBu" "RdGy" "RdYlBu" "RdYlGn" "Spectral" "Accent" 27 | "Dark2" "Paired" "Pastel1" "Pastel2" "Set1" 28 | "Set2" "Set3" "Blues" "BuGn" "BuPu" 29 | "GnBu" "Greens" "Greys" "Oranges" "OrRd" "PuBu" 30 | "PuBuGn" "PuRd" "Purples" "RdPu" "Reds" 31 | "YlGn" "YlGnBu" "YlOrBr" "YlOrRd" 32 | (check http://www.sthda.com/english/wiki/colors-in-r for more).} 33 | 34 | \item{alpha}{Transparency} 35 | } 36 | \value{ 37 | A ggplot2 object 38 | } 39 | \description{ 40 | Add manual fill-color assignment for both categorical and numerical variable 41 | } 42 | \examples{ 43 | 44 | ## Not run: 45 | p <- sp_manual_fill_ggplot2(p, data, color_variable, manual_color_vector) 46 | 47 | ## End(Not run) 48 | 49 | } 50 | -------------------------------------------------------------------------------- /man/sp_multiple_group_diff_test.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/statistics.R 3 | \name{sp_multiple_group_diff_test} 4 | \alias{sp_multiple_group_diff_test} 5 | \title{Perform statistical test using given methods for split data.} 6 | \usage{ 7 | sp_multiple_group_diff_test( 8 | data, 9 | stat_value_variable, 10 | stat_group_variable, 11 | group_variable = NULL, 12 | ... 13 | ) 14 | } 15 | \arguments{ 16 | \item{data}{A data matrix} 17 | 18 | \item{stat_value_variable}{The column represents the statistical value information.} 19 | 20 | \item{stat_group_variable}{The column represents the statistical group information.} 21 | 22 | \item{group_variable}{The column represents the group information. 23 | The data would be split by this group and diff test would be performed within each group.} 24 | 25 | \item{...}{Other parameters given to \link{sp_diff_test}.} 26 | } 27 | \value{ 28 | A list. list(data=data, a data frame with statistical information, Tukey_HSD=Tukey_HSD) 29 | } 30 | \description{ 31 | Perform statistical test using given methods for split data. 32 | } 33 | \examples{ 34 | NULL 35 | 36 | } 37 | -------------------------------------------------------------------------------- /man/sp_raincloud.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_raincloud.R 3 | \name{sp_raincloud} 4 | \alias{sp_raincloud} 5 | \title{raincloud} 6 | \usage{ 7 | sp_raincloud( 8 | data, 9 | melted = TRUE, 10 | xvariable = NULL, 11 | yvariable = NULL, 12 | metadata = NULL, 13 | ID_var = c(), 14 | coordinate_flip = TRUE, 15 | position_nudge_flat_violin_x = 0.3, 16 | position_nudge_flat_violin_y = 0, 17 | position_nudge_flat_violin_alpha = 0.8, 18 | palette_color = "Set2", 19 | palette_fill = "Set2", 20 | position_nudge_box_x = 0.25, 21 | box_fill = "white", 22 | legend.position = NULL, 23 | extra_ggplot2_cmd = NULL, 24 | x_label = NULL, 25 | y_label = NULL, 26 | title = NULL, 27 | additional_theme = NULL, 28 | debug = F, 29 | ... 30 | ) 31 | } 32 | \arguments{ 33 | \item{data}{Data file (with header line, the first row is the colname, 34 | tab seperated. Multiple formats are allowed and described above)} 35 | 36 | \item{melted}{When TRUE, meaning a long format matrix is supplied to \code{data}. 37 | function will skip preprocess. Default FALSE.} 38 | 39 | \item{xvariable}{The column represents the x-axis values. For unmelted data, the program 40 | will use first column as x-variable. If one want to use first row of unmelted data 41 | as x-variable, please specify \code{variable} here (which is an inner name). 42 | Or if one want to use other columns in \code{metadata}.} 43 | 44 | \item{yvariable}{The column represents the digital values. 45 | For unmelted data, the program 46 | will use \code{value} as y-variable (which is an inner name). 47 | This parameter can only be set when \code{melted} is TRUE.} 48 | 49 | \item{metadata}{Giving a metadata file with format specified in example 50 | to tell the group information for each sample.} 51 | 52 | \item{ID_var}{Other columns one want to treat as ID variable columns 53 | except the one given to \code{xvariable}.} 54 | 55 | \item{coordinate_flip}{Rotate the plot from vertical to horizontal. 56 | Usefull for plots with many values or very long labels at X-axis} 57 | 58 | \item{position_nudge_flat_violin_x}{The violin moves on the X-axis. Default 0.3.} 59 | 60 | \item{position_nudge_flat_violin_y}{The violin moves on the Y-axis. Default 0.} 61 | 62 | \item{position_nudge_flat_violin_alpha}{The violin transparency.} 63 | 64 | \item{palette_color}{The violin palette.} 65 | 66 | \item{palette_fill}{The point palette.} 67 | 68 | \item{position_nudge_box_x}{The box moves on the X-axis. Default 0.25.} 69 | 70 | \item{box_fill}{Box color.} 71 | 72 | \item{...}{Parametes given to \code{sp_ggplot_layout}} 73 | } 74 | \value{ 75 | A ggplot2 object 76 | } 77 | \description{ 78 | raincloud 79 | } 80 | \examples{ 81 | NULL 82 | 83 | } 84 | -------------------------------------------------------------------------------- /man/sp_rda.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RDA.R 3 | \name{sp_rda} 4 | \alias{sp_rda} 5 | \title{Generate RDA plot with species table and env table} 6 | \usage{ 7 | sp_rda( 8 | otu_table, 9 | env_table, 10 | metadata, 11 | sample_min_reads_count = 10000, 12 | rare_otu_count = 5, 13 | otu_scale_method = "hellinger" 14 | ) 15 | } 16 | \arguments{ 17 | \item{otu_table}{Normalized OTU/Species abundance data frame or data file (with header line, the first column will be treated as the row names, tab separated)} 18 | 19 | \item{env_table}{Environment factor data frame or data file (with header line, the first column will be treated as the row names, tab separated)} 20 | 21 | \item{metadata}{Metadata file (or data.frame) with sample attributes like group information. 22 | The first column is the same as the first row of value given to parameter \code{data}. 23 | These attributes would be used as \code{color}, \code{size}, \code{shape} variables in the plot. 24 | If not supplied, each sample will be treated as one group.} 25 | 26 | \item{sample_min_reads_count}{The minimum allowed sample reads count. Default 10000 meaning samples with total reads count less than 10000 would be filtered.} 27 | 28 | \item{rare_otu_count}{Definite rare OTU. OTU with abundance in all samples less than given value would be filtered.} 29 | 30 | \item{otu_scale_method}{Popular (and effective) standardization methods for community ecologists 31 | like total, max, frequency, normalize, range, rank, rrank, standardize, hellinger, chi.square, rclr, 32 | log, clr, alr.} 33 | 34 | \item{...}{Parameters given to \code{sp_ggplot_layout}} 35 | } 36 | \value{ 37 | A ggplot2 object 38 | } 39 | \description{ 40 | Generate RDA plot with species table and env table 41 | } 42 | \examples{ 43 | 44 | ## Not run: 45 | input <- "KO-OE_all.txt" 46 | volcano_plot(input,log2fc_var='Log2FoldChange',fdr_var='Padj',status_col_var='', 47 | title="sd",label="Label",log10_transform_fdr=TRUE,point_size=5) 48 | ## End(Not run) 49 | } 50 | -------------------------------------------------------------------------------- /man/sp_readTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_readTable} 4 | \alias{sp_readTable} 5 | \title{Read in data} 6 | \usage{ 7 | sp_readTable( 8 | file, 9 | sep = "\\t", 10 | row.names = NULL, 11 | header = T, 12 | quote = "", 13 | comment = "", 14 | check.names = F, 15 | renameDuplicateRowNames = F, 16 | stringsAsFactors = T, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{file}{the name of the file which the data are to be read from. 22 | Each row of the table appears as one line of the file. If it does 23 | not contain an \emph{absolute} path, the file name is 24 | \emph{relative} to the current working directory, 25 | \code{\link{getwd}()}. Tilde-expansion is performed where supported. 26 | This can be a compressed file (see \code{\link{file}}). 27 | 28 | Alternatively, \code{file} can be a readable text-mode 29 | \link{connection} (which will be opened for reading if 30 | necessary, and if so \code{\link{close}}d (and hence destroyed) at 31 | the end of the function call). (If \code{\link{stdin}()} is used, 32 | the prompts for lines may be somewhat confusing. Terminate input 33 | with a blank line or an \abbr{EOF} signal, \code{Ctrl-D} on Unix and 34 | \code{Ctrl-Z} on Windows. Any pushback on \code{stdin()} will be 35 | cleared before return.) 36 | 37 | \code{file} can also be a complete URL. (For the supported URL 38 | schemes, see the \sQuote{URLs} section of the help for 39 | \code{\link{url}}.) 40 | } 41 | 42 | \item{sep}{the field separator character. Values on each line of the 43 | file are separated by this character. If \code{sep = ""} (the 44 | default for \code{read.table}) the separator is \sQuote{white space}, 45 | that is one or more spaces, tabs, newlines or carriage returns.} 46 | 47 | \item{row.names}{a vector of row names. This can be a vector giving 48 | the actual row names, or a single number giving the column of the 49 | table which contains the row names, or character string giving the 50 | name of the table column containing the row names. 51 | 52 | If there is a header and the first row contains one fewer field than 53 | the number of columns, the first column in the input is used for the 54 | row names. Otherwise if \code{row.names} is missing, the rows are 55 | numbered. 56 | 57 | Using \code{row.names = NULL} forces row numbering. Missing or 58 | \code{NULL} \code{row.names} generate row names that are considered 59 | to be \sQuote{automatic} (and not preserved by \code{\link{as.matrix}}). 60 | } 61 | 62 | \item{header}{a logical value indicating whether the file contains the 63 | names of the variables as its first line. If missing, the value is 64 | determined from the file format: \code{header} is set to \code{TRUE} 65 | if and only if the first row contains one fewer field than the 66 | number of columns.} 67 | 68 | \item{quote}{the set of quoting characters. To disable quoting 69 | altogether, use \code{quote = ""}. See \code{\link{scan}} for the 70 | behaviour on quotes embedded in quotes. Quoting is only considered 71 | for columns read as character, which is all of them unless 72 | \code{colClasses} is specified.} 73 | 74 | \item{check.names}{logical. If \code{TRUE} then the names of the 75 | variables in the data frame are checked to ensure that they are 76 | syntactically valid variable names. If necessary they are adjusted 77 | (by \code{\link{make.names}}) so that they are, and also to ensure 78 | that there are no duplicates.} 79 | 80 | \item{renameDuplicateRowNames}{If TRUE, the function will transfer first column 81 | as row names (with duplicates numbered)} 82 | 83 | \item{stringsAsFactors}{logical: should character vectors be converted 84 | to factors? Note that this is overridden by \code{as.is} and 85 | \code{colClasses}, both of which allow finer control.} 86 | 87 | \item{...}{Other parameters given to \code{read.table}} 88 | } 89 | \value{ 90 | data.frame 91 | } 92 | \description{ 93 | Read in data 94 | } 95 | \examples{ 96 | 97 | # Not run 98 | sp_readTable("a.txt") 99 | 100 | } 101 | -------------------------------------------------------------------------------- /man/sp_read_in_long_wide_matrix.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_read_in_long_wide_matrix} 4 | \alias{sp_read_in_long_wide_matrix} 5 | \title{Used to read in long/wide format file or datafrmes. Wide format would be transferred to lonf fromat.} 6 | \usage{ 7 | sp_read_in_long_wide_matrix(data, xvariable, melted, ...) 8 | } 9 | \arguments{ 10 | \item{data}{Data frame or data file (with header line, the first column will 11 | not be treated as row names for long format matrix, tab seperated).} 12 | 13 | \item{xvariable}{Name for x-axis variable.} 14 | 15 | \item{melted}{\code{TRUE} for dealinig with long format matrix, the program will skip melt preprocess. 16 | Default \code{FALSE} for dealing with wide format matrix.} 17 | 18 | \item{...}{Parameters given to \code{\link{dataFilter2}}.} 19 | } 20 | \value{ 21 | a A long format dataframe 22 | } 23 | \description{ 24 | Used to read in long/wide format file or datafrmes. Wide format would be transferred to lonf fromat. 25 | } 26 | \examples{ 27 | 28 | ## Not run: 29 | sp_read_in_long_wide_matrix(data, xvariable, melted) 30 | 31 | ## End(Not run) 32 | 33 | } 34 | -------------------------------------------------------------------------------- /man/sp_set_factor_order.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_set_factor_order} 4 | \alias{sp_set_factor_order} 5 | \title{Set factor order of given variable. If \code{variable_order} is supplied, only 6 | factors in \code{variable_order} will be kept and re-factored. Other variables 7 | would be depleted.} 8 | \usage{ 9 | sp_set_factor_order( 10 | data, 11 | variable, 12 | variable_order = NULL, 13 | order_data_frame_by_this_variable_order = F, 14 | filter_unexist_factor = T, 15 | rename_levels = F 16 | ) 17 | } 18 | \arguments{ 19 | \item{data}{A data matrix} 20 | 21 | \item{variable}{One column name of data matrix} 22 | 23 | \item{variable_order}{Expected order of \code{data[[variable]]}.} 24 | 25 | \item{order_data_frame_by_this_variable_order}{Return ordered dataframe by this order. 26 | Please remember that only keep the last order if applying multiple order operation.} 27 | 28 | \item{filter_unexist_factor}{Filter un-exist factors.} 29 | 30 | \item{rename_levels}{Rename old levels to new levels. Default False.} 31 | } 32 | \value{ 33 | A data frame 34 | } 35 | \description{ 36 | Set factor order of given variable. If \code{variable_order} is supplied, only 37 | factors in \code{variable_order} will be kept and re-factored. Other variables 38 | would be depleted. 39 | } 40 | \examples{ 41 | 42 | data <- data.frame(A=letters[1:4], B=letters[1:4]) 43 | data 44 | data = sp_set_factor_order(data,'A') 45 | data$A 46 | data = sp_set_factor_order(data,'B',c('c','d','b','a')) 47 | data$B 48 | data = sp_set_factor_order(data,'B',c('c','d','a')) 49 | data$B 50 | 51 | } 52 | -------------------------------------------------------------------------------- /man/sp_string2vector.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_string2vector} 4 | \alias{sp_string2vector} 5 | \title{Transfer color string to vector} 6 | \usage{ 7 | sp_string2vector(x, pattern = ",") 8 | } 9 | \arguments{ 10 | \item{x}{A string} 11 | 12 | \item{pattern}{delimiter of sub-strings} 13 | } 14 | \value{ 15 | A vector 16 | } 17 | \description{ 18 | Transfer color string to vector 19 | } 20 | \examples{ 21 | 22 | sp_string2vector('red, blue,white') 23 | 24 | } 25 | -------------------------------------------------------------------------------- /man/sp_transfer_one_column.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_transfer_one_column} 4 | \alias{sp_transfer_one_column} 5 | \title{Transfer one column of data.} 6 | \usage{ 7 | sp_transfer_one_column(data, variable, yaxis_scale_mode = NULL, y_add = 0) 8 | } 9 | \arguments{ 10 | \item{data}{A data matrix} 11 | 12 | \item{variable}{One column name of data matrix} 13 | 14 | \item{yaxis_scale_mode}{Give the following \code{scale_y_log10()}, 15 | \code{coord_trans(y="log10")}, or other legal command for ggplot2 or 16 | simply \code{log2} to set the scale way.} 17 | 18 | \item{y_add}{A number to add if log scale is used. 19 | Default 0 meaning the minimum non-zero value would be used.} 20 | } 21 | \value{ 22 | A data frame 23 | } 24 | \description{ 25 | Transfer one column of data. 26 | } 27 | \examples{ 28 | 29 | data <- data.frame(A=letters[1:4], B=letters[1:4]) 30 | data 31 | data = sp_transfer_variable(data,'A', "log2") 32 | } 33 | -------------------------------------------------------------------------------- /man/sp_tree_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_tree.R 3 | \name{sp_tree_plot} 4 | \alias{sp_tree_plot} 5 | \title{Generate tree file} 6 | \usage{ 7 | sp_tree_plot( 8 | treefile, 9 | tree_type = "iqtree", 10 | tree_attrib = NULL, 11 | tree_msa = NULL, 12 | color_branches = NULL, 13 | layout = "fan", 14 | ladderize = F, 15 | branch.length = "none", 16 | tip_text = "label", 17 | tip_text_size = 3, 18 | bootstrap = TRUE, 19 | bootstrap_variable = NULL, 20 | legend.position = "bottom", 21 | bootstrap_size = 3, 22 | bootstrap_color = "red", 23 | debug = FALSE, 24 | manual_color_vector = "Set3", 25 | ... 26 | ) 27 | } 28 | \arguments{ 29 | \item{treefile}{Aphylogenetic tree file (Only tested for tree generated by iqtree)} 30 | 31 | \item{tree_type}{Currently 4 types of tree supported, \code{normal}, \code{newick}, 32 | \code{raxml}, \code{iqtree} (default).} 33 | 34 | \item{tree_attrib}{A data frame with first columns match node names of tree file.} 35 | 36 | \item{tree_msa}{A multiple-aligned fasta file used to generate the tree file. 37 | A tree with Multiple-Sequence-Alignment plot would be generated when given.} 38 | 39 | \item{color_branches}{Name of columns in \code{tree_attrib} used for color branches.} 40 | 41 | \item{layout}{one of 'rectangular', 'dendrogram', 'slanted', 'ellipse', 'roundrect', 42 | 'fan', 'circular', 'inward_circular', 'radial', 'equal_angle', 'daylight' or 'ape'} 43 | 44 | \item{ladderize}{logical (default \code{TRUE}). Should the tree be re-organized to have a 'ladder' 45 | aspect?} 46 | 47 | \item{branch.length}{variable for scaling branch, if 'none' draw cladogram} 48 | 49 | \item{tip_text}{Show branch labels or supply a name of columns in \code{tree_attrib} to be 50 | shown as branch labels, Or \code{label} to show default labels, or NULL to not show 51 | branch labels.} 52 | 53 | \item{tip_text_size}{Text size of branch labels.} 54 | 55 | \item{bootstrap}{Show bootstrap value or not.} 56 | 57 | \item{bootstrap_variable}{\code{node} to label ids for each node, or other variables in 58 | \code{tree} object. Default \code{UFboot} would 59 | be used for \code{tree_type=iqtree}.} 60 | 61 | \item{legend.position}{Position of legend, accept top, bottom, left, right, none or c(0.8,0.8).} 62 | 63 | \item{bootstrap_size}{Text size of bootstrap labels.} 64 | 65 | \item{bootstrap_color}{Text color of bootstrap labels.} 66 | 67 | \item{manual_color_vector}{Manually set colors for each geom. 68 | Default NULL, meaning using ggplot2 default. 69 | Colors like c('red', 'blue', '#6181BD') (number of colors not matter) or 70 | a RColorBrewer color set like "BrBG" "PiYG" "PRGn" "PuOr" 71 | "RdBu" "RdGy" "RdYlBu" "RdYlGn" "Spectral" "Accent" 72 | "Dark2" "Paired" "Pastel1" "Pastel2" "Set1" 73 | "Set2" "Set3" "Blues" "BuGn" "BuPu" 74 | "GnBu" "Greens" "Greys" "Oranges" "OrRd" "PuBu" 75 | "PuBuGn" "PuRd" "Purples" "RdPu" "Reds" 76 | "YlGn" "YlGnBu" "YlOrBr" "YlOrRd" 77 | (check http://www.sthda.com/english/wiki/colors-in-r for more).} 78 | 79 | \item{...}{additional parameter 80 | 81 | some dot arguments: 82 | \itemize{ 83 | \item \code{nsplit} integer, the number of branch blocks divided when 'continuous' is not "none", default is 200. 84 | }} 85 | } 86 | \value{ 87 | A ggplot2 object 88 | } 89 | \description{ 90 | Generate tree file 91 | } 92 | \examples{ 93 | 94 | library(ggtree) 95 | library("ggplot2") 96 | library(ImageGP) 97 | treefile <- "iqtree.treefile" 98 | sp_tree_plot(treefile) 99 | } 100 | -------------------------------------------------------------------------------- /man/sp_upsetview.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_upsetView.R 3 | \name{sp_upsetview} 4 | \alias{sp_upsetview} 5 | \title{Generating upsetView plot} 6 | \usage{ 7 | sp_upsetview( 8 | data, 9 | vennFormat = 0, 10 | pointsize = 8, 11 | keep_empty = FALSE, 12 | sets = NULL, 13 | nintersects = NA, 14 | order.by = "freq", 15 | decreasing = TRUE, 16 | scale.intersections = "identity", 17 | scale.sets = "identity", 18 | queries_bar1 = NULL, 19 | queries_bar2 = NULL, 20 | queries_bar3 = NULL, 21 | queries_bar1_color = NULL, 22 | queries_bar2_color = NULL, 23 | queries_bar3_color = NULL, 24 | saveplot = NULL, 25 | debug = FALSE, 26 | saveppt = FALSE, 27 | maxsets = 100, 28 | main_bar_color_vector = "gray23", 29 | constantColor = T, 30 | ... 31 | ) 32 | } 33 | \arguments{ 34 | \item{data}{Data file. Receive long and wide table forms.} 35 | 36 | \item{vennFormat}{Venn diagram format without header line. Default 0 represents normal data. Accept 1,2. 37 | 0: represents wide data listed above. 38 | 1: represents venn diagram format without header line. 39 | 2: represents venn diagram format with header line.} 40 | 41 | \item{pointsize}{Point size. Default 8.} 42 | 43 | \item{keep_empty}{Keep empty intersections. Default FALSE. Accept TRUE to remove empty intersections.} 44 | 45 | \item{sets}{Specific sets to look at (Include as combinations. Ex: c('Name1', 'Name2')).} 46 | 47 | \item{nintersects}{Number of intersections to plot. If set to NA, all intersections will be plotted.} 48 | 49 | \item{order.by}{How the intersections in the matrix should be ordered by. Options include frequency (entered as 'freq'), degree.} 50 | 51 | \item{decreasing}{How the variables in order.by should be ordered. 'freq' is decreasing (greatest to least) and 'degree' is increasing (least to greatest).} 52 | 53 | \item{scale.intersections}{The scale to be used for the intersection sizes. Options: 'identity', 'log10', 'log2'.} 54 | 55 | \item{scale.sets}{The scale to be used for the set sizes. Options: 'identity', 'log10', 'log2'.} 56 | 57 | \item{queries_bar1}{Specifies an intersection. Changes the column color.} 58 | 59 | \item{queries_bar1_color}{Input color. Specifies an intersection to use this color.} 60 | 61 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 62 | 63 | \item{maxsets}{Maximum allowed number of sets. Default 100.} 64 | 65 | \item{...}{Other parameters given to \code{base_plot_save}} 66 | } 67 | \value{ 68 | A pdf file. 69 | } 70 | \description{ 71 | Input file is a matrix: 72 | } 73 | \details{ 74 | vennFormat 0 75 | 76 | (First row would be treated as header line. First column is just a normal column (but needed). 0 represents the sample does not contain the genes in row. 1 represents the containing relationship) 77 | 78 | ID Samp1 Samp2 Samp3 Samp4 Samp5 79 | 80 | G1 1 0 1 0 1 81 | 82 | G2 0 0 1 1 1 83 | 84 | G3 1 1 1 0 1 85 | 86 | G4 1 1 1 0 0 87 | 88 | G5 0 1 0 1 1 89 | 90 | G6 1 0 1 0 0 91 | 92 | vennFormat 1 or 2 93 | 94 | The output contains two barplots, horizontal bar represents the number of genes in each sample, which is the sum of all 1 in sample column. Vertical bar represents the number of sample specific and common genes as indicated by linking vertical lines and points (just as the overlapping regions of venndiagram). 95 | } 96 | \examples{ 97 | 98 | upsetview_data <- data.frame(elements=c("1","2","2","2","3"), sets=c("A","A","B","C","C")) 99 | sp_upsetview(data = upsetview_data, vennFormat=2, saveplot = "upsetView_long.pdf") 100 | 101 | 102 | ## Not run: 103 | upsetview_data = "upsetview.data" 104 | sp_upsetview(data = upsetview_data, saveplot = "upsetView_wide.pdf") 105 | ## End(Not run) 106 | 107 | } 108 | -------------------------------------------------------------------------------- /man/sp_vennDiagram.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_vennDiagram.R 3 | \name{sp_vennDiagram} 4 | \alias{sp_vennDiagram} 5 | \title{Generating venDiagram plot} 6 | \usage{ 7 | sp_vennDiagram( 8 | data, 9 | supplyNumbers = FALSE, 10 | header = FALSE, 11 | title = NULL, 12 | label1 = NULL, 13 | label2 = NULL, 14 | label3 = NULL, 15 | label4 = NULL, 16 | label5 = NULL, 17 | color_for_circumference = "transparent", 18 | numVector = c(), 19 | labelVector = c(), 20 | manual_color_vector = c("dodgerblue", "goldenrod1", "darkorange1", "seagreen3", 21 | "orchid3"), 22 | alpha = 0.5, 23 | label_size = NULL, 24 | margin = NULL, 25 | filename = NULL, 26 | debug = FALSE, 27 | ... 28 | ) 29 | } 30 | \arguments{ 31 | \item{data}{Data file (the first column is the name of genes or other things one want to compare, the second column is set name of each items, tab separated).} 32 | 33 | \item{supplyNumbers}{If you have the size of each set and the number overlaps between or among each set, please give TRUE here.} 34 | 35 | \item{header}{a logical value indicating whether the file contains the 36 | names of the variables as its first line. If missing, the value is 37 | determined from the file format: \code{header} is set to \code{TRUE} 38 | if and only if the first row contains one fewer field than the 39 | number of columns.} 40 | 41 | \item{title}{Title for the picture.} 42 | 43 | \item{label1}{The name for label1. One string in your second column. If not supplied, the program will try to do venn plot for all sets or first 5 sets.} 44 | 45 | \item{label2}{The name for label2.} 46 | 47 | \item{label3}{The name for label3.} 48 | 49 | \item{label4}{The name for label4.} 50 | 51 | \item{label5}{The name for label5.} 52 | 53 | \item{numVector}{List of numbers for venn plot(used when \code{supplyNumbers} is true). 54 | For two-set venn, the format is "100, 110, 50" represents 55 | (length_a, length_b, a_b_overlap). 56 | For three-set venn, the format is "100, 110, 90, 50, 40, 40, 20" 57 | represents (length_a, length_b, length_c, 58 | a_b_overlap, b_c_overlap, a_c_overlap, a_b_c_overlap). 59 | For four-set venn, the format is "100, 110, 90, 50, 40, 40, 20" 60 | represents (length_a, length_b, length_c, 61 | a_b_overlap, a_c_overlap, a_d_overlap, b_c_overlap, 62 | b_d_overlap, c_d_overlap, abc_overlap, abd_overlap, 63 | acd_overlap, bcd_overlap, abcd_overlap).} 64 | 65 | \item{labelVector}{List of label for venn plot(used when \code{supplyNumbers} is true). 66 | Format: c('a', 'b')" for two-set and c('a', 'b', 'c') for three-set.} 67 | 68 | \item{manual_color_vector}{Color for each area. Ussally the number of colors should 69 | be equal to the number of labels (however the program will make them equal). 70 | If you manually set colors for 4-way 71 | venn diagram, the first color will be given to the 72 | leftmost set, the second will be given to the rightmost 73 | set, the third will be given to second leftmost and the forth 74 | will be given to the second rightmost. 75 | Colors like c('red', 'blue', '#6181BD') (number of colors not matter) or 76 | a RColorBrewer color set like "BrBG" "PiYG" "PRGn" "PuOr" 77 | "RdBu" "RdGy" "RdYlBu" "RdYlGn" "Spectral" "Accent" 78 | "Dark2" "Paired" "Pastel1" "Pastel2" "Set1" 79 | "Set2" "Set3" "Blues" "BuGn" "BuPu" 80 | "GnBu" "Greens" "Greys" "Oranges" "OrRd" "PuBu" 81 | "PuBuGn" "PuRd" "Purples" "RdPu" "Reds" 82 | "YlGn" "YlGnBu" "YlOrBr" "YlOrRd" 83 | (check http://www.sthda.com/english/wiki/colors-in-r for more).} 84 | 85 | \item{alpha}{Color transparency (0-1). 0: opaque; 1: transparent.} 86 | 87 | \item{label_size}{Siez of category names. Default system default.} 88 | 89 | \item{margin}{Number giving the amount of whitespace around the diagram in grid units. Default system default} 90 | 91 | \item{...}{} 92 | } 93 | \value{ 94 | A grid object. 95 | } 96 | \description{ 97 | Generating venDiagram plot 98 | } 99 | \examples{ 100 | 101 | 102 | vennDiagram_test_data <- data.frame(elements=c("1","2","2","2","3"), sets=c("A","A","B","C","C")) 103 | sp_vennDiagram(data = vennDiagram_test_data, label1 = "A",label2 = "B", label3 = "C") 104 | 105 | 106 | 107 | sp_vennDiagram( supplyNumbers = TRUE, numVector=c (120, 110, 50), labelVector=c('a','b')) 108 | 109 | 110 | 111 | ## Not run: 112 | vennDiagram_data = "vennDiagram.data" 113 | sp_vennDiagram(data = vennDiagram_data, label1 = "Set1",label2 = "Set2") 114 | ## End(Not run) 115 | 116 | } 117 | -------------------------------------------------------------------------------- /man/sp_vennDiagram3.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/sp_vennDiagram3.R 3 | \name{sp_vennDiagram3} 4 | \alias{sp_vennDiagram3} 5 | \title{Generating venDiagram plot} 6 | \usage{ 7 | sp_vennDiagram3( 8 | data, 9 | header = TRUE, 10 | item_variable = NULL, 11 | set_variable = NULL, 12 | select_set_to_show = NULL, 13 | doWeights = FALSE, 14 | type = "ellipses", 15 | SetLabels = TRUE, 16 | Faces = TRUE, 17 | Sets = TRUE, 18 | FaceText = "weight", 19 | saveplot = NULL, 20 | debug = FALSE, 21 | saveppt = FALSE, 22 | ... 23 | ) 24 | } 25 | \arguments{ 26 | \item{data}{Data file (the first column is the name of genes or other things one want to compare, the second column is set name of each items, tab separated).} 27 | 28 | \item{item_variable}{Specify the column containing all items (one of column names of data).} 29 | 30 | \item{set_variable}{Specify the column containing set names (one of column names of data).} 31 | 32 | \item{select_set_to_show}{Specific sets to look at.} 33 | 34 | \item{doWeights}{Whether to use weights to represent data sets} 35 | 36 | \item{type}{Represent data sets in different shapes. Do weighted select NO if the results are wrong 37 | For 2-set Venn diagrams: circles, squares. 38 | For 3-set Venn diagrams: circles, squares, ChowRuskey, triangles, AWFE. 39 | For 4-set Venn diagrams: ChowRuskey, AWFE, squares or ellipses. 40 | For Venn diagrams on more than four sets: classic(up to 8 sets), battle(up to 9 sets).} 41 | 42 | \item{SetLabels}{Whether to plot the names of the Sets. Default TRUE.} 43 | 44 | \item{Faces}{If Faces = TRUE, the sets will be filled with colors.} 45 | 46 | \item{Sets}{If Sets = TRUE, the boundaries of the Sets are shown.} 47 | 48 | \item{FaceText}{FaceText is a character vector which may contain any of c('weight','signature','sets','elements').} 49 | 50 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 51 | 52 | \item{...}{Other parameters given to \code{base_plot_save}} 53 | } 54 | \value{ 55 | A pdf file. 56 | } 57 | \description{ 58 | Generating venDiagram plot 59 | } 60 | \examples{ 61 | 62 | ## Not run: 63 | vennDiagram_data = "vennDiagram.data" 64 | sp_vennDiagram3(data=vennDiagram_data, header = TRUE, item_variable = "Gene", set_variable = "Sample", 65 | select_set_to_show = c("Set1","Set2","Set3"), doWeights = TRUE, type = "AWFE") 66 | ## End(Not run) 67 | 68 | } 69 | -------------------------------------------------------------------------------- /man/sp_writeTable.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{sp_writeTable} 4 | \alias{sp_writeTable} 5 | \title{Write dataframe to file with names of first column filled.} 6 | \usage{ 7 | sp_writeTable(df, file = "", keep_rownames = T, col.names = T) 8 | } 9 | \arguments{ 10 | \item{df}{A dataframe} 11 | 12 | \item{file}{Filename} 13 | 14 | \item{keep_rownames}{Default TRUE meaning output rownames as the first column 15 | with column name is \code{ID}. If FALSE, ignore rownames.} 16 | 17 | \item{col.names}{either a logical value indicating whether the column 18 | names of \code{x} are to be written along with \code{x}, or a 19 | character vector of column names to be written. See the section on 20 | \sQuote{CSV files} for the meaning of \code{col.names = NA}.} 21 | } 22 | \value{ 23 | NA 24 | } 25 | \description{ 26 | Write dataframe to file with names of first column filled. 27 | } 28 | \examples{ 29 | 30 | # Not run 31 | sp_writeTable(df, "a.txt") 32 | 33 | } 34 | -------------------------------------------------------------------------------- /man/stackVlnPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/singlecell.R 3 | \name{stackVlnPlot} 4 | \alias{stackVlnPlot} 5 | \title{Get stack violin plot for a normal matrix} 6 | \usage{ 7 | stackVlnPlot(data, x, y, facets, fill = NULL) 8 | } 9 | \arguments{ 10 | \item{data}{At least three columns needed. 11 | 12 | \if{html}{\out{
}}\preformatted{Gene Expr Cluster 13 | Sox2 2 1 14 | Sox2 1.5 1 15 | Sox2 1.2 1 16 | Sox2 1.2 1 17 | Sox2 20 2 18 | Sox2 21 2 19 | Sox2 22 2 20 | Sox2 23 2 21 | Sox2 0.4 3 22 | Sox2 0.2 3 23 | Sox3 2 1 24 | Sox3 2 2 25 | Sox3 2 3 26 | 27 | }\if{html}{\out{
}}} 28 | 29 | \item{facets}{A set of variables or expressions quoted by \code{\link[ggplot2:vars]{vars()}} 30 | and defining faceting groups on the rows or columns dimension. 31 | The variables can be named (the names are passed to \code{labeller}). 32 | 33 | For compatibility with the classic interface, can also be a 34 | formula or character vector. Use either a one sided formula, \code{~a + b}, 35 | or a character vector, \code{c("a", "b")}.} 36 | } 37 | \value{ 38 | a ggplot2 object 39 | } 40 | \description{ 41 | Get stack violin plot for a normal matrix 42 | } 43 | \examples{ 44 | 45 | random_v <- c(rnorm(10, mean=1, sd=0.1), rnorm(10, mean=5), rnorm(20, mean=10), 46 | rnorm(10, mean=10), rnorm(10, mean=0.2, sd=0.01), rnorm(20, mean=1)) 47 | data <- data.frame(Gene=c(paste0('SOX', rep(2,40)), paste0('SOX', rep(3,40))), 48 | Expr=random_v, Cluster=rep(c(rep(1,10), rep(2,10),rep(3,20)),2)) 49 | stackVlnPlot(data, x="Cluster", y="Expr", facets="Gene") 50 | 51 | } 52 | -------------------------------------------------------------------------------- /man/stackVlnSeuratPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/singlecell.R 3 | \name{stackVlnSeuratPlot} 4 | \alias{stackVlnSeuratPlot} 5 | \title{Get stacked violin plot for seurat object} 6 | \usage{ 7 | stackVlnSeuratPlot(object, features, slot_name = "scale.data") 8 | } 9 | \arguments{ 10 | \item{object}{Seurat object} 11 | 12 | \item{features}{A vector of genes to plot} 13 | 14 | \item{slot_name}{default scale.data, accept data, count} 15 | } 16 | \value{ 17 | a ggplot2 object 18 | } 19 | \description{ 20 | Get stacked violin plot for seurat object 21 | } 22 | \examples{ 23 | 24 | stackVlnSeuratPlot(object = pbmc, features = top10$gene[c(1,3,5)]) 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/twoGroupDEgenes.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/transcriptome.R 3 | \name{twoGroupDEgenes} 4 | \alias{twoGroupDEgenes} 5 | \title{DE genes analysis for two groups.} 6 | \usage{ 7 | twoGroupDEgenes( 8 | dds, 9 | groupA, 10 | groupB, 11 | design = "conditions", 12 | padj = 0.05, 13 | log2FC = 1, 14 | dropCol = c("lfcSE", "stat"), 15 | output_prefix = "ehbio", 16 | normalized_counts = NULL, 17 | lfcShrink = FALSE, 18 | ... 19 | ) 20 | } 21 | \arguments{ 22 | \item{dds}{\code{\link{DESeq}} function returned object.} 23 | 24 | \item{groupA}{Group name 1.} 25 | 26 | \item{groupB}{Group name 2.} 27 | 28 | \item{design}{The group column name. Default "conditions".} 29 | 30 | \item{padj}{Multiple-test corrected p-value. Default 0.05.} 31 | 32 | \item{log2FC}{Log2 transformed fold change. Default 1.} 33 | 34 | \item{dropCol}{Columns to drop in final output. Default \code{c("lfcSE", "stat")}. 35 | Other options \code{"ID", "baseMean", "log2FoldChange", "lfcSE", "stat", "pvalue", "padj"}. 36 | This has no specific usages except make the table clearer.} 37 | 38 | \item{output_prefix}{A string as prefix of output files.} 39 | 40 | \item{normalized_counts}{a data matrix of normalized counts or an object return by \link{deseq2normalizedExpr}. Default NULL.} 41 | 42 | \item{...}{Additional parameters given to \code{\link{ggsave}}.} 43 | } 44 | \description{ 45 | DE genes analysis for two groups. 46 | } 47 | \examples{ 48 | 49 | twoGroupDEgenes(dds, "trt", "untrt") 50 | 51 | } 52 | -------------------------------------------------------------------------------- /man/value.identical.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utilities.R 3 | \name{value.identical} 4 | \alias{value.identical} 5 | \title{Return if unique values of two vectors are the same (order does not matter)} 6 | \usage{ 7 | value.identical(x, y, treat_fully_contain_as_identical = F) 8 | } 9 | \arguments{ 10 | \item{x}{A vector} 11 | 12 | \item{y}{A vector} 13 | } 14 | \value{ 15 | Logial value T or F 16 | } 17 | \description{ 18 | Return if unique values of two vectors are the same (order does not matter) 19 | } 20 | \examples{ 21 | 22 | value.identical(c('a','a','b','d'), c('d','d','a','b')) 23 | 24 | # TRUE 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/volcanoPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{volcanoPlot} 4 | \alias{volcanoPlot} 5 | \title{Volcano plot} 6 | \usage{ 7 | volcanoPlot( 8 | data, 9 | log2FoldChange = "log2FoldChange", 10 | padj = "padj", 11 | colour = "red", 12 | saveplot = NULL, 13 | size = 1, 14 | padjLimit = 10, 15 | width = 13.5, 16 | height = 15, 17 | ... 18 | ) 19 | } 20 | \arguments{ 21 | \item{data}{A dataframe.} 22 | 23 | \item{log2FoldChange}{Specify the columns containing log2 fold change. 24 | Default "log2FoldChange" (suitable for DESeq2 result)} 25 | 26 | \item{padj}{Specify the columns containing adjusted p-value. 27 | Default "padj" (suitable for DESeq2 result)} 28 | 29 | \item{colour}{Specify colour variable. Normally the columns containing 30 | labels to indicate if the genes are up-regulated or down-regulated or 31 | no significant difference.} 32 | 33 | \item{saveplot}{Save plot to given file "a.pdf", "b.png".} 34 | 35 | \item{size}{A number of one column name to specify point size.} 36 | 37 | \item{padjLimit}{Max allowed negative log10 transformed padj. 38 | Default 10.} 39 | 40 | \item{width}{Picture width in "cm".} 41 | 42 | \item{height}{Picture height in "cm".} 43 | 44 | \item{...}{Additional parameters given to \code{\link[ggplot2]{ggsave}}.} 45 | } 46 | \value{ 47 | A ggplot2 object. 48 | } 49 | \description{ 50 | Volcano plot 51 | } 52 | \examples{ 53 | 54 | ### Generate test data 55 | res_output <- data.frame(log2FoldChange=rnorm(3000), row.names=paste0("ImageGP",1:3000)) 56 | res_output$padj <- 20 ^ (-1*(res_output$log2FoldChange^2)) 57 | padj = 0.05 58 | log2FC = 1 59 | res_output$level <- ifelse(res_output$padj<=padj, 60 | ifelse(res_output$log2FoldChange>=log2FC, 61 | paste("groupA","UP"), 62 | ifelse(res_output$log2FoldChange<=(-1)*(log2FC), 63 | paste("groupB","UP"), "NoDiff")) , "NoDiff") 64 | head(res_output) 65 | 66 | volcanoPlot(res_output, colour="level") 67 | 68 | } 69 | -------------------------------------------------------------------------------- /man/waterfalls_plot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/waterfalls.R 3 | \name{waterfalls_plot} 4 | \alias{waterfalls_plot} 5 | \title{Generate waterfall plot using R package waterfalls.} 6 | \usage{ 7 | waterfalls_plot( 8 | waterfallsinput, 9 | sep = "\\t", 10 | row.names = NULL, 11 | header = T, 12 | quote = "", 13 | comment = "", 14 | check.names = F, 15 | labels, 16 | values = NULL, 17 | rect_text_labels = "", 18 | rect_text_size = 1, 19 | put_rect_text_outside_when_value_below = 1, 20 | calc_total = FALSE, 21 | draw_lines = TRUE, 22 | fill_colours = NULL, 23 | lines_anchors = c("right", "left"), 24 | linetype = "dashed", 25 | total_rect_color = "black", 26 | total_rect_text_color = "white", 27 | total_axis_text = "Total", 28 | total_rect_text, 29 | rect_width = 0.9, 30 | draw_axis.x = "behind", 31 | rect_border = "white", 32 | scale_y_to_waterfall = TRUE, 33 | fill_by_sign = FALSE, 34 | theme_text_family = "", 35 | x_label = NULL, 36 | y_label = NULL, 37 | ... 38 | ) 39 | } 40 | \arguments{ 41 | \item{waterfallsinput}{A data.frame containing two columns, 42 | one with the values, the other with the labels.} 43 | 44 | \item{labels}{the labels corresponding to each vector, marked on the x-axis.} 45 | 46 | \item{values}{a numeric vector making up the heights of the rectangles in the waterfall.} 47 | 48 | \item{rect_text_labels}{(character) a character vector of the same length as values that are placed on the rectangles.} 49 | 50 | \item{rect_text_size}{size of the text in the rectangles.} 51 | 52 | \item{put_rect_text_outside_when_value_below}{(numeric) the text labels accompanying a rectangle of this height 53 | will be placed outside the box: below if it's negative; above if it's positive.} 54 | 55 | \item{calc_total}{(logical, default: FALSE) should the final pool of the waterfall be calculated (and placed on the chart).} 56 | 57 | \item{draw_lines}{(logical, default: TRUE) should lines be drawn between successive rectangles.} 58 | 59 | \item{fill_colours}{Colours to be used to fill the rectangles, in order. 60 | Disregarded if fill_by_sign is TRUE (the default).} 61 | 62 | \item{lines_anchors}{a character vector of length two specifying the horizontal placement of the drawn lines relative to the preceding and successive rectangles, respectively.} 63 | 64 | \item{linetype}{the linetype for the draw_lines.} 65 | 66 | \item{total_rect_color}{the color of the final rectangle.} 67 | 68 | \item{total_rect_text_color}{the color of the final rectangle's label text.} 69 | 70 | \item{total_axis_text}{(character) the text appearing on the axis underneath the total rectangle.} 71 | 72 | \item{total_rect_text}{(character) the text in the middle of the rectangle of the total rectangle.} 73 | 74 | \item{rect_width}{(numeric) the width of the rectangle, relative to the space between each label factor.} 75 | 76 | \item{rect_border}{the border around each rectangle. Choose NA if no border is desired.} 77 | 78 | \item{x_label}{The X axis name} 79 | 80 | \item{y_label}{The Y axis name} 81 | 82 | \item{...}{} 83 | 84 | \item{draw_axis_x}{(character) one of "none", "behind", "front" whether to draw an x.axis line and whether to draw it behind or in front of the rectangles, default is behind.} 85 | } 86 | \value{ 87 | pdf image 88 | } 89 | \description{ 90 | Generate waterfall plot using R package waterfalls. 91 | } 92 | \examples{ 93 | 94 | waterfallsinput <- "test.file" 95 | waterfalls_plot(waterfallsinput) 96 | 97 | } 98 | -------------------------------------------------------------------------------- /man/widedataframe2boxplot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/plot.R 3 | \name{widedataframe2boxplot} 4 | \alias{widedataframe2boxplot} 5 | \title{Boxplot for wide data frame (normal gene expression table or OTU abundance table) 6 | used for estimating the overall distrbution of data.} 7 | \usage{ 8 | widedataframe2boxplot(widedataframe, saveplot = NULL, ylab = "", ...) 9 | } 10 | \arguments{ 11 | \item{widedataframe}{A dataframe containing gene expression or OTU abundance with format 12 | like generated by \code{\link{generateAbundanceDF}}.} 13 | 14 | \item{saveplot}{Save plot to given file like "a.pdf", "b.png".} 15 | 16 | \item{ylab}{Y axis title.} 17 | 18 | \item{...}{Other parameters given to \code{\link[ggplot2]{ggsave}}.} 19 | } 20 | \value{ 21 | A ggplot2 object. 22 | } 23 | \description{ 24 | Boxplot for wide data frame (normal gene expression table or OTU abundance table) 25 | used for estimating the overall distrbution of data. 26 | } 27 | \examples{ 28 | 29 | df = generateAbundanceDF() 30 | widedataframe2boxplot(df) 31 | 32 | widedataframe2boxplot(df, saveplot="a.pdf", width=10, height=10, units=c("cm")) 33 | 34 | } 35 | -------------------------------------------------------------------------------- /test/DESeq2_usage.Rmd: -------------------------------------------------------------------------------- 1 | ```{r} 2 | library(DESeq2) 3 | library("RColorBrewer") 4 | library("gplots") 5 | library("amap") 6 | library("ggplot2") 7 | library("BiocParallel") 8 | ``` 9 | 10 | 11 | ```{r} 12 | output_prefix = "ehbio2" 13 | file = "salmon.output" 14 | sampleFile = "sampleFile" 15 | design="conditions" 16 | tx2gene="genome/GRCh38.tx2gene" 17 | type="salmon" 18 | padj=0.05 19 | log2FC=1 20 | ``` 21 | 22 | ## 分步法 23 | 24 | ```{r} 25 | dds <- salmon2deseq(file, sampleFile, design=design, tx2gene=tx2gene) 26 | normexpr <- deseq2normalizedExpr(dds) 27 | ``` 28 | 29 | ```{r} 30 | normalizedExpr2DistribBoxplot(normexpr, 31 | saveplot=paste(output_prefix, "DESeq2.normalizedExprDistrib.pdf", sep=".")) 32 | ``` 33 | 34 | ```{r} 35 | clusterSampleHeatmap2(normexpr$rlog, 36 | cor_file=paste(output_prefix, "DESeq2.sampleCorrelation.txt", sep="."), 37 | saveplot=paste(output_prefix, "DESeq2.sampleCorrelation.pdf", sep=".")) 38 | ``` 39 | 40 | ```{r} 41 | multipleGroupDEgenes(dds, design=design, output_prefix=output_prefix, padj=padj, log2FC=log2FC) 42 | ``` 43 | 44 | ## 一步法 45 | 46 | ```{r} 47 | DESeq2_ysx(file, sampleFile, design=design, type=type, tx2gene=tx2gene, 48 | output_prefix=output_prefix, padj=padj, log2FC=log2FC) 49 | ``` 50 | -------------------------------------------------------------------------------- /test/Plotusage.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Plot_usage" 3 | output: html_document 4 | --- 5 | 6 | ## widedataframe2boxplot 7 | 8 | ```{r} 9 | df = generateAbundanceDF() 10 | head(df) 11 | ``` 12 | 13 | ```{r} 14 | widedataframe2boxplot(df) 15 | ``` 16 | 17 | ```{e} 18 | widedataframe2boxplot(df, saveplot="widedataframe2boxplot.pdf", width=10, height=10, units=c("cm")) 19 | ``` 20 | 21 | ## rankPlot 22 | 23 | 输入数据格式 24 | 25 | ```{r} 26 | a <- data.frame(log2FoldChange=rnorm(1000), row.names=paste0("ImageGP",1:1000)) 27 | head(a) 28 | ``` 29 | 30 | Raw plot 31 | 32 | ```{r} 33 | rankPlot(a) 34 | ``` 35 | 36 | 37 | Label top 10 38 | 39 | ```{r} 40 | rankPlot(a, label=10) 41 | ``` 42 | 43 | Label specified points 44 | 45 | ```{r} 46 | rankPlot(a, label=c("ImageGP1","ImageGP2","ImageGP10")) 47 | ``` 48 | 49 | 50 | Label specified points with new names 51 | 52 | ```{r} 53 | b <- c("A","B","C") 54 | names(b) <- c("ImageGP1","ImageGP2","ImageGP10") 55 | rankPlot(a, label=b) 56 | ``` 57 | 58 | ## volcanoPlot 59 | 60 | Prepare data 61 | 62 | ```{r} 63 | res_output <- data.frame(log2FoldChange=rnorm(3000), row.names=paste0("ImageGP",1:3000)) 64 | res_output$padj <- 20 ^ (-1*(res_output$log2FoldChange^2)) 65 | padj = 0.05 66 | log2FC = 1 67 | res_output$level <- ifelse(res_output$padj<=padj, 68 | ifelse(res_output$log2FoldChange>=log2FC, 69 | paste("groupA","UP"), 70 | ifelse(res_output$log2FoldChange<=(-1)*(log2FC), 71 | paste("groupB","UP"), "NoDiff")) , "NoDiff") 72 | head(res_output) 73 | ``` 74 | 75 | Plot 76 | 77 | ```{r} 78 | volcanoPlot(res_output, colour="level") 79 | ``` 80 | -------------------------------------------------------------------------------- /test/WGCNA_usage.Rmd: -------------------------------------------------------------------------------- 1 | 2 | ```{r} 3 | library(WGCNA) 4 | library(ggplot2) 5 | library(reshape2) 6 | library(stringr) 7 | library(ImageGP) 8 | 9 | options(stringsAsFactors = FALSE) 10 | 11 | if (Sys.info()['sysname'] == "Linux"){ 12 | # 打开多线程 13 | enableWGCNAThreads() 14 | } else { 15 | # if mac 16 | allowWGCNAThreads() 17 | } 18 | # 格式如前面描述 19 | # 常规表达矩阵,log2转换后或 20 | # Deseq2的varianceStabilizingTransformation转换的数据 21 | # 如果有批次效应,需要事先移除,可使用removeBatchEffect 22 | # 如果有系统偏移(可用boxplot查看基因表达分布是否一致), 23 | # 需要quantile normalization 24 | exprMat <- "LiverFemaleClean.txt" 25 | 26 | # 如果没有,设置为空 27 | # traitData <- NULL 28 | traitData <- "TraitsClean.txt" 29 | 30 | wgcnaL <- WGCNA_readindata(exprMat, traitData) 31 | 32 | datExpr <- wgcnaL$datExpr 33 | 34 | WGCNA_dataCheck(datExpr, saveplot="WGCNA_dataCheck.pdf", width=20) 35 | 36 | datExpr <- WGCNA_dataFilter(datExpr) 37 | 38 | #datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr) 39 | 40 | datExpr <- WGCNA_sampleClusterDetectOutlier(datExpr, traitColors=wgcnaL$traitColors, saveplot="WGCNA_sampleClusterDetectOutlier.pdf") 41 | 42 | power <- WGCNA_softpower(datExpr, saveplot="WGCNA_softpower.pdf") 43 | 44 | net <- WGCNA_coexprNetwork(datExpr, power, saveplot="WGCNA_module_generation_plot.pdf") 45 | 46 | MEs_col <- WGCNA_saveModuleAndMe(net, datExpr, saveplot="WGCNA_module_correlation_plot.pdf") 47 | 48 | WGCNA_MEs_traitCorrelationHeatmap(MEs_col, traitData=wgcnaL$traitData, saveplot="WGCNA_moduletrait_correlation_plot.pdf") 49 | 50 | cyt <- WGCNA_cytoscape(net, power, datExpr) 51 | 52 | hubgene <- WGCNA_hubgene(cyt) 53 | 54 | WGCNA_moduleTraitPlot(MEs_col, traitData=wgcnaL$traitData, saveplot="WGCNA_moduleTraitHeatmap.pdf", width=15, height=12) 55 | 56 | geneTraitCor <- WGCNA_ModuleGeneTraitHeatmap(datExpr, traitData=wgcnaL$traitData, net=net, saveplot="WGCNA_ModuleGeneTraitHeatmap.pdf") 57 | 58 | WGCNA_GeneModuleTraitCoorelation(datExpr, MEs_col, geneTraitCor, traitData=wgcnaL$traitData, net) 59 | 60 | ``` 61 | 62 | 63 | -------------------------------------------------------------------------------- /test/test.Rmd: -------------------------------------------------------------------------------- 1 | ```{r} 2 | library(DESeq2) 3 | library("RColorBrewer") 4 | library("gplots") 5 | library("amap") 6 | library("ggplot2") 7 | library("BiocParallel") 8 | ``` 9 | 10 | 11 | ```{r} 12 | output_prefix = "ehbio" 13 | file = "salmon.output" 14 | sampleFile = "sampleFile" 15 | design="conditions" 16 | tx2gene="genome/GRCh38.tx2gene" 17 | type="salmon" 18 | padj=0.05 19 | log2FC=1 20 | ``` 21 | 22 | ## 分步法 23 | 24 | ```{r} 25 | dds <- salmon2deseq(file, sampleFile, design=design, tx2gene=tx2gene) 26 | normexpr <- deseq2normalizedExpr(dds) 27 | ``` 28 | 29 | ```{r} 30 | normalizedExpr2DistribBoxplot(normexpr, 31 | saveplot=paste(output_prefix, "DESeq2.normalizedExprDistrib.pdf", sep=".")) 32 | ``` 33 | 34 | ```{r} 35 | clusterSampleHeatmap2(normexpr$rlog, 36 | output_cor=paste(output_prefix, "DESeq2.sampleCOrrelation.txt", sep="."), 37 | saveplot=paste(output_prefix, "DESeq2.sampleCOrrelation.pdf", sep=".")) 38 | ``` 39 | 40 | ```{r} 41 | multipleGroupDEgenes(dds, design=design, output_prefix=output_prefix, padj=padj, log2FC=log2FC) 42 | ``` 43 | 44 | ## 一步法 45 | 46 | ```{r} 47 | DESeq2_ysx(file, sampleFile, design=design, type=type, tx2gene=tx2gene, 48 | output_prefix=output_prefix, padj=padj, log2FC=log2FC) 49 | ``` 50 | -------------------------------------------------------------------------------- /vignettes/.significance.txt: -------------------------------------------------------------------------------- 1 | ID diff lwr upr p.adj 2 | A.A4cell-Azygote 3.75 0.0628729409633282 7.43712705903667 0.0459748754406435 3 | A.A2cell-Azygote 11.25 7.56287294096333 14.9371270590367 2.74940150901681e-06 4 | A.A2cell-A4cell 7.5 3.81287294096333 11.1871270590367 0.000255439624342158 5 | B.B4cell-Bzygote 3.68 -0.350077788461574 7.71007778846158 0.0757087599140794 6 | B.B2cell-Bzygote 11.18 7.14992221153843 15.2100777884616 1.16940476178051e-05 7 | B.B2cell-B4cell 7.5 3.65747159695228 11.3425284030477 0.000438053358797097 8 | C.C4cell-Czygote 3.68 -0.350077788461574 7.71007778846158 0.0757087599140794 9 | C.C2cell-Czygote 11.18 7.14992221153843 15.2100777884616 1.16940476178051e-05 10 | C.C2cell-C4cell 7.5 3.65747159695228 11.3425284030477 0.000438053358797097 11 | D.D4cell-Dzygote 3.68 -0.350077788461574 7.71007778846158 0.0757087599140794 12 | D.D2cell-Dzygote 11.18 7.14992221153843 15.2100777884616 1.16940476178051e-05 13 | D.D2cell-D4cell 7.5 3.65747159695228 11.3425284030477 0.000438053358797097 14 | -------------------------------------------------------------------------------- /vignettes/Euler.txt: -------------------------------------------------------------------------------- 1 | Intersection Count 2 | Set1&Set2 2 3 | Set1 1 4 | Set2&Set4 1 5 | Set2&Set3&Set4 1 6 | Set2&Set5 1 7 | Set3 1 8 | Set5 1 9 | Set4&Set5 1 10 | Set4 2 11 | Set1&Set3&Set4&Set5 1 12 | Set3&Set5 2 13 | -------------------------------------------------------------------------------- /vignettes/Metadata_traitData.txt: -------------------------------------------------------------------------------- 1 | Sample Boxplot_subgroup 2 | Sample_33_0 Project3_RNAseq_T_cell_Treat 3 | Sample_33_1 Project3_RNAseq_T_cell_Treat 4 | Sample_33_2 Project3_RNAseq_T_cell_Treat 5 | Sample_33_3 Project3_RNAseq_T_cell_Treat 6 | Sample_33_4 Project3_RNAseq_T_cell_Treat 7 | Sample_36_0 Project3_RNAseq_B_cell_Mock 8 | Sample_36_1 Project3_RNAseq_B_cell_Mock 9 | Sample_36_2 Project3_RNAseq_B_cell_Mock 10 | Sample_36_3 Project3_RNAseq_B_cell_Mock 11 | Sample_36_4 Project3_RNAseq_B_cell_Mock 12 | Sample_38_0 Project3_RNAseq_BMDM_Mock 13 | Sample_38_1 Project3_RNAseq_BMDM_Mock 14 | Sample_38_2 Project3_RNAseq_BMDM_Mock 15 | Sample_38_3 Project3_RNAseq_BMDM_Mock 16 | Sample_38_4 Project3_RNAseq_BMDM_Mock -------------------------------------------------------------------------------- /vignettes/Plot.R: -------------------------------------------------------------------------------- 1 | ## ----setup, include = FALSE--------------------------------------------------- 2 | knitr::opts_chunk$set( 3 | collapse = TRUE, 4 | comment = "#>" 5 | ) 6 | 7 | ## ----------------------------------------------------------------------------- 8 | library(ImageGP) 9 | library(plotrix) 10 | library(RColorBrewer) 11 | 12 | set_data = "Set.data" 13 | 14 | flower_plot(set_data) 15 | # flower_plot(set_data, saveplot="Set.data.flower.pdf") 16 | 17 | ## ----------------------------------------------------------------------------- 18 | library(ImageGP) 19 | library(ggplot2) 20 | library(ggrepel) 21 | 22 | res_output <- data.frame(log2FoldChange=rnorm(3000), row.names=paste0("ImageGP",1:3000)) 23 | res_output$padj <- 20 ^ (-1*(res_output$log2FoldChange^2)) 24 | 25 | padj = 0.05 26 | log2FC = 1 27 | res_output$level <- ifelse(res_output$padj<=padj, 28 | ifelse(res_output$log2FoldChange>=log2FC, 29 | paste("groupA","UP"), 30 | ifelse(res_output$log2FoldChange<=(-1)*(log2FC), 31 | paste("groupB","UP"), "NoDiff")) , "NoDiff") 32 | head(res_output) 33 | 34 | # data=res_output; 35 | # log2fc_var="log2FoldChange"; 36 | # fdr_var="padj"; 37 | # coordinate_flip = FALSE; 38 | # status_col = NULL; 39 | # significance_threshold = c(0.05, 1); 40 | # status_col_level = c(); 41 | # point_color_vector = c("red", "green", "grey"); 42 | # log10_transform_fdr = TRUE; 43 | # max_allowed_log10p = Inf; 44 | # title=''; 45 | # point_label_var = 'CTctctCT'; 46 | # log2fc_symmetry = TRUE; 47 | # alpha = NA; 48 | # point_size = 0.8; 49 | # extra_ggplot2_cmd = NULL; 50 | # file_name = NULL; 51 | # xtics_angle = 0; 52 | # x_label = 'Log2 fold change'; 53 | # y_label = 'Negative log10 transformed qvalue'; 54 | # legend.position = "right" 55 | 56 | sp_volcano_plot(data=res_output, 57 | log2fc_var="log2FoldChange", 58 | fdr_var="padj", 59 | status_col = 'level' 60 | ) 61 | 62 | 63 | ## ----------------------------------------------------------------------------- 64 | sp_volcano_plot(data=res_output, 65 | log2fc_var="log2FoldChange", 66 | fdr_var="padj", 67 | significance_threshold = c(0.05, 1) 68 | ) 69 | 70 | ## ----------------------------------------------------------------------------- 71 | # Generate one column containing genes to be labels with their symbol. 72 | # One can also create this column easily using Excel. 73 | 74 | label = c("Pou5f1","Sox2") 75 | names(label) = c("ImageGP1","ImageGP4") 76 | res_output$Symbol <- label[match(rownames(res_output), names(label))] 77 | head(res_output) 78 | 79 | sp_volcano_plot(data=res_output, 80 | log2fc_var="log2FoldChange", 81 | fdr_var="padj", 82 | status_col = 'level', 83 | point_label_var = "Symbol" 84 | ) 85 | 86 | ## ----------------------------------------------------------------------------- 87 | library(ImageGP) 88 | library(ggplot2) 89 | library(dplyr) 90 | 91 | manhattan_data = "manhattan.data" 92 | 93 | sp_manhattan2_plot(data=manhattan_data, ID_var='ID', FDR_var='FDR', title="test1", point_size=2, point_label_var = "Labels") 94 | 95 | -------------------------------------------------------------------------------- /vignettes/Set.data: -------------------------------------------------------------------------------- 1 | Gene Sample 2 | g1 Set1 3 | g2 Set1 4 | a1 Set3 5 | a3 Set1 6 | b4 Set1 7 | g1 Set2 8 | h1 Set4 9 | a3 Set2 10 | b1 Set2 11 | b2 Set2 12 | g2 Set3 13 | g1 Set1 14 | c1 Set3 15 | c3 Set3 16 | b1 Set3 17 | c2 Set5 18 | g2 Set3 19 | d1 Set4 20 | h1 Set2 21 | d3 Set4 22 | b1 Set4 23 | d2 Set4 24 | g2 Set4 25 | a1 Set5 26 | c1 Set5 27 | c3 Set3 28 | d1 Set5 29 | b2 Set5 30 | g2 Set5 -------------------------------------------------------------------------------- /vignettes/bar.data: -------------------------------------------------------------------------------- 1 | ID Gene Exper 2 | Zygote Pou5f1 1 3 | 2_cell Pou5f1 2 4 | 4_cell Pou5f1 4 5 | 8_cell Pou5f1 8 6 | Morula Pou5f1 16 7 | ICM Pou5f1 32 8 | Zygote Sox2 0.5 9 | 2_cell Sox2 1 10 | 4_cell Sox2 2 11 | 8_cell Sox2 4 12 | Morula Sox2 8 13 | ICM Sox2 16 14 | Zygote Gata2 0.3 15 | 2_cell Gata2 0.6 16 | 4_cell Gata2 1.3 17 | 8_cell Gata2 2.6 18 | Morula Gata2 5.2 19 | ICM Gata2 10.4 20 | Zygote cMyc 10.4 21 | 2_cell cMyc 5.2 22 | 4_cell cMyc 2.6 23 | 8_cell cMyc 1.3 24 | Morula cMyc 0.6 25 | ICM cMyc 0.3 26 | Zygote Tet1 16 27 | 2_cell Tet1 8 28 | 4_cell Tet1 4 29 | 8_cell Tet1 2 30 | Morula Tet1 1 31 | ICM Tet1 0.5 32 | Zygote Tet3 32 33 | 2_cell Tet3 16 34 | 4_cell Tet3 8 35 | 8_cell Tet3 4 36 | Morula Tet3 2 37 | ICM Tet3 1 -------------------------------------------------------------------------------- /vignettes/bar.txt: -------------------------------------------------------------------------------- 1 | ID Gene Expression 2 | Zygote Pou5f1 1 3 | 2_cell Pou5f1 2 4 | 4_cell Pou5f1 4 5 | 8_cell Pou5f1 8 6 | Morula Pou5f1 16 7 | ICM Pou5f1 32 8 | Zygote Sox2 0.5 9 | 2_cell Sox2 1 10 | 4_cell Sox2 2 11 | 8_cell Sox2 4 12 | Morula Sox2 8 13 | ICM Sox2 16 14 | Zygote Gata2 0.3 15 | 2_cell Gata2 0.6 16 | 4_cell Gata2 1.3 17 | 8_cell Gata2 2.6 18 | Morula Gata2 5.2 19 | ICM Gata2 10.4 20 | Zygote cMyc 10.4 21 | 2_cell cMyc 5.2 22 | 4_cell cMyc 2.6 23 | 8_cell cMyc 1.3 24 | Morula cMyc 0.6 25 | ICM cMyc 0.3 26 | Zygote Tet1 16 27 | 2_cell Tet1 8 28 | 4_cell Tet1 4 29 | 8_cell Tet1 2 30 | Morula Tet1 1 31 | ICM Tet1 0.5 32 | Zygote Tet3 32 33 | 2_cell Tet3 16 34 | 4_cell Tet3 8 35 | 8_cell Tet3 4 36 | Morula Tet3 2 37 | ICM Tet3 1 -------------------------------------------------------------------------------- /vignettes/barplot_demo4.txt: -------------------------------------------------------------------------------- 1 | Gene Cluster Standard_deviation Mean_value 2 | SOX2 C1 0.11 0.95 3 | SOX2 C2 0.861 5.27 4 | SOX2 C3 0.86 10.66 5 | SOX2 C4 1.00 19.80 6 | SOX2 C5 0.23 1.97 7 | SOX3 C1 1.17 20.35 8 | SOX3 C2 0.0061 0.99 9 | SOX3 C3 0.92 2.03 10 | SOX3 C4 0.27 2.39 11 | SOX3 C5 0.80 2.95 12 | -------------------------------------------------------------------------------- /vignettes/box.data: -------------------------------------------------------------------------------- 1 | Gene Group Expr 2 | A zygote 0.8 3 | A zygote 1.3 4 | A zygote 1.4 5 | A zygote 0.9 6 | A zygote 1.9 7 | A zygote 1.2 8 | A 2cell 8 9 | A 2cell 13 10 | A 2cell 14 11 | A 2cell 9 12 | A 2cell 19 13 | A 2cell 12 14 | A 4cell 3.2 15 | A 4cell 5.2 16 | A 4cell 5.6 17 | A 4cell 3.6 18 | A 4cell 7.6 19 | A 4cell 4.8 20 | B zygote 0.8 21 | B zygote 1.3 22 | B zygote 1.4 23 | B zygote 1.9 24 | B zygote 1.2 25 | B 2cell 8 26 | B 2cell 13 27 | B 2cell 14 28 | B 2cell 9 29 | B 2cell 19 30 | B 2cell 12 31 | B 4cell 3.2 32 | B 4cell 5.2 33 | B 4cell 5.6 34 | B 4cell 3.6 35 | B 4cell 7.6 36 | B 4cell 4.8 37 | C zygote 0.8 38 | C zygote 1.3 39 | C zygote 1.4 40 | C zygote 1.9 41 | C zygote 1.2 42 | C 2cell 8 43 | C 2cell 13 44 | C 2cell 14 45 | C 2cell 9 46 | C 2cell 19 47 | C 2cell 12 48 | C 4cell 3.2 49 | C 4cell 5.2 50 | C 4cell 5.6 51 | C 4cell 3.6 52 | C 4cell 7.6 53 | C 4cell 4.8 54 | D zygote 0.8 55 | D zygote 1.3 56 | D zygote 1.4 57 | D zygote 1.9 58 | D zygote 1.2 59 | D 2cell 8 60 | D 2cell 13 61 | D 2cell 14 62 | D 2cell 9 63 | D 2cell 19 64 | D 2cell 12 65 | D 4cell 3.2 66 | D 4cell 5.2 67 | D 4cell 5.6 68 | D 4cell 3.6 69 | D 4cell 7.6 70 | D 4cell 4.8 -------------------------------------------------------------------------------- /vignettes/enrichment.data: -------------------------------------------------------------------------------- 1 | SampleGroup GeneRatio Qvalue Count Description 2 | Wildtype_up 7/320 0.001836081 7 ERBB signaling pathway 3 | Wildtype_up 13/320 0.01680096 13 Wnt signaling pathway 4 | Wildtype_up 13/320 0.0171473 13 cell-cell signaling by wnt 5 | Wildtype_up 7/320 0.035797856 7 cell cycle G1/S phase transition 6 | Wildtype_up 9/320 0.024164034 9 Extrinsic apoptotic signaling pathway 7 | Wildtype_up 9/320 0.024164034 9 regulation of cell-cell adhesion 8 | Mutant_up 7/320 0.001836081 7 ERBB signaling pathway 9 | Mutant_up 14/342 0.001086508 14 ERK1 and ERK2 cascade 10 | Mutant_up 13/342 0.01680096 13 Wnt signaling pathway 11 | Mutant_up 17/342 0.002228511 17 regulation of cell growth 12 | Mutant_up 15/342 0.005075219 15 regulation of cell-cell adhesion 13 | Mutant_up 10/342 0.040284925 10 neuron apoptotic process 14 | Mutant_up 15/342 0.005075219 15 neuron 15 | -------------------------------------------------------------------------------- /vignettes/exprTable.annocol.txt: -------------------------------------------------------------------------------- 1 | ID Count 2 | Zygote 1 3 | 2_cell 2 4 | 4_cell 4 5 | 8_cell 8 6 | Morula 16 7 | ICM 32 8 | -------------------------------------------------------------------------------- /vignettes/exprTable.annorow.txt: -------------------------------------------------------------------------------- 1 | ID Type 2 | Pou5f1 TF 3 | Sox2 TF 4 | Gata2 TF 5 | cMyc TF 6 | Tet1 Enzyme 7 | Tet3 Enzyme 8 | -------------------------------------------------------------------------------- /vignettes/exprTable.txt: -------------------------------------------------------------------------------- 1 | ID Zygote 2_cell 4_cell 8_cell Morula ICM 2 | Pou5f1 1 2 4 8 16 32 3 | Sox2 0.5 1 2 4 8 16 4 | Gata2 0.3 0.6 1.3 2.6 5.2 10.4 5 | cMyc 10.4 5.2 2.6 1.3 0.6 0.3 6 | Tet1 16 8 4 2 1 0.5 7 | Tet3 32 16 8 4 2 1 -------------------------------------------------------------------------------- /vignettes/exprTable.txt.pheatmap.pdf.reordered.txt: -------------------------------------------------------------------------------- 1 | ID X4_cell Zygote X2_cell X8_cell Morula ICM 2 | Gata2 1.3 0.3 0.6 2.6 5.2 10.4 3 | Pou5f1 4 1 2 8 16 32 4 | Sox2 2 0.5 1 4 8 16 5 | cMyc 2.6 10.4 5.2 1.3 0.6 0.3 6 | Tet1 4 16 8 2 1 0.5 7 | Tet3 8 32 16 4 2 1 8 | -------------------------------------------------------------------------------- /vignettes/exprTable.txt.reordered.txt: -------------------------------------------------------------------------------- 1 | ID X4_cell Zygote X2_cell X8_cell Morula ICM 2 | Gata2 1.3 0.3 0.6 2.6 5.2 10.4 3 | Pou5f1 4 1 2 8 16 32 4 | Sox2 2 0.5 1 4 8 16 5 | cMyc 2.6 10.4 5.2 1.3 0.6 0.3 6 | Tet1 4 16 8 2 1 0.5 7 | Tet3 8 32 16 4 2 1 8 | -------------------------------------------------------------------------------- /vignettes/exprTable2.txt: -------------------------------------------------------------------------------- 1 | ID Zygote 2_cell 4_cell 8_cell Morula ICM 2 | Pou5f1 1\n2 * 4 8 16 32 3 | Sox2 0.5 1 2 4 8 16 4 | Gata2 0.3 0.6 2.6 5.2 10.4 5 | cMyc 10.4 5.2 2.6 1.3 0.6 0.3 6 | Tet1 16 8 2 1 0.5 7 | Tet3 32 16 8 4 2 1 -------------------------------------------------------------------------------- /vignettes/exprTableWithReps.txt: -------------------------------------------------------------------------------- 1 | ID SampleA_1 SampleA_2 SampleA_3 SampleA_4 SampleA_5 SampleA_6 SampleA_7 SampleA_8 SampleA_9 SampleA_10 SampleB_11 SampleB_12 SampleB_13 SampleB_14 SampleB_15 SampleB_16 SampleB_17 SampleB_18 SampleB_19 SampleB_20 2 | Gene_a 3.84 4.89 4.7 4.13 2.88 4.75 2.82 4.45 4.22 1.97 4.71 6.66 6.69 3.04 6.93 4.64 4.14 5.23 3.55 5.39 3 | Gene_b 8.63 6.64 8.05 6.2 8.06 7.21 5.67 7.42 7.26 7.54 4.42 3.47 2.43 4.52 3.53 1.54 1.04 3.06 4.53 2.31 4 | Gene_c 3.33 6.91 3.23 5.97 6.61 4.17 6.08 4.53 4.14 3.88 6.35 5.65 8.26 8.81 8.45 8.44 6.92 5.58 6.01 6.34 5 | -------------------------------------------------------------------------------- /vignettes/goeast.enrich.txt: -------------------------------------------------------------------------------- 1 | GOID Ontology Term Level q m t k log_odds_ratio p 2 | GO:0044699 biological_process single-organism process 1 5781 18620 45240 13378 0.0702743835209307 8.14075020818532e-06 3 | GO:0044763 biological_process single-organism cellular process 2 4988 16172 45240 13378 0.0607717405081849 0.00292494464466067 4 | GO:0007154 biological_process cell communication 2 2169 6843 45240 13378 0.10013758458919 0.00732626105978966 5 | GO:0007165 biological_process signal transduction 5 1955 6136 45240 13378 0.107606603641991 0.00632562888994394 6 | GO:0023052 biological_process signaling 1 2100 6613 45240 13378 0.102820905267163 0.00659072708711282 7 | GO:0044700 biological_process single organism signaling 2 2100 6613 45240 13378 0.102820905267163 0.00659072708711282 8 | GO:0050896 biological_process response to stimulus 1 3251 10438 45240 13378 0.0748466330200461 0.0124720889544723 9 | GO:0005515 molecular_function protein binding 1 3299 10399 45240 13378 0.101392360946023 3.32133986696437e-05 10 | GO:0005737 cellular_component cytoplasm 3 4711 15220 45240 13378 0.065873357227223 0.00157517952693756 11 | GO:0005794 cellular_component Golgi apparatus 6 611 1835 45240 13378 0.171200701038363 0.0574329631867396 12 | GO:0012505 cellular_component endomembrane system 2 1521 4648 45240 13378 0.146146563270177 0.000353056280633608 13 | GO:0044444 cellular_component cytoplasmic part 4 3314 10694 45240 13378 0.0675804047730431 0.0378439363104126 14 | GO:0071944 cellular_component cell periphery 2 2059 6559 45240 13378 0.0862044338656731 0.0656637225301536 15 | -------------------------------------------------------------------------------- /vignettes/group_pcoa.data: -------------------------------------------------------------------------------- 1 | SampleID genotype 2 | KO1 KO 3 | KO2 KO 4 | KO3 KO 5 | KO4 KO 6 | KO5 KO 7 | KO6 KO 8 | OE1 OE 9 | OE2 OE 10 | OE3 OE 11 | OE4 OE 12 | OE5 OE 13 | OE6 OE 14 | WT1 WT 15 | WT2 WT 16 | WT3 WT 17 | WT4 WT 18 | WT5 WT 19 | WT6 WT -------------------------------------------------------------------------------- /vignettes/histogram.data: -------------------------------------------------------------------------------- 1 | Type Value 2 | mC 5.499520933 3 | mC 5.564945322 4 | mC 7.461706447 5 | mC 5.553236911 6 | mC 6.688437598 7 | mC 4.51997249 8 | mC 3.777809088 9 | mC 4.64674926 10 | mC 5.284681958 11 | mC 4.578183952 12 | mC 5.97094861 13 | mC 6.502498272 14 | mC 3.757450674 15 | mC 5.56781739 16 | mC 5.473010811 17 | mC 3.240244746 18 | mC 4.39837858 19 | mC 4.313959759 20 | mC 4.793524574 21 | mC 3.142878543 22 | mC 5.347068141 23 | mC 5.081631203 24 | mC 4.482278174 25 | mC 4.415793153 26 | mC 4.208363598 27 | mC 4.170448043 28 | mC 5.775809352 29 | mC 5.694084654 30 | mC 4.358983418 31 | mC 4.236590935 32 | mC 5.181071963 33 | mC 5.10167358 34 | mC 4.828362588 35 | mC 3.601681739 36 | mC 4.520482177 37 | mC 4.398290919 38 | mC 7.262382071 39 | mC 5.466047089 40 | mC 4.037573894 41 | mC 6.249244337 42 | mC 4.275277031 43 | mC 6.227754432 44 | mC 3.978082406 45 | mC 4.391096906 46 | mC 4.475851047 47 | mC 4.738078252 48 | mC 4.505180768 49 | mC 4.609038734 50 | mC 4.519214188 51 | mC 5.138427334 52 | mC 4.369969089 53 | mC 3.874940746 54 | mC 4.409510466 55 | mC 4.7083905 56 | mC 4.957578501 57 | mC 6.656673528 58 | mC 4.238709434 59 | mC 4.561907753 60 | mC 6.566016533 61 | mC 4.653457166 62 | mC 5.48890301 63 | mC 3.31856845 64 | mC 5.892464861 65 | mC 5.205833513 66 | mC 5.124558367 67 | mC 5.335184577 68 | mC 5.97076192 69 | mC 4.914508855 70 | mC 4.729868157 71 | mC 4.547595663 72 | mC 4.339847043 73 | mC 6.099142875 74 | mC 4.461505687 75 | mC 5.574605148 76 | mC 4.42689166 77 | mC 4.936211708 78 | mC 5.627026594 79 | mC 5.289944587 80 | mC 4.848021858 81 | mC 3.592006005 82 | mC 4.265041345 83 | mC 5.136380292 84 | mC 4.286381586 85 | mC 5.555040721 86 | mC 6.585889345 87 | mC 4.402409709 88 | mC 5.638931279 89 | mC 3.904532893 90 | mC 5.062373812 91 | mC 4.652672121 92 | mC 5.665771685 93 | mC 5.192752655 94 | mC 5.43360227 95 | mC 5.227215839 96 | mC 4.837578441 97 | mC 4.517212589 98 | mC 4.54993211 99 | mC 5.07336833 100 | mC 2.695098484 101 | mC 4.359538356 102 | CTCF 5.538549778 103 | CTCF 6.718929076 104 | CTCF 5.957321989 105 | CTCF 4.471701446 106 | CTCF 3.356621062 107 | CTCF 3.700933262 108 | CTCF 6.091835516 109 | CTCF 4.965512061 110 | CTCF 4.440350518 111 | CTCF 2.749764999 112 | CTCF 4.637791841 113 | CTCF 6.234119698 114 | CTCF 5.513301136 115 | CTCF 3.912706297 116 | CTCF 5.328403774 117 | CTCF 7.176334731 118 | CTCF 5.572600702 119 | CTCF 3.469664318 120 | CTCF 3.554430936 121 | CTCF 4.498059565 122 | CTCF 4.94214533 123 | CTCF 6.715624155 124 | CTCF 3.761058758 125 | CTCF 4.030655599 126 | CTCF 4.582476123 127 | CTCF 5.689893861 128 | CTCF 2.717764379 129 | CTCF 5.724574599 130 | CTCF 6.317386942 131 | CTCF 4.172582259 132 | CTCF 3.503664928 133 | CTCF 3.54042767 134 | CTCF 2.985176169 135 | CTCF 4.893020262 136 | CTCF 6.204835104 137 | CTCF 5.579009369 138 | CTCF 6.788080231 139 | CTCF 7.434118777 140 | CTCF 6.863157491 141 | CTCF 7.260060438 142 | CTCF 7.179838073 143 | CTCF 5.073618536 144 | CTCF 5.066727846 145 | CTCF 7.268048471 146 | CTCF 7.136032176 147 | CTCF 5.475982219 148 | CTCF 7.457865189 149 | CTCF 7.274871642 150 | CTCF 4.553641756 151 | CTCF 4.67611124 152 | CTCF 3.909158002 153 | CTCF 5.382547508 154 | CTCF 5.168553579 155 | CTCF 6.342537197 156 | CTCF 4.75695803 157 | CTCF 3.088358998 158 | CTCF 4.483567903 159 | CTCF 4.572543082 160 | CTCF 4.166735291 161 | CTCF 2.749907447 162 | CTCF 3.724998447 163 | CTCF 4.97358605 164 | CTCF 6.2785919 165 | CTCF 6.98525148 166 | CTCF 4.187818516 167 | CTCF 5.485827081 168 | CTCF 4.391864999 169 | CTCF 3.484321635 170 | CTCF 5.009463184 171 | CTCF 2.834608217 172 | CTCF 5.919660383 173 | CTCF 5.520895307 174 | CTCF 7.389281187 175 | CTCF 7.330936475 176 | CTCF 3.341121539 177 | CTCF 6.06870773 178 | CTCF 2.818283693 179 | CTCF 2.711921619 180 | CTCF 6.676402245 181 | CTCF 3.720218528 182 | CTCF 5.750210355 183 | CTCF 4.632733392 184 | CTCF 4.11820292 185 | CTCF 6.906845117 186 | CTCF 5.889242902 187 | CTCF 6.811711623 188 | CTCF 4.504791679 189 | CTCF 4.309243573 190 | CTCF 4.579060621 191 | CTCF 2.955427462 192 | CTCF 4.143028546 193 | CTCF 4.664467399 194 | CTCF 7.323542756 195 | CTCF 7.342313871 196 | CTCF 3.483057144 197 | CTCF 3.550135358 198 | CTCF 3.097268581 199 | CTCF 4.294228968 200 | CTCF 2.737853208 201 | CTCF 6.617702824 -------------------------------------------------------------------------------- /vignettes/histogram.demo1.txt: -------------------------------------------------------------------------------- 1 | sex weight 2 | F 49 3 | F 56 4 | F 60 5 | F 43 6 | F 57 7 | F 58 8 | F 52 9 | F 52 10 | F 52 11 | F 51 12 | F 53 13 | F 50 14 | F 51 15 | F 55 16 | F 60 17 | F 54 18 | F 52 19 | F 50 20 | F 51 21 | F 67 22 | F 56 23 | F 53 24 | F 53 25 | F 57 26 | F 52 27 | F 48 28 | F 58 29 | F 50 30 | F 55 31 | F 50 32 | F 61 33 | F 53 34 | F 51 35 | F 52 36 | F 47 37 | F 49 38 | F 44 39 | F 48 40 | F 54 41 | F 53 42 | F 62 43 | F 50 44 | F 51 45 | F 54 46 | F 50 47 | F 50 48 | F 49 49 | F 49 50 | F 52 51 | F 53 52 | F 46 53 | F 52 54 | F 49 55 | F 50 56 | F 54 57 | F 58 58 | F 63 59 | F 51 60 | F 63 61 | F 49 62 | F 58 63 | F 68 64 | F 55 65 | F 52 66 | F 55 67 | F 64 68 | F 49 69 | F 62 70 | F 62 71 | F 57 72 | F 55 73 | F 53 74 | F 53 75 | F 58 76 | F 65 77 | F 54 78 | F 48 79 | F 51 80 | F 56 81 | F 53 82 | F 54 83 | F 54 84 | F 48 85 | F 54 86 | F 59 87 | F 58 88 | F 58 89 | F 53 90 | F 54 91 | F 49 92 | F 55 93 | F 56 94 | F 64 95 | F 60 96 | F 53 97 | F 57 98 | F 49 99 | F 59 100 | F 60 101 | F 66 102 | F 57 103 | F 53 104 | F 55 105 | F 52 106 | F 51 107 | F 56 108 | F 51 109 | F 56 110 | F 57 111 | F 55 112 | F 54 113 | F 52 114 | F 49 115 | F 59 116 | F 55 117 | F 59 118 | F 49 119 | F 56 120 | F 58 121 | F 55 122 | F 54 123 | F 51 124 | F 65 125 | F 59 126 | F 64 127 | F 55 128 | F 52 129 | F 47 130 | F 52 131 | F 56 132 | F 60 133 | F 56 134 | F 49 135 | F 58 136 | F 47 137 | F 53 138 | F 53 139 | F 45 140 | F 60 141 | F 52 142 | F 53 143 | F 62 144 | F 58 145 | F 54 146 | F 58 147 | F 57 148 | F 63 149 | F 56 150 | F 58 151 | F 57 152 | F 53 153 | F 55 154 | F 63 155 | F 51 156 | F 56 157 | F 62 158 | F 54 159 | F 50 160 | F 51 161 | F 53 162 | F 51 163 | F 54 164 | F 53 165 | F 54 166 | F 57 167 | F 58 168 | F 63 169 | F 55 170 | F 53 171 | F 62 172 | F 64 173 | F 55 174 | F 53 175 | F 46 176 | F 62 177 | F 51 178 | F 49 179 | F 70 180 | F 56 181 | F 55 182 | F 41 183 | F 55 184 | F 60 185 | F 57 186 | F 60 187 | F 65 188 | F 61 189 | F 52 190 | F 59 191 | F 54 192 | F 52 193 | F 41 194 | F 51 195 | F 57 196 | F 66 197 | F 58 198 | F 58 199 | F 50 200 | F 56 201 | F 45 202 | M 67 203 | M 68 204 | M 66 205 | M 69 206 | M 67 207 | M 69 208 | M 74 209 | M 71 210 | M 65 211 | M 59 212 | M 67 213 | M 63 214 | M 72 215 | M 57 216 | M 63 217 | M 67 218 | M 64 219 | M 62 220 | M 63 221 | M 68 222 | M 69 223 | M 68 224 | M 76 225 | M 71 226 | M 66 227 | M 62 228 | M 80 229 | M 68 230 | M 62 231 | M 66 232 | M 63 233 | M 64 234 | M 60 235 | M 66 236 | M 67 237 | M 60 238 | M 49 239 | M 64 240 | M 65 241 | M 68 242 | M 65 243 | M 67 244 | M 60 245 | M 69 246 | M 69 247 | M 66 248 | M 72 249 | M 67 250 | M 66 251 | M 66 252 | M 67 253 | M 70 254 | M 67 255 | M 68 256 | M 59 257 | M 63 258 | M 72 259 | M 59 260 | M 66 261 | M 67 262 | M 70 263 | M 63 264 | M 66 265 | M 56 266 | M 67 267 | M 62 268 | M 64 269 | M 59 270 | M 67 271 | M 68 272 | M 63 273 | M 74 274 | M 68 275 | M 70 276 | M 75 277 | M 62 278 | M 69 279 | M 70 280 | M 65 281 | M 67 282 | M 60 283 | M 67 284 | M 61 285 | M 69 286 | M 61 287 | M 67 288 | M 61 289 | M 64 290 | M 57 291 | M 66 292 | M 70 293 | M 66 294 | M 56 295 | M 62 296 | M 73 297 | M 74 298 | M 59 299 | M 63 300 | M 67 301 | M 67 302 | M 62 303 | M 60 304 | M 64 305 | M 70 306 | M 65 307 | M 62 308 | M 62 309 | M 73 310 | M 63 311 | M 69 312 | M 72 313 | M 67 314 | M 63 315 | M 65 316 | M 63 317 | M 71 318 | M 64 319 | M 73 320 | M 62 321 | M 62 322 | M 66 323 | M 65 324 | M 62 325 | M 57 326 | M 65 327 | M 61 328 | M 70 329 | M 60 330 | M 71 331 | M 62 332 | M 66 333 | M 69 334 | M 62 335 | M 68 336 | M 65 337 | M 59 338 | M 64 339 | M 73 340 | M 64 341 | M 61 342 | M 65 343 | M 67 344 | M 70 345 | M 71 346 | M 66 347 | M 71 348 | M 61 349 | M 53 350 | M 63 351 | M 62 352 | M 53 353 | M 68 354 | M 61 355 | M 64 356 | M 57 357 | M 68 358 | M 74 359 | M 61 360 | M 64 361 | M 75 362 | M 70 363 | M 75 364 | M 65 365 | M 64 366 | M 62 367 | M 72 368 | M 59 369 | M 67 370 | M 65 371 | M 76 372 | M 62 373 | M 57 374 | M 66 375 | M 65 376 | M 61 377 | M 66 378 | M 64 379 | M 62 380 | M 68 381 | M 63 382 | M 56 383 | M 52 384 | M 62 385 | M 72 386 | M 69 387 | M 71 388 | M 70 389 | M 67 390 | M 57 391 | M 66 392 | M 73 393 | M 48 394 | M 61 395 | M 71 396 | M 68 397 | M 69 398 | M 67 399 | M 68 400 | M 65 401 | M 60 402 | -------------------------------------------------------------------------------- /vignettes/inflectionpoint.txt: -------------------------------------------------------------------------------- 1 | POS1 1 2 | POS2 2 3 | POS3 5 4 | POS4 5 5 | POS5 20 -------------------------------------------------------------------------------- /vignettes/iqtree.treefile: -------------------------------------------------------------------------------- 1 | (Aca8437:0.2984183709,((((((((((Aca8644:0.0412143857,Ata17593:0.0222488097)100/100:0.3010885792,(Aca10743:0.0116092159,Asz22669:0.0689841017)100/100:0.3828497012)84.5/90:0.0409388876,((((Aca11793:0.0649384196,Asz10159:0.0454103170)79.3/86:0.0101088036,Ata35670:0.1463794038)50.8/82:0.0142061064,Asi8620:0.0754587449)96.9/99:0.0877546154,Asz12054:0.0897577621)99.8/100:0.2234393136)24.9/42:0.0444669473,(((Aca10517:0.2064342670,Ata8077:0.1168254539)100/100:0.2316917258,Ata17379:0.2776805230)78.2/89:0.0628379234,(((Aca11819:0.0895881049,Aca12074:0.1498910277)84.1/90:0.0130627878,(Asz6283:0.0669225538,Ata29337:0.0326585948)92.3/100:0.0199770747)98.5/95:0.0742859650,Ata29764:0.2071067239)100/100:0.1432299561)99.8/100:0.1127076023)89.3/62:0.0849083511,Ata10344:0.4417385626)34.7/24:0.0195793799,(((((((((Aca9298:0.0089999115,Aca9565:0.0167236216)99.7/100:0.0706305235,(Aca14963:0.0844529599,Asz3542:0.0781378401)98.7/100:0.0580588959)23.8/75:0.0156083653,Aca11324:0.0628035788)100/100:0.2266284482,Ata31153:0.1112430674)12.9/55:0.0056917656,Asi7526:0.1851444032)75.9/71:0.0241351612,Ata31154:0.0794494698)0/42:0.0000028431,((Aca9717:0.0270442856,Asz5065:0.0466069731)97.6/100:0.0263623796,((Aca10131:0.0000025898,Pvu270:0.0101078970)33.2/58:0.0228732418,Aca10198:0.0175345933)100/99:0.0882128337)99.1/99:0.0612005553)100/100:0.1716613867,((Aca9576:0.0059857262,Asz10275:0.0043279615)86/98:0.0158113232,Ata21469:0.0147934536)100/100:0.1899264208)0/71:0.0000031655,((Rru27931:0.2210921154,Rru45085:0.4209040975)97.9/100:0.8832172903,Sba2910:0.8784317952)95.5/96:0.6957861643)83.5/57:0.0952988662)55.2/41:0.0177947292,(((Aca9536:0.0280658816,Aca12095:0.0198333086)99.4/100:0.0400222434,(Aca11488:0.0421901585,(Aca11732:0.0923131417,Asz14659:0.0373182142)89.2/99:0.0121711316)89/99:0.0138591382)92.8/97:0.0282887163,Asi13177:0.1104735738)100/100:0.2386747646)90.9/46:0.0360404578,((((Aca12627:0.1402161977,Ata3867:0.0474104333)90/97:0.0469698725,Asz23002:0.1283531885)95.4/99:0.0599594148,Aca13655:0.1795985555)99.9/100:0.1388109144,Ata6895:0.2685846343)100/100:0.1792964894)97.7/56:0.0554252496,(((((Aca9664:0.1059992050,Ata4131:0.0915010550)99.8/100:0.1073152631,Ata17392:0.1877573062)99.1/99:0.0950716666,(Asz14585:0.1384663620,Ata2954:0.1737144337)100/100:0.1845281826)98.7/99:0.1070487881,(Asi6390:0.1032673522,Ata24183:0.0000026467)100/100:0.2341431926)97.2/89:0.0722564163,(Asi15178:0.3835636900,Ata24032:0.2829868449)35.9/41:0.0184338848)95.2/55:0.0461451806)65.6/86:0.0354284567,Asi1501:0.3886788192)98.2/100:0.0726744000,(Ata25669:0.3553919137,(Ata27463:0.1864432004,Ata30440:0.2442278635)96.8/100:0.0742599512)98.8/100:0.1008319072); 2 | -------------------------------------------------------------------------------- /vignettes/line.data: -------------------------------------------------------------------------------- 1 | Pos Variable value 2 | -5000 H3K27ac 9.05497 3 | -4000 H3K27ac 8.95497 4 | -3000 H3K27ac 8.25497 5 | -2000 H3K27ac 7.16265 6 | -1000 H3K27ac 3.55341 7 | 0 H3K27ac 3.55030 8 | 1000 H3K27ac 7.07502 9 | 2000 H3K27ac 8.24328 10 | 3000 H3K27ac 8.43869 11 | 4000 H3K27ac 8.83869 12 | 5000 H3K27ac 9.03869 13 | -5000 CTCF 8.05497 14 | -4000 CTCF 7.95497 15 | -3000 CTCF 7.25497 16 | -2000 CTCF 6.16265 17 | -1000 CTCF 2.55341 18 | 0 CTCF 2.55030 19 | 1000 CTCF 6.07502 20 | 2000 CTCF 7.24328 21 | 3000 CTCF 7.43869 22 | 4000 CTCF 7.83869 23 | 5000 CTCF 8.03869 -------------------------------------------------------------------------------- /vignettes/metadata.txt: -------------------------------------------------------------------------------- 1 | Sample Group Class 2 | SampleA_1 GroupA ConditionC 3 | SampleA_2 GroupA ConditionC 4 | SampleA_3 GroupA ConditionC 5 | SampleA_4 GroupA ConditionC 6 | SampleA_5 GroupA ConditionC 7 | SampleA_6 GroupA ConditionD 8 | SampleA_7 GroupA ConditionD 9 | SampleA_8 GroupA ConditionD 10 | SampleA_9 GroupA ConditionD 11 | SampleA_10 GroupA ConditionD 12 | SampleB_11 GroupB ConditionC 13 | SampleB_12 GroupB ConditionC 14 | SampleB_13 GroupB ConditionC 15 | SampleB_14 GroupB ConditionC 16 | SampleB_15 GroupB ConditionC 17 | SampleB_16 GroupB ConditionD 18 | SampleB_17 GroupB ConditionD 19 | SampleB_18 GroupB ConditionD 20 | SampleB_19 GroupB ConditionD 21 | SampleB_20 GroupB ConditionD 22 | -------------------------------------------------------------------------------- /vignettes/otuabundance.txt: -------------------------------------------------------------------------------- 1 | ID Sample1 Sample2 Sample3 Sample4 Sample5 Sample6 Sample7 Sample8 Sample9 Sample10 Sample11 Sample12 Sample13 Sample14 Sample15 Sample16 Sample17 Sample18 Sample19 Sample20 2 | OTU_1 1 3 0 0 2 2 2 0 0 4 0 0 0 0 0 0 2 0 0 0 3 | OTU_2 0 0 4 8 0 0 0 4 3 0 0 4 5 4 4 7 0 0 0 5 4 | OTU_3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 3 0 5 | OTU_4 0 2 7 2 0 0 0 5 3 0 0 8 5 0 0 4 0 0 0 0 6 | OTU_5 0 0 0 0 4 3 2 0 0 4 0 0 0 0 0 0 4 0 4 0 7 | OTU_6 0 3 2 2 2 0 0 0 0 2 0 0 0 0 0 0 0 2 0 0 8 | OTU_7 0 4 0 3 2 0 2 0 0 4 0 0 0 0 0 0 0 0 0 0 9 | OTU_8 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 10 | OTU_9 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 | OTU_10 0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 0 0 0 0 0 12 | OTU_11 0 0 0 0 0 0 0 4 0 0 0 0 0 4 5 8 0 0 0 4 13 | OTU_12 4 4 4 4 4 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 14 | OTU_13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 15 | OTU_14 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 2 0 5 0 16 | OTU_15 0 0 0 0 0 0 0 4 4 0 0 0 0 0 3 3 0 0 0 4 17 | OTU_16 0 0 0 0 0 0 2 0 4 0 0 4 3 0 0 0 0 0 0 0 18 | OTU_17 7 5 6 5 2 6 6 4 2 6 7 0 0 0 0 0 0 2 0 0 19 | OTU_18 0 0 0 0 5 5 5 0 0 3 3 0 0 0 0 0 2 3 0 0 20 | OTU_19 4 4 5 4 2 3 4 4 4 4 4 0 2 0 0 0 1 3 0 0 21 | OTU_20 2 7 6 5 6 4 5 4 5 4 0 4 9 0 0 2 0 0 0 0 22 | OTU_21 0 0 0 0 0 0 0 2 0 0 0 0 2 2 2 2 0 0 0 4 23 | OTU_22 0 0 0 0 5 6 3 0 2 0 0 2 0 0 0 0 0 0 0 0 24 | OTU_23 0 0 0 5 0 0 0 2 2 0 2 4 2 0 0 0 0 0 3 0 25 | OTU_24 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 5 26 | OTU_25 0 5 2 2 3 3 3 3 2 3 5 2 2 2 2 0 2 5 6 2 27 | OTU_26 0 0 0 0 2 5 2 0 0 0 0 0 0 0 0 0 0 0 0 0 28 | OTU_27 0 5 2 1 2 5 2 2 3 6 3 3 2 6 1 0 0 2 2 0 29 | OTU_28 0 0 0 0 0 0 0 0 0 1 2 0 0 0 0 0 0 1 0 0 30 | OTU_29 0 0 2 2 2 6 2 2 2 2 4 4 0 0 4 4 0 6 3 4 31 | OTU_30 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 3 0 0 0 3 32 | 33 | -------------------------------------------------------------------------------- /vignettes/otuabundancephenodata.txt: -------------------------------------------------------------------------------- 1 | ID A1 Moisture Management Use Manure 2 | Sample1 2.8 1 SF Haypastu 4 3 | Sample2 3.5 1 BF Haypastu 2 4 | Sample3 4.3 2 SF Haypastu 4 5 | Sample4 4.2 2 SF Haypastu 4 6 | Sample5 6.3 1 HF Hayfield 2 7 | Sample6 4.3 1 HF Haypastu 2 8 | Sample7 2.8 1 HF Pasture 3 9 | Sample8 4.2 5 HF Pasture 3 10 | Sample9 3.7 4 HF Hayfield 1 11 | Sample10 3.3 2 BF Hayfield 1 12 | Sample11 3.5 1 BF Pasture 1 13 | Sample12 5.8 4 SF Haypastu 2 14 | Sample13 6 5 SF Haypastu 3 15 | Sample14 9.3 5 NM Pasture 0 16 | Sample15 11.5 5 NM Haypastu 0 17 | Sample16 5.7 5 SF Pasture 3 18 | Sample17 4 2 NM Hayfield 0 19 | Sample18 4.6 1 NM Hayfield 0 20 | Sample19 3.7 5 NM Hayfield 0 21 | Sample20 3.5 5 NM Hayfield 0 22 | 23 | -------------------------------------------------------------------------------- /vignettes/pca_group.data: -------------------------------------------------------------------------------- 1 | Samp Conditions Diameters Batch 2 | Untrt_N61311 untrt 1.75 A 3 | Untrt_N052611 untrt 1.7 A 4 | Untrt_N080611 untrt 2 C 5 | Untrt_N061011 untrt 1.8 C 6 | Trt_N61311 Trt 3 B 7 | Trt_N052611 Trt 3.1 D 8 | Trt_N080611 Trt 3.2 B 9 | Trt_N061011 Trt 3.1 D -------------------------------------------------------------------------------- /vignettes/pcoa.data: -------------------------------------------------------------------------------- 1 | bray_curtis KO1 KO2 KO3 KO4 KO5 KO6 OE1 OE2 OE3 OE4 OE5 OE6 WT1 WT2 WT3 WT4 WT5 WT6 2 | KO1 0 0.282 0.317 0.267 0.332 0.253 0.327 0.357 0.319 0.288 0.292 0.311 0.310 0.319 0.301 0.311 0.326 0.283 3 | KO2 0.282 0 0.355 0.338 0.432 0.308 0.331 0.331 0.332 0.326 0.297 0.325 0.298 0.339 0.283 0.295 0.342 0.295 4 | KO3 0.317 0.355 0 0.314 0.331 0.316 0.422 0.398 0.357 0.355 0.358 0.407 0.375 0.364 0.365 0.351 0.355 0.324 5 | KO4 0.267 0.338 0.314 0 0.325 0.262 0.397 0.401 0.347 0.334 0.332 0.386 0.333 0.335 0.347 0.344 0.337 0.323 6 | KO5 0.332 0.432 0.331 0.325 0 0.326 0.478 0.448 0.427 0.392 0.398 0.468 0.395 0.368 0.410 0.404 0.369 0.379 7 | KO6 0.253 0.308 0.316 0.262 0.326 0 0.383 0.401 0.348 0.329 0.323 0.359 0.345 0.351 0.336 0.337 0.335 0.332 8 | OE1 0.327 0.331 0.422 0.397 0.478 0.383 0 0.292 0.312 0.303 0.267 0.228 0.322 0.352 0.254 0.318 0.351 0.282 9 | OE2 0.357 0.331 0.398 0.401 0.448 0.401 0.292 0 0.298 0.302 0.271 0.302 0.299 0.365 0.274 0.330 0.342 0.269 10 | OE3 0.319 0.332 0.357 0.347 0.427 0.348 0.312 0.298 0 0.244 0.279 0.301 0.271 0.302 0.273 0.286 0.298 0.265 11 | OE4 0.288 0.326 0.355 0.334 0.392 0.329 0.303 0.302 0.244 0 0.268 0.293 0.273 0.294 0.262 0.269 0.294 0.256 12 | OE5 0.292 0.297 0.358 0.332 0.398 0.323 0.267 0.271 0.279 0.268 0 0.258 0.271 0.298 0.230 0.260 0.268 0.232 13 | OE6 0.311 0.325 0.407 0.386 0.468 0.359 0.228 0.302 0.301 0.293 0.258 0 0.317 0.359 0.270 0.312 0.337 0.294 14 | WT1 0.310 0.298 0.375 0.333 0.395 0.345 0.322 0.299 0.271 0.273 0.271 0.317 0 0.234 0.254 0.274 0.262 0.253 15 | WT2 0.319 0.339 0.364 0.335 0.368 0.351 0.352 0.365 0.302 0.294 0.298 0.359 0.234 0 0.282 0.267 0.269 0.291 16 | WT3 0.301 0.283 0.365 0.347 0.410 0.336 0.254 0.274 0.273 0.262 0.230 0.270 0.254 0.282 0 0.247 0.293 0.227 17 | WT4 0.311 0.295 0.351 0.344 0.404 0.337 0.318 0.330 0.286 0.269 0.260 0.312 0.274 0.267 0.247 0 0.304 0.262 18 | WT5 0.326 0.342 0.355 0.337 0.369 0.335 0.351 0.342 0.298 0.294 0.268 0.337 0.262 0.269 0.293 0.304 0 0.266 19 | WT6 0.283 0.295 0.324 0.323 0.379 0.332 0.282 0.269 0.265 0.256 0.232 0.294 0.253 0.291 0.227 0.262 0.266 0 -------------------------------------------------------------------------------- /vignettes/pheatmap.pdf.reordered.txt: -------------------------------------------------------------------------------- 1 | ID Tet3 Gata2 Pou5f1 cMyc Sox2 Tet1 2 | Tet3 0 0.813 0.778 0.511 0.778 0.333 3 | Gata2 0.813 0 0.511 0.784 0.214 0.78 4 | Pou5f1 0.778 0.511 0 0.813 0.333 0.778 5 | cMyc 0.511 0.784 0.813 0 0.78 0.214 6 | Sox2 0.778 0.214 0.333 0.78 0 0.778 7 | Tet1 0.333 0.78 0.778 0.214 0.778 0 8 | -------------------------------------------------------------------------------- /vignettes/scatter.txt: -------------------------------------------------------------------------------- 1 | Samp X_val Y_val Color Size Shape 2 | a 1 1 grp1 10 cluster1 3 | b 2 2 grp1 10 cluster1 4 | c 1 3 grp1 10 cluster1 5 | d 3 1 grp2 15 cluster2 6 | e 2 2 grp2 15 cluster2 7 | f 3 3 grp3 5 cluster2 8 | g 2 1 grp3 5 cluster2 -------------------------------------------------------------------------------- /vignettes/scatter3.txt: -------------------------------------------------------------------------------- 1 | eruptions waiting 2 | 3.6 79 3 | 1.8 54 4 | 3.333 74 5 | 2.283 62 6 | 4.533 85 7 | 2.883 55 8 | 4.7 88 9 | 3.6 85 10 | 1.95 51 11 | 4.35 85 12 | 1.833 54 13 | 3.917 84 14 | 4.2 78 15 | 1.75 47 16 | 4.7 83 17 | 2.167 52 18 | 1.75 62 19 | 4.8 84 20 | 1.6 52 21 | 4.25 79 22 | 1.8 51 23 | 1.75 47 24 | 3.45 78 25 | 3.067 69 26 | 4.533 74 27 | 3.6 83 28 | 1.967 55 29 | 4.083 76 30 | 3.85 78 31 | 4.433 79 32 | 4.3 73 33 | 4.467 77 34 | 3.367 66 35 | 4.033 80 36 | 3.833 74 37 | 2.017 52 38 | 1.867 48 39 | 4.833 80 40 | 1.833 59 41 | 4.783 90 42 | 4.35 80 43 | 1.883 58 44 | 4.567 84 45 | 1.75 58 46 | 4.533 73 47 | 3.317 83 48 | 3.833 64 49 | 2.1 53 50 | 4.633 82 51 | 2 59 52 | 4.8 75 53 | 4.716 90 54 | 1.833 54 55 | 4.833 80 56 | 1.733 54 57 | 4.883 83 58 | 3.717 71 59 | 1.667 64 60 | 4.567 77 61 | 4.317 81 62 | 2.233 59 63 | 4.5 84 64 | 1.75 48 65 | 4.8 82 66 | 1.817 60 67 | 4.4 92 68 | 4.167 78 69 | 4.7 78 70 | 2.067 65 71 | 4.7 73 72 | 4.033 82 73 | 1.967 56 74 | 4.5 79 75 | 4 71 76 | 1.983 62 77 | 5.067 76 78 | 2.017 60 79 | 4.567 78 80 | 3.883 76 81 | 3.6 83 82 | 4.133 75 83 | 4.333 82 84 | 4.1 70 85 | 2.633 65 86 | 4.067 73 87 | 4.933 88 88 | 3.95 76 89 | 4.517 80 90 | 2.167 48 91 | 4 86 92 | 2.2 60 93 | 4.333 90 94 | 1.867 50 95 | 4.817 78 96 | 1.833 63 97 | 4.3 72 98 | 4.667 84 99 | 3.75 75 100 | 1.867 51 101 | 4.9 82 102 | 2.483 62 103 | 4.367 88 104 | 2.1 49 105 | 4.5 83 106 | 4.05 81 107 | 1.867 47 108 | 4.7 84 109 | 1.783 52 110 | 4.85 86 111 | 3.683 81 112 | 4.733 75 113 | 2.3 59 114 | 4.9 89 115 | 4.417 79 116 | 1.7 59 117 | 4.633 81 118 | 2.317 50 119 | 4.6 85 120 | 1.817 59 121 | 4.417 87 122 | 2.617 53 123 | 4.067 69 124 | 4.25 77 125 | 1.967 56 126 | 4.6 88 127 | 3.767 81 128 | 1.917 45 129 | 4.5 82 130 | 2.267 55 131 | 4.65 90 132 | 1.867 45 133 | 4.167 83 134 | 2.8 56 135 | 4.333 89 136 | 1.833 46 137 | 4.383 82 138 | 1.883 51 139 | 4.933 86 140 | 2.033 53 141 | 3.733 79 142 | 4.233 81 143 | 2.233 60 144 | 4.533 82 145 | 4.817 77 146 | 4.333 76 147 | 1.983 59 148 | 4.633 80 149 | 2.017 49 150 | 5.1 96 151 | 1.8 53 152 | 5.033 77 153 | 4 77 154 | 2.4 65 155 | 4.6 81 156 | 3.567 71 157 | 4 70 158 | 4.5 81 159 | 4.083 93 160 | 1.8 53 161 | 3.967 89 162 | 2.2 45 163 | 4.15 86 164 | 2 58 165 | 3.833 78 166 | 3.5 66 167 | 4.583 76 168 | 2.367 63 169 | 5 88 170 | 1.933 52 171 | 4.617 93 172 | 1.917 49 173 | 2.083 57 174 | 4.583 77 175 | 3.333 68 176 | 4.167 81 177 | 4.333 81 178 | 4.5 73 179 | 2.417 50 180 | 4 85 181 | 4.167 74 182 | 1.883 55 183 | 4.583 77 184 | 4.25 83 185 | 3.767 83 186 | 2.033 51 187 | 4.433 78 188 | 4.083 84 189 | 1.833 46 190 | 4.417 83 191 | 2.183 55 192 | 4.8 81 193 | 1.833 57 194 | 4.8 76 195 | 4.1 84 196 | 3.966 77 197 | 4.233 81 198 | 3.5 87 199 | 4.366 77 200 | 2.25 51 201 | 4.667 78 202 | 2.1 60 203 | 4.35 82 204 | 4.133 91 205 | 1.867 53 206 | 4.6 78 207 | 1.783 46 208 | 4.367 77 209 | 3.85 84 210 | 1.933 49 211 | 4.5 83 212 | 2.383 71 213 | 4.7 80 214 | 1.867 49 215 | 3.833 75 216 | 3.417 64 217 | 4.233 76 218 | 2.4 53 219 | 4.8 94 220 | 2 55 221 | 4.15 76 222 | 1.867 50 223 | 4.267 82 224 | 1.75 54 225 | 4.483 75 226 | 4 78 227 | 4.117 79 228 | 4.083 78 229 | 4.267 78 230 | 3.917 70 231 | 4.55 79 232 | 4.083 70 233 | 2.417 54 234 | 4.183 86 235 | 2.217 50 236 | 4.45 90 237 | 1.883 54 238 | 1.85 54 239 | 4.283 77 240 | 3.95 79 241 | 2.333 64 242 | 4.15 75 243 | 2.35 47 244 | 4.933 86 245 | 2.9 63 246 | 4.583 85 247 | 3.833 82 248 | 2.083 57 249 | 4.367 82 250 | 2.133 67 251 | 4.35 74 252 | 2.2 54 253 | 4.45 83 254 | 3.567 73 255 | 4.5 73 256 | 4.15 88 257 | 3.817 80 258 | 3.917 71 259 | 4.45 83 260 | 2 56 261 | 4.283 79 262 | 4.767 78 263 | 4.533 84 264 | 1.85 58 265 | 4.25 83 266 | 1.983 43 267 | 2.25 60 268 | 4.75 75 269 | 4.117 81 270 | 2.15 46 271 | 4.417 90 272 | 1.817 46 273 | 4.467 74 274 | -------------------------------------------------------------------------------- /vignettes/scatter_demo1.txt: -------------------------------------------------------------------------------- 1 | Gene Cluster Expr Percent 2 | Pou5f1 Zygote 1 0.246695526 3 | Sox2 Zygote 0.5 0.617459927 4 | Gata2 Zygote 0.3 0.623361168 5 | cMyc Zygote 10.4 0.8 6 | Tet1 Zygote 16 0.431880979 7 | Tet3 Zygote 32 0.145316434 8 | Pou5f1 2_cell 2 0.244849716 9 | Sox2 2_cell 1 0.364233541 10 | Gata2 2_cell 0.6 0.588183191 11 | cMyc 2_cell 5.2 0.811433378 12 | Tet1 2_cell 8 0.365104165 13 | Tet3 2_cell 16 0.396780582 14 | Pou5f1 4_cell 4 0.601440317 15 | Sox2 4_cell 2 0.153557784 16 | Gata2 4_cell 1.3 0.003045256 17 | cMyc 4_cell 2.6 0.707240651 18 | Tet1 4_cell 4 0.815948599 19 | Tet3 4_cell 8 0.617031383 20 | Pou5f1 8_cell 8 0.970561804 21 | Sox2 8_cell 4 0.278595655 22 | Gata2 8_cell 2.6 0.285646591 23 | cMyc 8_cell 1.3 0.391556814 24 | Tet1 8_cell 2 0.230485205 25 | Tet3 8_cell 4 0.987381464 26 | Pou5f1 Morula 16 0.9 27 | Sox2 Morula 8 0.223710115 28 | Gata2 Morula 5.2 0.203391881 29 | cMyc Morula 0.6 0.21203413 30 | Tet1 Morula 1 0.262143152 31 | Tet3 Morula 2 0.785652512 32 | Pou5f1 ICM 32 1 33 | Sox2 ICM 16 0.11069744 34 | Gata2 ICM 10.4 0.085832987 35 | cMyc ICM 0.3 0.126469822 36 | Tet1 ICM 0.5 0.026535644 37 | Tet3 ICM 1 0.392058575 38 | -------------------------------------------------------------------------------- /vignettes/scatter_demo2.txt: -------------------------------------------------------------------------------- 1 | Samp Color X_variable Y_variable Size Shape 2 | a group2 0.629013577708974 0.432010425953194 10 cluster1 3 | b group1 0.458520132349804 0.0561661606188864 8 cluster2 4 | c group3 0.0340392207726836 0.622970857657492 4 cluster2 5 | d group3 0.236130375182256 0.7956897248514 7 cluster1 6 | e group1 0.807094204006717 0.0475741932168603 19 cluster2 7 | f group3 0.519964799284935 0.652496803319082 11 cluster1 8 | -------------------------------------------------------------------------------- /vignettes/sp_heatmap.reordered.txt: -------------------------------------------------------------------------------- 1 | ID Zygote X2_cell X4_cell X8_cell Morula ICM 2 | Pou5f1 1 2 4 8 16 32 3 | Sox2 0.5 1 2 4 8 16 4 | Gata2 0.3 0.6 1.3 2.6 5.2 10.4 5 | cMyc 10.4 5.2 2.6 1.3 0.6 0.3 6 | Tet1 16 8 4 2 1 0.5 7 | Tet3 32 16 8 4 2 1 8 | -------------------------------------------------------------------------------- /vignettes/test.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Untitled" 3 | output: html_document 4 | --- 5 | 6 | ```{r} 7 | exprTable <- read.table("exprTable.txt", sep="\t", row.names=1, header=T) 8 | exprTable 9 | ``` 10 | 11 | ## 绘制一个聚类热图很简单 12 | 13 | ```{r} 14 | library(pheatmap) 15 | pheatmap(exprTable) 16 | ``` 17 | 18 | ## 如何自定义分支顺序呢 19 | 20 | 自己做个`hclust`传进去,顺序跟pheatmap默认是一样的 21 | 22 | ```{r} 23 | exprTable_t <- as.data.frame(t(exprTable)) 24 | 25 | col_dist = dist(exprTable_t) 26 | 27 | hclust_1 <- hclust(col_dist) 28 | 29 | pheatmap(exprTable, cluster_cols = hclust_1) 30 | ``` 31 | 32 | ## 人为指定顺序排序样品 33 | 34 | 按发育时间排序样品 35 | 36 | ```{r} 37 | manual_order = c("Zygote", "X2_cell", "X4_cell", "X8_cell", "Morula", "ICM") 38 | 39 | dend = reorder(as.dendrogram(hclust_1), wts=order(match(manual_order, rownames(exprTable_t)))) 40 | 41 | # dend = reorder(as.dendrogram(hclust_1), wts=order(match(manual_order, rownames(exprTable_t))), agglo.FUN = max) 42 | 43 | col_cluster <- as.hclust(dend) 44 | 45 | pheatmap(exprTable, cluster_cols = col_cluster) 46 | ``` 47 | 48 | ## 按某个基因的表达由小到大排序 49 | 50 | 可以按任意指标排序,基因表达是一个例子。 51 | 52 | ```{r} 53 | dend = reorder(as.dendrogram(hclust_1), wts=exprTable_t$Tet3) 54 | 55 | col_cluster <- as.hclust(dend) 56 | 57 | pheatmap(exprTable, cluster_cols = col_cluster) 58 | ``` 59 | 60 | ## 按某个基因的表达由大到小排序 61 | 62 | ```{r} 63 | dend = reorder(as.dendrogram(hclust_1), wts=exprTable_t$Tet3*(-1)) 64 | 65 | col_cluster <- as.hclust(dend) 66 | 67 | pheatmap(exprTable, cluster_cols = col_cluster) 68 | ``` 69 | 70 | 71 | 72 | ## 按分支名字(样品名字)的字母顺序排序 73 | 74 | ```{r} 75 | col_cluster <- hclust_1 %>% as.dendrogram %>% sort %>% as.hclust 76 | pheatmap(exprTable, cluster_cols = col_cluster) 77 | ``` 78 | 79 | ## 梯子形排序:最小的分支在右侧 80 | 81 | ```{r} 82 | col_cluster <- hclust_1 %>% as.dendrogram %>% ladderize(TRUE) %>% as.hclust 83 | pheatmap(exprTable, cluster_cols = col_cluster) 84 | ``` 85 | 86 | ## 梯子形排序:最小的分支在左侧 87 | 88 | ```{r} 89 | col_cluster <- hclust_1 %>% as.dendrogram %>% ladderize(FALSE) %>% as.hclust 90 | pheatmap(exprTable, cluster_cols = col_cluster) 91 | ``` 92 | 93 | ## 按特征值排序 94 | 95 | 样本量多时的自动较忧排序 96 | 97 | ```{r} 98 | sv = svd(exprTable)$v[,1] 99 | dend = reorder(as.dendrogram(hclust_1), wts=sv) 100 | col_cluster <- as.hclust(dend) 101 | 102 | pheatmap(exprTable, cluster_cols = col_cluster) 103 | ``` 104 | 105 | 106 | ```{r} 107 | exprTable_cor <- cor(exprTable) 108 | exprTable_cor 109 | ``` 110 | 111 | ```{r} 112 | pheatmap(exprTable_cor, cluster_rows = T, cluster_cols = T) 113 | ``` 114 | 115 | ```{r} 116 | cor_cluster = hclust(as.dist(1-exprTable_cor)) 117 | pheatmap(exprTable_cor, cluster_rows = cor_cluster, cluster_cols = cor_cluster) 118 | ``` 119 | 120 | ```{r} 121 | cor_sum <- rowSums(exprTable_cor) 122 | dend = reorder(as.dendrogram(cor_cluster), wts=cor_sum) 123 | 124 | col_cluster <- as.hclust(dend) 125 | 126 | pheatmap(exprTable_cor, cluster_rows = col_cluster, cluster_cols = col_cluster) 127 | ``` 128 | 129 | ```{r} 130 | manual_order = c("Zygote", "X2_cell", "X4_cell", "X8_cell", "Morula", "ICM") 131 | 132 | dend = reorder(as.dendrogram(cor_cluster), wts=order(match(manual_order, rownames(exprTable_cor))),agglo.FUN = max) 133 | col_cluster <- as.hclust(dend) 134 | 135 | pheatmap(exprTable_cor, cluster_rows = col_cluster, cluster_cols = col_cluster) 136 | ``` 137 | 138 | ## Refercens 139 | 140 | 1. https://stackoverflow.com/questions/52446477/r-hclust-common-order-for-multiple-trees 141 | 2. https://www.biostars.org/p/237067/ 142 | 143 | 144 | 145 | 146 | height = height[height>0] 147 | 148 | height 149 | 150 | hang_dend = hang.dendrogram(dend) 151 | 152 | plot(hang_dend) 153 | 154 | height = get_nodes_attr(hang_dend, "height") 155 | 156 | height 157 | -------------------------------------------------------------------------------- /vignettes/test_statistics.R: -------------------------------------------------------------------------------- 1 | #library(ImageGP) 2 | library(multcompView) 3 | 4 | data <- sp_readTable("vegan.txt") 5 | 6 | head(data) 7 | 8 | rownames(data) 9 | 10 | sp_diff_test(data, stat_value_variable="ACE", 11 | stat_group_variable="Group") 12 | 13 | a = sp_diff_test(data[1:12,], stat_value_variable="ACE", 14 | stat_group_variable="Group") 15 | 16 | a$data$y 17 | 18 | sp_diff_test(data, stat_value_variable="chao1", 19 | stat_group_variable="Group") 20 | 21 | 22 | data = sp_diff_test(data, stat_value_variable="chao1", 23 | stat_group_variable="Group") 24 | data 25 | 26 | split(data, data$Group) 27 | 28 | c = lapply(split(data, data$Group), function (x) {max(x[["chao1"]])}) 29 | 30 | c[data$Group] 31 | 32 | sp_diff_test_group_vector(data, 33 | stat_value_variable="ACE", 34 | stat_group_variable="Group", 35 | group_variable = "Site") 36 | 37 | do.call(rbind,lapply(split(data, data$Group), function (x) {max(x[["chao1"]])})) 38 | 39 | split(data, data$Site) 40 | 41 | do.call(rbind, lapply(split(data, 1), sp_diff_test, 42 | stat_value_variable="ACE", 43 | stat_group_variable="Group")) 44 | -------------------------------------------------------------------------------- /vignettes/tree.attribute: -------------------------------------------------------------------------------- 1 | ID Spe Name 2 | Aca8437 Aca transcript_HQ_WT_transcript25587/f3p0/1593|m.2027 3 | Aca8644 Aca transcript_HQ_WT_transcript23950/f5p0/1651|m.121 4 | Aca9298 Aca transcript_HQ_WT_transcript25860/f3p0/1593|m.772 5 | Aca9536 Aca transcript_HQ_WT_transcript25124/f8p0/1582|m.1012 6 | Aca9565 Aca transcript_HQ_WT_transcript24257/f3p0/1670|m.1041 7 | Aca9576 Aca transcript_HQ_WT_transcript25927/f7p0/1589|m.1052 8 | Aca9664 Aca transcript_HQ_WT_transcript25952/f2p0/1564|m.1135 9 | Aca9717 Aca transcript_HQ_WT_transcript25966/f20p0/1558|m.1188 10 | Aca10131 Aca transcript_HQ_WT_transcript26394/f4p0/1535|m.1598 11 | Aca10198 Aca transcript_HQ_WT_transcript26413/f45p0/1525|m.1665 12 | Aca10517 Aca transcript_HQ_WT_transcript26194/f6p0/1549|m.1982 13 | Aca10743 Aca transcript_HQ_WT_transcript29135/f2p0/1400|m.99 14 | Aca11324 Aca transcript_HQ_WT_transcript26765/f6p0/1519|m.679 15 | Aca11488 Aca transcript_HQ_WT_transcript28485/f2p0/1446|m.844 16 | Aca11732 Aca transcript_HQ_WT_transcript26904/f2p0/1514|m.1083 17 | Aca11793 Aca transcript_HQ_WT_transcript27766/f5p0/1493|m.1144 18 | Aca11819 Aca transcript_HQ_WT_transcript28581/f4p0/1430|m.1170 19 | Aca12074 Aca transcript_HQ_WT_transcript28665/f2p0/1407|m.1426 20 | Aca12095 Aca transcript_HQ_WT_transcript27011/f5p0/1474|m.1447 21 | Aca12627 Aca transcript_HQ_WT_transcript28809/f2p0/1416|m.1971 22 | Aca13655 Aca transcript_HQ_WT_transcript31701/f2p0/1260|m.887 23 | Aca14963 Aca transcript_HQ_WT_transcript32475/f2p0/1217|m.90 24 | Asi1501 Asi Cluster-15521.15210;orf1 25 | Asi6390 Asi Cluster-3850.0;orf1 26 | Asi7526 Asi Cluster-15263.0;orf1 27 | Asi8620 Asi Cluster-15521.6675;orf1 28 | Asi13177 Asi Cluster-15521.15719;orf1 29 | Asi15178 Asi Cluster-6081.0;orf1 30 | Asz3542 Asz Cluster-13910.0;orf1 31 | Asz5065 Asz Cluster-8543.1806;orf1 32 | Asz6283 Asz Cluster-21963.0;orf1 33 | Asz10159 Asz Cluster-8543.4959;orf1 34 | Asz10275 Asz Cluster-212.0;orf1 35 | Asz12054 Asz Cluster-8543.17401;orf1 36 | Asz14585 Asz Cluster-16578.0;orf1 37 | Asz14659 Asz Cluster-18889.0;orf1 38 | Asz22669 Asz Cluster-82.0;orf1 39 | Asz23002 Asz Cluster-8543.4464;orf1 40 | Ata2954 Ata Cluster-12824.2760;orf1 41 | Ata3867 Ata Cluster-12824.3854;orf1 42 | Ata4131 Ata Cluster-12824.46040;orf1 43 | Ata6895 Ata Cluster-3843.1;orf1 44 | Ata8077 Ata Cluster-12824.2083;orf1 45 | Ata10344 Ata Cluster-30099.0;orf1 46 | Ata17379 Ata Cluster-12824.13511;orf1 47 | Ata17392 Ata Cluster-12824.40748;orf1 48 | Ata17593 Ata Cluster-21248.0;orf1 49 | Ata21469 Ata Cluster-12824.879;orf1 50 | Ata24032 Ata Cluster-18832.0;orf1 51 | Ata24183 Ata Cluster-9375.1;orf1 52 | Ata25669 Ata Cluster-21425.0;orf1 53 | Ata27463 Ata Cluster-12824.38018;orf1 54 | Ata29337 Ata Cluster-12824.26386;orf1 55 | Ata29764 Ata Cluster-29866.0;orf1 56 | Ata30440 Ata Cluster-16399.0;orf1 57 | Ata31153 Ata Cluster-12824.35876;orf1 58 | Ata31154 Ata Cluster-12824.35877;orf1 59 | Ata35670 Ata Cluster-12824.36121;orf1 60 | Pvu270 Pvu TRINITY_DN9220_c0_g1 61 | Rru27931 Rru m.115786 62 | Rru45085 Rru m.164732 63 | Sba2910 Sba E_H15173_c0_g1 64 | -------------------------------------------------------------------------------- /vignettes/upset.txt: -------------------------------------------------------------------------------- 1 | Name Action Adventure Horror Musical Romance Thriller 2 | Toy Story (1995) 0 0 0 0 0 0 3 | Jumanji (1995) 0 1 0 0 0 0 4 | Grumpier Old Men (1995) 0 0 0 0 1 0 5 | Waiting to Exhale (1995) 0 0 0 0 0 0 6 | Father of the Bride Part II (1995) 0 0 0 0 0 0 7 | Heat (1995) 1 0 0 0 0 1 8 | Sabrina (1995) 0 0 0 0 1 0 9 | Tom and Huck (1995) 0 1 0 0 0 0 10 | Sudden Death (1995) 1 0 0 0 0 0 11 | GoldenEye (1995) 1 1 0 0 0 1 12 | American President, The (1995) 0 0 0 0 1 0 13 | Dracula: Dead and Loving It (1995) 0 0 1 0 0 0 14 | Balto (1995) 0 0 0 0 0 0 15 | Nixon (1995) 0 0 0 0 0 0 16 | Cutthroat Island (1995) 1 1 0 0 1 0 17 | Casino (1995) 0 0 0 0 0 1 18 | Sense and Sensibility (1995) 0 0 0 0 1 0 19 | Four Rooms (1995) 0 0 0 0 0 1 20 | Ace Ventura: When Nature Calls (1995) 0 0 0 0 0 0 21 | Money Train (1995) 1 0 0 0 0 0 22 | Get Shorty (1995) 1 0 0 0 0 0 23 | Copycat (1995) 0 0 0 0 0 1 24 | Assassins (1995) 0 0 0 0 0 1 25 | Powder (1995) 0 0 0 0 0 0 26 | Leaving Las Vegas (1995) 0 0 0 0 1 0 27 | Othello (1995) 0 0 0 0 0 0 28 | Now and Then (1995) 0 0 0 0 0 0 29 | Persuasion (1995) 0 0 0 0 1 0 30 | City of Lost Children, The (1995) 0 1 0 0 0 0 31 | Shanghai Triad (Yao a yao yao dao waipo qiao) (1995) 0 0 0 0 0 0 32 | Dangerous Minds (1995) 0 0 0 0 0 0 33 | Twelve Monkeys (1995) 0 0 0 0 0 0 34 | Wings of Courage (1995) 0 1 0 0 1 0 35 | Babe (1995) 0 0 0 0 0 0 36 | Carrington (1995) 0 0 0 0 1 0 37 | Dead Man Walking (1995) 0 0 0 0 0 0 38 | Across the Sea of Time (1995) 0 0 0 0 0 0 39 | It Takes Two (1995) 0 0 0 0 0 0 40 | Clueless (1995) 0 0 0 0 1 0 41 | -------------------------------------------------------------------------------- /vignettes/upset.wide.data: -------------------------------------------------------------------------------- 1 | ID Samp1 Samp2 Samp3 Samp4 Samp5 2 | G1 1 0 1 0 1 3 | G2 0 0 1 1 1 4 | G3 1 1 1 0 1 5 | G4 1 1 1 0 0 6 | G5 0 1 0 1 1 7 | G6 1 0 1 0 0 8 | -------------------------------------------------------------------------------- /vignettes/upsetview.data: -------------------------------------------------------------------------------- 1 | ID Samp1 Samp2 Samp3 Samp4 Samp5 2 | G1 1 0 1 0 1 3 | G2 0 0 1 1 1 4 | G3 1 1 1 0 1 5 | G4 1 1 1 0 0 6 | G5 0 1 0 1 1 7 | G6 1 0 1 0 0 -------------------------------------------------------------------------------- /vignettes/vennDiagram.data: -------------------------------------------------------------------------------- 1 | Gene Sample 2 | g1 Set1 3 | g2 Set1 4 | a1 Set3 5 | a3 Set1 6 | b4 Set1 7 | g1 Set2 8 | h1 Set4 9 | a3 Set2 10 | b1 Set2 11 | b2 Set2 12 | g2 Set3 13 | g1 Set1 14 | c1 Set3 15 | c3 Set3 16 | b1 Set3 17 | c2 Set5 18 | g2 Set3 19 | d1 Set4 20 | h1 Set2 21 | d3 Set4 22 | b1 Set4 23 | d2 Set4 24 | g2 Set4 25 | a1 Set5 26 | c1 Set5 27 | c3 Set3 28 | d1 Set5 29 | b2 Set5 30 | g2 Set5 31 | --------------------------------------------------------------------------------