diff --git a/NAMESPACE b/NAMESPACE index 03bc0f1..eeec07a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,19 +1,19 @@ # Generated by roxygen2: do not edit by hand -export(PCA) -export(PCoA) -export(call_DAMs_DESeq2) -export(call_DAMs_LEfSe) -export(call_DEGs_DESeq2) -export(cor_and_plot) -export(enrich_GO) -export(enrich_KEGG) -export(find_outliner) -export(lm_and_plot) -export(plot_theme) -export(plot_volcano) -export(reorder2heatmap) -export(top_10) +export(CommonlyUsed.PCA) +export(CommonlyUsed.cor_and_plot) +export(CommonlyUsed.find_outliner) +export(CommonlyUsed.lm_and_plot) +export(CommonlyUsed.plot_theme) +export(CommonlyUsed.reorder2heatmap) +export(Microbiome.PCoA) +export(Microbiome.call_DAMs_DESeq2) +export(Microbiome.call_DAMs_LEfSe) +export(Microbiome.top_10) +export(RNASeq.call_DEGs_DESeq2) +export(RNASeq.enrich_GO) +export(RNASeq.enrich_KEGG) +export(RNASeq.plot_volcano) importFrom(DESeq2,DESeq) importFrom(DESeq2,DESeqDataSetFromMatrix) importFrom(DESeq2,results) diff --git a/R/Microbiome.call_DAMs_DESeq2.R b/R/Microbiome.call_DAMs_DESeq2.R index e45dd2d..fd8c337 100644 --- a/R/Microbiome.call_DAMs_DESeq2.R +++ b/R/Microbiome.call_DAMs_DESeq2.R @@ -6,7 +6,7 @@ #' @param log2FoldChange The threshold for the absolute value of log2FoldChange is set to 1 by default. #' @param padj The threshold for the adjusted p-value is set to 0.05 by default. #' -#' @return +#' @return A data frame from DESeq2. #' @export #' #' @examples @@ -32,7 +32,7 @@ Microbiome.call_DAMs_DESeq2 <- function(data, sample, group = "group", log2FoldC log2FoldChange < -{{ log2FoldChange }} & padj < {{ padj }} ~ "Depleted", TRUE ~ "NS" )) %>% - tibble::rownames_to_column(var = "OTU") -> dems + tibble::rownames_to_column(var = "OTU") -> dams - return(dems) + return(dams) } diff --git a/deve.log.R b/deve.log.R index 2bdf2b5..35b4b75 100644 --- a/deve.log.R +++ b/deve.log.R @@ -129,7 +129,6 @@ dir("R") %>% 123 - # 编译vignettes # usethis::use_vignette(name = "pca_in_one") # 运行第二次会覆盖之前的 # usethis::use_vignette(name = "cor_and_plot") diff --git a/man/PCA.Rd b/man/CommonlyUsed.PCA.Rd similarity index 90% rename from man/PCA.Rd rename to man/CommonlyUsed.PCA.Rd index c65ec85..5fce310 100644 --- a/man/PCA.Rd +++ b/man/CommonlyUsed.PCA.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/PCA.R -\name{PCA} -\alias{PCA} +% Please edit documentation in R/CommonlyUsed.PCA.R +\name{CommonlyUsed.PCA} +\alias{CommonlyUsed.PCA} \title{Perform principal component analysis (PCA) and return the results.} \usage{ -PCA( +CommonlyUsed.PCA( data, sample, pca.num = 5, @@ -49,6 +49,6 @@ sample <- iris$Species \%>\% rownames_to_column(var = "sample") \%>\% set_names(c("sample", "species")) -PCA(data, sample) -> result.pca +CommonlyUsed.PCA(data, sample) -> result.pca } diff --git a/man/cor_and_plot.Rd b/man/CommonlyUsed.cor_and_plot.Rd similarity index 78% rename from man/cor_and_plot.Rd rename to man/CommonlyUsed.cor_and_plot.Rd index 7c6c60b..28669e3 100644 --- a/man/cor_and_plot.Rd +++ b/man/CommonlyUsed.cor_and_plot.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/cor_and_plot.R -\name{cor_and_plot} -\alias{cor_and_plot} +% Please edit documentation in R/CommonlyUsed.cor_and_plot.R +\name{CommonlyUsed.cor_and_plot} +\alias{CommonlyUsed.cor_and_plot} \title{Calculate Correlation, Return Correlation Results.} \usage{ -cor_and_plot( +CommonlyUsed.cor_and_plot( data.1, data.2 = NULL, method = "pearson", @@ -36,6 +36,6 @@ library(biohelpers) x <- iris[, 1:4] y <- iris[, 1:4] -cor_and_plot(data.1 = x, data.2 = y) -> result.cor +CommonlyUsed.cor_and_plot(data.1 = x, data.2 = y) -> result.cor } diff --git a/man/find_outliner.Rd b/man/CommonlyUsed.find_outliner.Rd similarity index 63% rename from man/find_outliner.Rd rename to man/CommonlyUsed.find_outliner.Rd index c55d9a1..990b438 100644 --- a/man/find_outliner.Rd +++ b/man/CommonlyUsed.find_outliner.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/find_outliner.R -\name{find_outliner} -\alias{find_outliner} +% Please edit documentation in R/CommonlyUsed.find_outliner.R +\name{CommonlyUsed.find_outliner} +\alias{CommonlyUsed.find_outliner} \title{Identification of Outliers.} \usage{ -find_outliner(x) +CommonlyUsed.find_outliner(x) } \arguments{ \item{x}{Numeric Format Vector.} @@ -24,7 +24,7 @@ data(iris) iris \%>\% dplyr::group_by(Species) \%>\% - dplyr::mutate(is.out = find_outliner(Sepal.Length)) \%>\% + dplyr::mutate(is.out = CommonlyUsed.find_outliner(Sepal.Length)) \%>\% dplyr::ungroup() -> result.find_outlinr } diff --git a/man/lm_and_plot.Rd b/man/CommonlyUsed.lm_and_plot.Rd similarity index 84% rename from man/lm_and_plot.Rd rename to man/CommonlyUsed.lm_and_plot.Rd index da71365..fa14b0e 100644 --- a/man/lm_and_plot.Rd +++ b/man/CommonlyUsed.lm_and_plot.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/lm_and_plot.R -\name{lm_and_plot} -\alias{lm_and_plot} +% Please edit documentation in R/CommonlyUsed.lm_and_plot.R +\name{CommonlyUsed.lm_and_plot} +\alias{CommonlyUsed.lm_and_plot} \title{"Perform simple linear regression calculations and return the corresponding plot."} \usage{ -lm_and_plot(data, x, y, group, color) +CommonlyUsed.lm_and_plot(data, x, y, group, color) } \arguments{ \item{data}{The input data frame contains information such as @param x, @param y, @param group, and @param color.} @@ -28,7 +28,8 @@ A list containing a data frame and a plot, where the data frame includes regress library(biohelpers) df <- iris -lm_and_plot( + +CommonlyUsed.lm_and_plot( data = df, x = "Sepal.Length", y = "Sepal.Width", diff --git a/man/plot_theme.Rd b/man/CommonlyUsed.plot_theme.Rd similarity index 80% rename from man/plot_theme.Rd rename to man/CommonlyUsed.plot_theme.Rd index aea1e3a..3c6e819 100644 --- a/man/plot_theme.Rd +++ b/man/CommonlyUsed.plot_theme.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/plot_theme.R -\name{plot_theme} -\alias{plot_theme} +% Please edit documentation in R/CommonlyUsed.plot_theme.R +\name{CommonlyUsed.plot_theme} +\alias{CommonlyUsed.plot_theme} \title{ggplot2 plotting theme.} \usage{ -plot_theme( +CommonlyUsed.plot_theme( base.size = 10, strip.text.italic = FALSE, show.minor.tricks.x = FALSE, @@ -37,6 +37,6 @@ data(iris) iris \%>\% ggplot(aes(Sepal.Length, Sepal.Width)) + geom_point() + - plot_theme() + CommonlyUsed.plot_theme() } diff --git a/man/reorder2heatmap.Rd b/man/CommonlyUsed.reorder2heatmap.Rd similarity index 74% rename from man/reorder2heatmap.Rd rename to man/CommonlyUsed.reorder2heatmap.Rd index 0561626..26e8ea0 100644 --- a/man/reorder2heatmap.Rd +++ b/man/CommonlyUsed.reorder2heatmap.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/reorder2heatmap.R -\name{reorder2heatmap} -\alias{reorder2heatmap} +% Please edit documentation in R/CommonlyUsed.reorder2heatmap.R +\name{CommonlyUsed.reorder2heatmap} +\alias{CommonlyUsed.reorder2heatmap} \title{Title} \usage{ -reorder2heatmap(data, col, row, value) +CommonlyUsed.reorder2heatmap(data, col, row, value) } \arguments{ \item{data}{Input data in a data frame format, specifically in long data format, tidyr format.} @@ -28,7 +28,7 @@ library(biohelpers) data(df.reorder2heatmap) -reorder2heatmap( +CommonlyUsed.reorder2heatmap( data = df.reorder2heatmap, col = "sample", row = "meta", diff --git a/man/PCoA.Rd b/man/Microbiome.PCoA.Rd similarity index 86% rename from man/PCoA.Rd rename to man/Microbiome.PCoA.Rd index 29f4bdb..e05cf28 100644 --- a/man/PCoA.Rd +++ b/man/Microbiome.PCoA.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/PCoA.R -\name{PCoA} -\alias{PCoA} +% Please edit documentation in R/Microbiome.PCoA.R +\name{Microbiome.PCoA} +\alias{Microbiome.PCoA} \title{Perform principal coordinate analysis (PCoA).} \usage{ -PCoA( +Microbiome.PCoA( data, sample, method = "bray", @@ -45,6 +45,6 @@ library(biohelpers) data(df.pcoa.otu) data(df.pcoa.sample) -PCoA(data = df.pcoa.otu, sample = df.pcoa.sample) -> pcoa.res +Microbiome.PCoA(data = df.pcoa.otu, sample = df.pcoa.sample) -> pcoa.res } diff --git a/man/call_DAMs_DESeq2.Rd b/man/Microbiome.call_DAMs_DESeq2.Rd similarity index 76% rename from man/call_DAMs_DESeq2.Rd rename to man/Microbiome.call_DAMs_DESeq2.Rd index 0abd8cd..8051d7d 100644 --- a/man/call_DAMs_DESeq2.Rd +++ b/man/Microbiome.call_DAMs_DESeq2.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/call_DAMs_DESeq2.R -\name{call_DAMs_DESeq2} -\alias{call_DAMs_DESeq2} +% Please edit documentation in R/Microbiome.call_DAMs_DESeq2.R +\name{Microbiome.call_DAMs_DESeq2} +\alias{Microbiome.call_DAMs_DESeq2} \title{Title} \usage{ -call_DAMs_DESeq2( +Microbiome.call_DAMs_DESeq2( data, sample, group = "group", @@ -33,6 +33,6 @@ library(biohelpers) data(df.pcoa.otu) data(df.pcoa.sample) -call_DAMs_DESeq2(t(df.pcoa.otu), df.pcoa.sample) -> dems.res +Microbiome.call_DAMs_DESeq2(t(df.pcoa.otu), df.pcoa.sample) -> dems.res } diff --git a/man/call_DAMs_LEfSe.Rd b/man/Microbiome.call_DAMs_LEfSe.Rd similarity index 79% rename from man/call_DAMs_LEfSe.Rd rename to man/Microbiome.call_DAMs_LEfSe.Rd index f746560..51563db 100644 --- a/man/call_DAMs_LEfSe.Rd +++ b/man/Microbiome.call_DAMs_LEfSe.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/call_DAMs_LEfSe.R -\name{call_DAMs_LEfSe} -\alias{call_DAMs_LEfSe} +% Please edit documentation in R/Microbiome.call_DAMs_LEfSe.R +\name{Microbiome.call_DAMs_LEfSe} +\alias{Microbiome.call_DAMs_LEfSe} \title{Identifying differential abundance microbiomes using LEfSe.} \usage{ -call_DAMs_LEfSe( +Microbiome.call_DAMs_LEfSe( data, sample, groupCol = "group", @@ -40,6 +40,6 @@ library(dplyr) data(df.call_DAMs_LEfSe.otu) data(df.call_DAMs_LEfSe.sample) -call_DAMs_LEfSe(df.call_DAMs_LEfSe.otu, df.call_DAMs_LEfSe.sample) -> lefse.result +Microbiome.call_DAMs_LEfSe(df.call_DAMs_LEfSe.otu, df.call_DAMs_LEfSe.sample) -> lefse.result } diff --git a/man/top_10.Rd b/man/Microbiome.top_10.Rd similarity index 87% rename from man/top_10.Rd rename to man/Microbiome.top_10.Rd index 6d04606..1b54de5 100644 --- a/man/top_10.Rd +++ b/man/Microbiome.top_10.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/top_10.R -\name{top_10} -\alias{top_10} +% Please edit documentation in R/Microbiome.top_10.R +\name{Microbiome.top_10} +\alias{Microbiome.top_10} \title{Calculate the top ten microorganisms by abundance at different taxonomic levels.} \usage{ -top_10( +Microbiome.top_10( data, sample, taxo, @@ -47,6 +47,6 @@ data(df.top10.otu) data(df.top10.sample) data(df.top10.class) -top_10(df.top10.otu, df.top10.sample, df.top10.class) -> top10.res +Microbiome.top_10(df.top10.otu, df.top10.sample, df.top10.class) -> top10.res } diff --git a/man/call_DEGs_DESeq2.Rd b/man/RNASeq.call_DEGs_DESeq2.Rd similarity index 72% rename from man/call_DEGs_DESeq2.Rd rename to man/RNASeq.call_DEGs_DESeq2.Rd index b31bded..cef1f5d 100644 --- a/man/call_DEGs_DESeq2.Rd +++ b/man/RNASeq.call_DEGs_DESeq2.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/call_DEGs_DESeq2.R -\name{call_DEGs_DESeq2} -\alias{call_DEGs_DESeq2} +% Please edit documentation in R/RNASeq.call_DEGs_DESeq2.R +\name{RNASeq.call_DEGs_DESeq2} +\alias{RNASeq.call_DEGs_DESeq2} \title{Identifying Differentially Expressed Genes Using DESeq2} \usage{ -call_DEGs_DESeq2(data, sample, group, log2FoldChange = 1, padj = 0.05) +RNASeq.call_DEGs_DESeq2(data, sample, group, log2FoldChange = 1, padj = 0.05) } \arguments{ \item{data}{Expression matrix must be integers, with rows representing gene names and columns representing sample names.} @@ -30,8 +30,10 @@ library(biohelpers) data(df.rnaseq.gene) data(df.rnaseq.sample) -call_DEGs_DESeq2(data = df.rnaseq.gene, - sample = df.rnaseq.sample, - group = "group") -> degs +RNASeq.call_DEGs_DESeq2( + data = df.rnaseq.gene, + sample = df.rnaseq.sample, + group = "group" +) -> degs } diff --git a/man/enrich_GO.Rd b/man/RNASeq.enrich_GO.Rd similarity index 76% rename from man/enrich_GO.Rd rename to man/RNASeq.enrich_GO.Rd index 40f5f1a..5e466c1 100644 --- a/man/enrich_GO.Rd +++ b/man/RNASeq.enrich_GO.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/enrich_GO.R -\name{enrich_GO} -\alias{enrich_GO} +% Please edit documentation in R/RNASeq.enrich_GO.R +\name{RNASeq.enrich_GO} +\alias{RNASeq.enrich_GO} \title{Perform GO enrichment analysis of differentially expressed genes.} \usage{ -enrich_GO(gene, go.db, pAdjustMethod = "BH", p.adjust = 0.05) +RNASeq.enrich_GO(gene, go.db, pAdjustMethod = "BH", p.adjust = 0.05) } \arguments{ \item{gene}{The names of differentially expressed genes are a vector.} @@ -31,6 +31,6 @@ library(biohelpers) data(df.rnaseq.go) data(df.rnaseq.degs) -enrich_GO(gene = df.rnaseq.degs$gene, go.db = df.rnaseq.go) -> go.res +RNASeq.enrich_GO(gene = df.rnaseq.degs$gene, go.db = df.rnaseq.go) -> go.res } diff --git a/man/enrich_KEGG.Rd b/man/RNASeq.enrich_KEGG.Rd similarity index 75% rename from man/enrich_KEGG.Rd rename to man/RNASeq.enrich_KEGG.Rd index 7d973b6..94b3516 100644 --- a/man/enrich_KEGG.Rd +++ b/man/RNASeq.enrich_KEGG.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/enrich_KEGG.R -\name{enrich_KEGG} -\alias{enrich_KEGG} +% Please edit documentation in R/RNASeq.enrich_KEGG.R +\name{RNASeq.enrich_KEGG} +\alias{RNASeq.enrich_KEGG} \title{Perform KEGG enrichment analysis of differentially expressed genes.} \usage{ -enrich_KEGG(gene, kegg.db, pAdjustMethod = "BH", p.adjust = 0.05) +RNASeq.enrich_KEGG(gene, kegg.db, pAdjustMethod = "BH", p.adjust = 0.05) } \arguments{ \item{gene}{The names of differentially expressed genes are a vector.} @@ -31,6 +31,6 @@ library(biohelpers) data(df.rnaseq.kegg) data(df.rnaseq.degs) -enrich_KEGG(gene = df.rnaseq.degs$gene, kegg.db = df.rnaseq.kegg) -> kegg.res +RNASeq.enrich_KEGG(gene = df.rnaseq.degs$gene, kegg.db = df.rnaseq.kegg) -> kegg.res } diff --git a/man/plot_volcano.Rd b/man/RNASeq.plot_volcano.Rd similarity index 82% rename from man/plot_volcano.Rd rename to man/RNASeq.plot_volcano.Rd index f87a0fd..a14f691 100644 --- a/man/plot_volcano.Rd +++ b/man/RNASeq.plot_volcano.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/plot_volcano.R -\name{plot_volcano} -\alias{plot_volcano} +% Please edit documentation in R/RNASeq.plot_volcano.R +\name{RNASeq.plot_volcano} +\alias{RNASeq.plot_volcano} \title{Create a volcano plot.} \usage{ -plot_volcano( +RNASeq.plot_volcano( data, x = "log2FoldChange", y = "padj", @@ -41,6 +41,6 @@ library(biohelpers) data(df.rnaseq.plot_volcano) -plot_volcano(data = df.rnaseq.plot_volcano) -> p +RNASeq.plot_volcano(data = df.rnaseq.plot_volcano) -> p }