-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from eleonore-schneeg/dev_ele_new
Dev ele new
- Loading branch information
Showing
132 changed files
with
10,214 additions
and
249 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#' Generate a report for single omic analysis | ||
#' | ||
#' @param pathways list of pathways | ||
#' @param report_folder_path report_folder_path folder path to save the report. | ||
#' @param report_file filename for report (without an extension). | ||
#' @param database Enrichment database `GO_Molecular_Function_2021`,`GO_Cellular_Component_2021`, | ||
#' `GO_Biological_Process_2021`, `Reactome_2016` , `KEGG_2021_Human` , `MSigDB_Hallmark_2020` | ||
#' @family Report | ||
#' @return Single omic analyses report html | ||
#' @export | ||
#' | ||
pathway_report <- function(pathways, | ||
report_folder_path = getwd(), | ||
report_file = "single_omic_report_Omix", | ||
database='Reactome_2016', | ||
num_path=20){ | ||
uniomic=list() | ||
uniomic$param$pathways=pathways | ||
uniomic$param$database=database | ||
uniomic$param$num_path=num_path | ||
|
||
|
||
report_file <- tools::file_path_sans_ext(report_file) | ||
|
||
cli::cli_h2("Generating report for pathways analyses") | ||
|
||
|
||
metadata_tmp_path <- file.path(tempdir(), "metadata.qs") | ||
|
||
cli::cli_text("Writing temp files for report...") | ||
qs::qsave( | ||
uniomic, | ||
metadata_tmp_path | ||
) | ||
|
||
krd <- file.path(tempdir(), "krdqc") | ||
intd <- file.path(tempdir(), "idqc") | ||
dir.create(krd, showWarnings = FALSE) | ||
dir.create(intd, showWarnings = FALSE) | ||
|
||
cli::cli_text("Generating Pathway report...") | ||
rmarkdown::render( | ||
system.file( | ||
"rmarkdown/templates/pathways/skeleton.Rmd", | ||
package = "Omix" | ||
), | ||
params = list( | ||
metadata_path = metadata_tmp_path | ||
), | ||
output_dir = report_folder_path, | ||
output_file = report_file, | ||
knit_root_dir = krd, | ||
intermediates_dir = intd, | ||
quiet = TRUE | ||
) | ||
|
||
report_file_name <- paste(report_file, ".html", sep = "") | ||
|
||
|
||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
#' Generate a report for single omic analysis | ||
#' | ||
#' @param multiassay Multiassay experiment object generated by Omix | ||
#' @param report_folder_path report_folder_path folder path to save the report. | ||
#' @param report_file filename for report (without an extension). | ||
#' @param slot Slot of interest | ||
#' @param database Enrichment database `GO_Molecular_Function_2021`,`GO_Cellular_Component_2021`, | ||
#' `GO_Biological_Process_2021`, `Reactome_2016` , `KEGG_2021_Human` , `MSigDB_Hallmark_2020` | ||
#' @param clinical_covariates clinical covariates for table1 | ||
#' @family Report | ||
#' @return Single omic analyses report html | ||
#' @export | ||
#' | ||
proteomics_report <- function(multiassay, | ||
report_folder_path = getwd(), | ||
report_file = "single_omic_report_Omix", | ||
slot='ADvsControl', | ||
database='Reactome_2016', | ||
num_path=20, | ||
clinical_covariates=c('PHF1','amyloid','PMD')){ | ||
uniomic=list() | ||
uniomic=multiassay@metadata[c('DEP')] | ||
uniomic$param$slot=slot | ||
uniomic$param$database=database | ||
uniomic$param$num_path=num_path | ||
uniomic$metadata=multiassay@colData | ||
uniomic$parameters_analysis_protein = multiassay@metadata$parameters$single_omic$de$protein | ||
uniomic$parameters_processing_protein = multiassay@metadata$parameters$processing$protein | ||
uniomic$clinical_covariates= clinical_covariates | ||
|
||
report_file <- tools::file_path_sans_ext(report_file) | ||
|
||
cli::cli_h2("Generating report for single omic analyses") | ||
|
||
|
||
metadata_tmp_path <- file.path(tempdir(), "metadata.qs") | ||
|
||
cli::cli_text("Writing temp files for report...") | ||
qs::qsave( | ||
uniomic, | ||
metadata_tmp_path | ||
) | ||
|
||
krd <- file.path(tempdir(), "krdqc") | ||
intd <- file.path(tempdir(), "idqc") | ||
dir.create(krd, showWarnings = FALSE) | ||
dir.create(intd, showWarnings = FALSE) | ||
|
||
cli::cli_text("Generating single omic analyses report...") | ||
rmarkdown::render( | ||
system.file( | ||
"rmarkdown/templates/proteomics/skeleton.Rmd", | ||
package = "Omix" | ||
), | ||
params = list( | ||
metadata_path = metadata_tmp_path | ||
), | ||
output_dir = report_folder_path, | ||
output_file = report_file, | ||
knit_root_dir = krd, | ||
intermediates_dir = intd, | ||
quiet = TRUE | ||
) | ||
|
||
report_file_name <- paste(report_file, ".html", sep = "") | ||
|
||
|
||
|
||
} | ||
|
Oops, something went wrong.