From 4f5773f3de02c15b5ad84c0ab9f2036c83dcf584 Mon Sep 17 00:00:00 2001 From: Witold Wolski Date: Wed, 3 Apr 2024 17:49:07 +0200 Subject: [PATCH] exporting scriptCopyHelperVec --- NAMESPACE | 4 +- R/vignetteHelpers.R | 63 +++---------------- man/INTERNAL_FUNCTIONS_BY_FAMILY.Rd | 3 +- man/copy_SAINTe_doc.Rd | 18 ------ man/copy_mixed_model_analysis_script.Rd | 18 ------ man/find_package_file.Rd | 2 + man/render_MQSummary_rmd.Rd | 3 +- man/render_SummarizeFiltering_rmd.Rd | 28 --------- man/scriptCopyHelperVec.Rd | 12 ++++ .../QualityControlAndSampleSizeEstimation.Rmd | 2 - 10 files changed, 24 insertions(+), 129 deletions(-) delete mode 100644 man/copy_SAINTe_doc.Rd delete mode 100644 man/copy_mixed_model_analysis_script.Rd delete mode 100644 man/render_SummarizeFiltering_rmd.Rd create mode 100644 man/scriptCopyHelperVec.Rd diff --git a/NAMESPACE b/NAMESPACE index 403f46f5a..8e846645b 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -40,8 +40,6 @@ export(complete_cases) export(compute_pooled) export(contrasts_fisher_exact) export(contrasts_linfct) -export(copy_SAINTe_doc) -export(copy_mixed_model_analysis_script) export(cor_jackknife_matrix) export(cor_order) export(create_config_MQ_peptide) @@ -143,7 +141,6 @@ export(remove_NA_rows) export(remove_large_QValues) export(remove_small_intensities) export(render_MQSummary_rmd) -export(render_SummarizeFiltering_rmd) export(response_as_matrix) export(response_matrix_as_tibble) export(rlm_estimate) @@ -152,6 +149,7 @@ export(robust_scale) export(sample_subset) export(scale_with_subset) export(scale_with_subset_by_factors) +export(scriptCopyHelperVec) export(separate_factors) export(separate_hierarchy) export(setup_analysis) diff --git a/R/vignetteHelpers.R b/R/vignetteHelpers.R index 86490006f..0b4bd68b3 100644 --- a/R/vignetteHelpers.R +++ b/R/vignetteHelpers.R @@ -1,7 +1,9 @@ #' find file stored in package #' @export +#' @keywords internal #' @examples #' find_package_file("prolfqua","extdata/medata.csv") +#' find_package_file <- function(packagename, file){ src_script <- file.path(find.package(packagename) , file ) @@ -17,8 +19,10 @@ find_package_file <- function(packagename, file){ } - -.scriptCopyHelperVec <- +#' copy script files and other from a package to workdir +#' @export +#' @keywords internal +scriptCopyHelperVec <- function(runscripts, workdir = getwd(), packagename = "prolfqua") { @@ -49,35 +53,6 @@ find_package_file <- function(packagename, file){ return(res) } -#' copy all files need to run mixed model analysis. -#' @param workdir directory where to copy file - default is current working directory. -#' @keywords internal -#' @export -#' @examples -#' copy_mixed_model_analysis_script(workdir = tempdir()) -copy_mixed_model_analysis_script <- function(workdir = getwd()){ - runscripts <- c("fgcz_formatting/fgcz_header.html", - "fgcz_formatting/fgcz_footer.html", - "fgcz_formatting/fgcz.css", - "fgcz_formatting/fgcz_banner.png", - "rmarkdown/mixed_model_analysis_script_Report.Rmd", - "rmarkdown/bibliography.bib" - ) - .scriptCopyHelperVec(runscripts, workdir = workdir) -} - - - -#' copy SAINTexpress doc file -#' @param workdir directory where to copy file - default is current working directory. -#' @keywords internal -#' @export -#' @examples -#' copy_SAINTe_doc(workdir = tempdir()) -copy_SAINTe_doc <- function(workdir = getwd()){ - runscripts <- c("SaintExpress/SAINTexpress-manual.docx") - .scriptCopyHelperVec(runscripts, workdir = workdir) -} .run_markdown_with_params <- function(params, @@ -87,7 +62,7 @@ copy_SAINTe_doc <- function(workdir = getwd()){ workdir = tempdir(), packagename = "prolfqua", format = "pdf") { - res <- .scriptCopyHelperVec(markdown_path, + res <- prolfqua::scriptCopyHelperVec(markdown_path, workdir = workdir, packagename = packagename) dist_file_path <- @@ -168,27 +143,3 @@ render_MQSummary_rmd <- -#' render Filtering Summary. -#' @param pdata data.frame -#' @param config AnalysisConfiguration -#' -#' @family vignetteHelpers -#' @keywords internal -#' -#' @export -#' -render_SummarizeFiltering_rmd <- - function(results, - dest_path = ".", - dest_file_name = "Summarize_Filtering.pdf", - workdir = tempdir()) - { - dist_file_path <- .run_markdown_with_params( - results, - markdown_path = "rmarkdown/Summarize_Filtering.Rmd", - dest_path = dest_path, - dest_file_name = dest_file_name, - workdir = workdir, - packagename = "prolfqua" - ) - } diff --git a/man/INTERNAL_FUNCTIONS_BY_FAMILY.Rd b/man/INTERNAL_FUNCTIONS_BY_FAMILY.Rd index 5e00152c9..5f46a4d72 100644 --- a/man/INTERNAL_FUNCTIONS_BY_FAMILY.Rd +++ b/man/INTERNAL_FUNCTIONS_BY_FAMILY.Rd @@ -150,8 +150,7 @@ Other utilities: \code{\link{table_facade}()} Other vignetteHelpers: -\code{\link{render_MQSummary_rmd}()}, -\code{\link{render_SummarizeFiltering_rmd}()} +\code{\link{render_MQSummary_rmd}()} } \concept{FragPipe} \concept{MaxQuant} diff --git a/man/copy_SAINTe_doc.Rd b/man/copy_SAINTe_doc.Rd deleted file mode 100644 index 2c6ebc56e..000000000 --- a/man/copy_SAINTe_doc.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vignetteHelpers.R -\name{copy_SAINTe_doc} -\alias{copy_SAINTe_doc} -\title{copy SAINTexpress doc file} -\usage{ -copy_SAINTe_doc(workdir = getwd()) -} -\arguments{ -\item{workdir}{directory where to copy file - default is current working directory.} -} -\description{ -copy SAINTexpress doc file -} -\examples{ -copy_SAINTe_doc(workdir = tempdir()) -} -\keyword{internal} diff --git a/man/copy_mixed_model_analysis_script.Rd b/man/copy_mixed_model_analysis_script.Rd deleted file mode 100644 index d337d4494..000000000 --- a/man/copy_mixed_model_analysis_script.Rd +++ /dev/null @@ -1,18 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vignetteHelpers.R -\name{copy_mixed_model_analysis_script} -\alias{copy_mixed_model_analysis_script} -\title{copy all files need to run mixed model analysis.} -\usage{ -copy_mixed_model_analysis_script(workdir = getwd()) -} -\arguments{ -\item{workdir}{directory where to copy file - default is current working directory.} -} -\description{ -copy all files need to run mixed model analysis. -} -\examples{ -copy_mixed_model_analysis_script(workdir = tempdir()) -} -\keyword{internal} diff --git a/man/find_package_file.Rd b/man/find_package_file.Rd index a3f0aaaf8..758ba123e 100644 --- a/man/find_package_file.Rd +++ b/man/find_package_file.Rd @@ -11,4 +11,6 @@ find file stored in package } \examples{ find_package_file("prolfqua","extdata/medata.csv") + } +\keyword{internal} diff --git a/man/render_MQSummary_rmd.Rd b/man/render_MQSummary_rmd.Rd index 135b3b4f4..b5ce591d5 100644 --- a/man/render_MQSummary_rmd.Rd +++ b/man/render_MQSummary_rmd.Rd @@ -50,8 +50,7 @@ render_MQSummary_rmd(analysis, } \seealso{ Other vignetteHelpers: -\code{\link{INTERNAL_FUNCTIONS_BY_FAMILY}}, -\code{\link{render_SummarizeFiltering_rmd}()} +\code{\link{INTERNAL_FUNCTIONS_BY_FAMILY}} } \concept{vignetteHelpers} \keyword{internal} diff --git a/man/render_SummarizeFiltering_rmd.Rd b/man/render_SummarizeFiltering_rmd.Rd deleted file mode 100644 index 79a86852a..000000000 --- a/man/render_SummarizeFiltering_rmd.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vignetteHelpers.R -\name{render_SummarizeFiltering_rmd} -\alias{render_SummarizeFiltering_rmd} -\title{render Filtering Summary.} -\usage{ -render_SummarizeFiltering_rmd( - results, - dest_path = ".", - dest_file_name = "Summarize_Filtering.pdf", - workdir = tempdir() -) -} -\arguments{ -\item{pdata}{data.frame} - -\item{config}{AnalysisConfiguration} -} -\description{ -render Filtering Summary. -} -\seealso{ -Other vignetteHelpers: -\code{\link{INTERNAL_FUNCTIONS_BY_FAMILY}}, -\code{\link{render_MQSummary_rmd}()} -} -\concept{vignetteHelpers} -\keyword{internal} diff --git a/man/scriptCopyHelperVec.Rd b/man/scriptCopyHelperVec.Rd new file mode 100644 index 000000000..6c865c5ed --- /dev/null +++ b/man/scriptCopyHelperVec.Rd @@ -0,0 +1,12 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/vignetteHelpers.R +\name{scriptCopyHelperVec} +\alias{scriptCopyHelperVec} +\title{copy script files and other from a package to workdir} +\usage{ +scriptCopyHelperVec(runscripts, workdir = getwd(), packagename = "prolfqua") +} +\description{ +copy script files and other from a package to workdir +} +\keyword{internal} diff --git a/vignettes/QualityControlAndSampleSizeEstimation.Rmd b/vignettes/QualityControlAndSampleSizeEstimation.Rmd index 38eb16098..02c10a92d 100644 --- a/vignettes/QualityControlAndSampleSizeEstimation.Rmd +++ b/vignettes/QualityControlAndSampleSizeEstimation.Rmd @@ -33,9 +33,7 @@ Generate Simulated data. To learn how to create prolfqua LFQData objects see the ```{r filterdata} simdata <- prolfqua::sim_lfq_data_peptide_config() lfqdata <- prolfqua::LFQData$new(simdata$data,simdata$config) - lfqdata$remove_small_intensities() - ``` You can convert the data into a data frame in a wide format, where the