yulab.utils/0000755000176200001440000000000014555435272012541 5ustar liggesusersyulab.utils/NAMESPACE0000644000176200001440000000253514554357677014000 0ustar liggesusers# Generated by roxygen2: do not edit by hand S3method(print,exec) export(Biocpkg) export(CRANpkg) export(Githubpkg) export(auto_set_regexpr_style) export(check_pkg) export(combinations) export(exec) export(get_cache) export(get_cache_element) export(get_cache_item) export(get_dependencies) export(get_fun_from_pkg) export(initial_cache) export(initial_cache_item) export(install_zip) export(install_zip_gh) export(is.installed) export(ls2df) export(mat2df) export(mat2list) export(mypkg) export(o) export(packageTitle) export(pload) export(rbindlist) export(read.cb) export(rm_cache) export(rm_cache_item) export(scale_range) export(scihub_dl) export(set_PCRE) export(set_TRE) export(set_regexpr_style) export(show_in_excel) export(str_ends) export(str_extract) export(str_starts) export(str_wrap) export(update_cache_item) export(use_perl) export(yread) export(yread_tsv) importFrom(cli,cli_h2) importFrom(digest,digest) importFrom(fs,path_join) importFrom(memoise,memoise) importFrom(rlang,as_name) importFrom(rlang,check_installed) importFrom(rlang,enquo) importFrom(stats,setNames) importFrom(tools,package_dependencies) importFrom(utils,combn) importFrom(utils,download.file) importFrom(utils,getFromNamespace) importFrom(utils,modifyList) importFrom(utils,packageDescription) importFrom(utils,read.table) yulab.utils/man/0000755000176200001440000000000014554357677013327 5ustar liggesusersyulab.utils/man/combinations.Rd0000644000176200001440000000046514471060707016267 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/combinations.R \name{combinations} \alias{combinations} \title{combinations} \usage{ combinations(n) } \arguments{ \item{n}{number of sets} } \value{ a list of all combinations } \description{ all possible combinations of n sets } yulab.utils/man/scihub-dl.Rd0000644000176200001440000000072614404503310015440 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scihub-dl.R \name{scihub_dl} \alias{scihub_dl} \title{download publication via scihub} \usage{ scihub_dl(doi, scihub = "sci-hub.tw", download = TRUE) } \arguments{ \item{doi}{doi} \item{scihub}{scihub website} \item{download}{whether download the pdf file} } \value{ pdf url } \description{ using scihub to download publication using doi } \author{ Guangchuang Yu } yulab.utils/man/scale_range.Rd0000644000176200001440000000046514443622064016044 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/scale.R \name{scale_range} \alias{scale_range} \title{scale-range} \usage{ scale_range(data) } \arguments{ \item{data}{the input data.} } \value{ normalized data } \description{ normalized data by range } \author{ Guangchuang Yu } yulab.utils/man/get_dependencies.Rd0000644000176200001440000000061214477505127017067 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pkg-utils.R \name{get_dependencies} \alias{get_dependencies} \title{get_dependencies} \usage{ get_dependencies(pkg, repo = c("CRAN", "BioC")) } \arguments{ \item{pkg}{package name} \item{repo}{'CRAN' and/or 'BioC'} } \value{ reverse dependencies } \description{ get reverse dependencies } \author{ Guangchuang Yu } yulab.utils/man/github-pkg.Rd0000644000176200001440000000061414535556535015651 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pkg-utils.R \name{Githubpkg} \alias{Githubpkg} \title{print md text of package with link to github repo} \usage{ Githubpkg(user, pkg) } \arguments{ \item{user}{github user} \item{pkg}{package name} } \value{ md text string } \description{ print md text of package with link to github repo } \author{ Guangchuang Yu } yulab.utils/man/yulab-cache.Rd0000644000176200001440000000254014543172523015753 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/cache.R \name{initial_cache} \alias{initial_cache} \alias{get_cache} \alias{rm_cache} \alias{initial_cache_item} \alias{get_cache_item} \alias{rm_cache_item} \alias{update_cache_item} \alias{get_cache_element} \title{cache intermediate data} \usage{ initial_cache() get_cache() rm_cache() initial_cache_item(item) get_cache_item(item) rm_cache_item(item) update_cache_item(item, elements) get_cache_element(item, elements) } \arguments{ \item{item}{the name of the cached item} \item{elements}{elements to be cached in the item} } \value{ return the cache environment, item or selected elements, depends on the functions. } \description{ Yulab provides a set of utilities to cache intermediate data, including initialize the cached item, update cached item and rmove the cached item, etc. } \examples{ \dontrun{ slow_fib <- function(x) { if (x < 2) return(1) slow_fib(x-2) + slow_fib(x-1) } fast_fib <- function(x) { if (x < 2) return(1) res <- get_cache_element('fibonacci', as.character(x)) if (!is.null(res)) { return(res) } res <- fast_fib(x-2) + fast_fib(x-1) e <- list() e[[as.character(x)]] <- res update_cache_item('fibonacci', e) return(res) } system.time(slow_fib(30)) system.time(fast_fib(30)) } } yulab.utils/man/str-extract.Rd0000644000176200001440000000064514554357677016103 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/str-utils.R \name{str_extract} \alias{str_extract} \title{str_extract} \usage{ str_extract(string, pattern) } \arguments{ \item{string}{input string} \item{pattern}{a regular expression to describe the pattern to extracted from the 'string'} } \value{ substring } \description{ Extract a substring using a pattern } \author{ Guangchuang Yu } yulab.utils/man/install_zip.Rd0000644000176200001440000000074414404503310016116 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/install_zip.R \name{install_zip} \alias{install_zip} \title{install_zip} \usage{ install_zip(file, args = "--no-build-vignettes") } \arguments{ \item{file}{zip file} \item{args}{argument to build package} } \value{ No return value, called for install R package from zip file of source codes } \description{ install R package from zip file of source codes } \author{ Guangchuang Yu } yulab.utils/man/mat2list.Rd0000644000176200001440000000055414474263201015335 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/matrix-utils.R \name{mat2list} \alias{mat2list} \title{mat2list} \usage{ mat2list(x) } \arguments{ \item{x}{the input matrix} } \value{ a list that contains matrix columns as its elements } \description{ convert a matrix to a list } \examples{ x <- matrix(1:15, nrow = 3) mat2list(x) } yulab.utils/man/packageTitle.Rd0000644000176200001440000000055414477505127016204 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pkg-utils.R \name{packageTitle} \alias{packageTitle} \title{packageTitle} \usage{ packageTitle(pkg, repo = "CRAN") } \arguments{ \item{pkg}{package name} \item{repo}{'CRAN' and/or 'BioC'} } \value{ reverse dependencies } \description{ Extract package title } \author{ Guangchuang Yu } yulab.utils/man/get_fun_from_pkg.Rd0000644000176200001440000000064014404503310017074 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pkg-utils.R \name{get_fun_from_pkg} \alias{get_fun_from_pkg} \title{get_fun_from_pkg} \usage{ get_fun_from_pkg(pkg, fun) } \arguments{ \item{pkg}{package} \item{fun}{function} } \value{ function } \description{ load function from package } \examples{ get_fun_from_pkg('utils', 'zip') } \author{ Guangchuang Yu } yulab.utils/man/rbindlist.Rd0000644000176200001440000000051114474316464015573 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/list.R \name{rbindlist} \alias{rbindlist} \title{rbindlist} \usage{ rbindlist(x) } \arguments{ \item{x}{a list that have similar elements that can be rbind to a data.frame} } \value{ data.frame } \description{ rbind a list } \author{ Guangchuang Yu } yulab.utils/man/o.Rd0000644000176200001440000000070214510021774014025 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/file.R \name{o} \alias{o} \title{o} \usage{ o(file = ".") } \arguments{ \item{file}{to be open; open working directory by default} } \value{ No return value, called for opening specific directory or file } \description{ open selected directory or file } \examples{ \dontrun{ ## to open current working directory o() } } \author{ Guangchuang Yu } yulab.utils/man/regexpr-style.Rd0000644000176200001440000000244314536214433016411 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/regexpr.R \name{set_PCRE} \alias{set_PCRE} \alias{set_TRE} \alias{use_perl} \alias{set_regexpr_style} \alias{auto_set_regexpr_style} \title{switch regular expression style (PCRE vs TRE)} \usage{ set_PCRE() set_TRE() use_perl() set_regexpr_style(style) auto_set_regexpr_style() } \arguments{ \item{style}{one of 'PCRE' or 'TRE'} } \value{ logical value of whether use perl } \description{ The \code{set_regexpr_style()} allows user to specify which style to be used, while the \code{auto_set_regexpr_style()} automatically set the style depdending on the operating system (TRE for Windows and PCRE for other OSs (Linux and Mac)). } \details{ \code{set_PCRE()} force to use PCRE style while \code{set_TRE()} force to use TRE. Note that all these functions are not change the behavior of \code{gsub()} and \code{regexpr()}. The functions are just set a global option to store the user's choice of whether using \code{perl = TRUE}. Users can access the option via \code{use_perl()} and pass the return value to \code{gusb()} or \code{regexpr()} to specify the style in use. } \references{ \url{https://stackoverflow.com/questions/47240375/regular-expressions-in-base-r-perl-true-vs-the-default-pcre-vs-tre} } \author{ Guangchuang Yu } yulab.utils/man/show_in_excel.Rd0000644000176200001440000000056214404503310016412 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/file.R \name{show_in_excel} \alias{show_in_excel} \title{show_in_excel} \usage{ show_in_excel(.data) } \arguments{ \item{.data}{a data frame to be open} } \value{ original .data } \description{ Open data frame in Excel. It can be used in pipe. } \author{ Guangchuang Yu } yulab.utils/man/cran-bioc-pkg.Rd0000644000176200001440000000070314404503310016175 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pkg-utils.R \name{CRANpkg} \alias{CRANpkg} \alias{Biocpkg} \title{print md text of package with link to homepage (CRAN or Bioconductor)} \usage{ CRANpkg(pkg) Biocpkg(pkg) } \arguments{ \item{pkg}{package name} } \value{ md text string } \description{ print md text of package with link to homepage (CRAN or Bioconductor) } \author{ Guangchuang Yu } yulab.utils/man/ls2df.Rd0000644000176200001440000000054414474316464014621 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/list.R \name{ls2df} \alias{ls2df} \title{Convert a list of vector (e.g, gene IDs) to a data.frame object} \usage{ ls2df(inputList) } \arguments{ \item{inputList}{A list of vector} } \value{ a data.frame object. } \description{ Convert a list of vector to a data.frame object. } yulab.utils/man/exec.Rd0000644000176200001440000000051114444011744014513 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/exec.R \name{exec} \alias{exec} \title{exec} \usage{ exec(command) } \arguments{ \item{command}{system command to run} } \value{ An \code{exec} instance that stores system command outputs } \description{ run system command } \author{ Guangchuang Yu } yulab.utils/man/mypkg.Rd0000644000176200001440000000053114404503310014707 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pkg-utils.R \name{mypkg} \alias{mypkg} \title{mypkg} \usage{ mypkg(pkg, url) } \arguments{ \item{pkg}{package name} \item{url}{package url} } \value{ md text string } \description{ print md text of link to a pakcage } \author{ Guangchuang Yu } yulab.utils/man/is.installed.Rd0000644000176200001440000000075414404503310016160 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pkg-utils.R \name{is.installed} \alias{is.installed} \title{is.installed} \usage{ is.installed(packages) } \arguments{ \item{packages}{package names} } \value{ logical vector } \description{ Check whether the input packages are installed } \details{ This function check whether the input packages are installed } \examples{ is.installed(c("dplyr", "ggplot2")) } \author{ Guangchuang Yu } yulab.utils/man/pload.Rd0000644000176200001440000000115114501256665014676 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pkg-utils.R \name{pload} \alias{pload} \title{pload} \usage{ pload(package, action = "auto") } \arguments{ \item{package}{package name} \item{action}{function used to install package. If 'action = "auto"', it will try to use 'BiocManager::install()' if it is available.} } \value{ the selected package loaded to the R session } \description{ loading a package } \details{ The function use 'library()' to load the package. If the package is not installed, the function will try to install it before loading it. } \author{ Guangchuang Yu } yulab.utils/man/check_pkg.Rd0000644000176200001440000000127214462656667015535 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/pkg-utils.R \name{check_pkg} \alias{check_pkg} \title{check_pkg} \usage{ check_pkg(pkg, reason = NULL, ...) } \arguments{ \item{pkg}{package names} \item{reason}{the reason to check the pkg. If NULL, it will set the reason to the parent call.} \item{...}{additional parameters that passed to \code{rlang::check_installed()}} } \value{ see also \link[rlang:is_installed]{check_installed} } \description{ Check whether the input packages are installed } \details{ This function check whether the input packages are installed. If not, it asks the user whether to install the missing packages. } \author{ Guangchuang Yu } yulab.utils/man/mat2df.Rd0000644000176200001440000000110014474263201014737 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/matrix-utils.R \name{mat2df} \alias{mat2df} \title{mat2df} \usage{ mat2df(x) } \arguments{ \item{x}{the input matrix} } \value{ a data.frame in long format with the 'value' column stores the original values and 'row' and 'col' columns stored in row and column index as in x } \description{ convert a matrix to a tidy data frame (from wide to long format as described in the tidyverse concept) } \examples{ x <- matrix(1:15, nrow = 3) mat2df(x) } \author{ Guangchuang Yu } yulab.utils/man/yread.Rd0000644000176200001440000000143214471060707014701 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/file.R \name{yread_tsv} \alias{yread_tsv} \alias{yread} \title{yread} \usage{ yread_tsv( file, reader = utils::read.delim, params = list(), cache_dir = tempdir() ) yread(file, reader = readLines, params = list(), cache_dir = tempdir()) } \arguments{ \item{file}{a file or url} \item{reader}{a function to read the 'file_url'} \item{params}{a list of parameters that passed to the 'reader'} \item{cache_dir}{a folder to store cache files} } \value{ the output of using the 'reader' to read the 'file_url' with parameters specified by the 'params' } \description{ read file with caching } \details{ This function read a file (local or url) and cache the content. } \author{ Yonghe Xia and Guangchuang Yu } yulab.utils/man/install_zip_gh.Rd0000644000176200001440000000121214506453666016610 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/install_zip.R \name{install_zip_gh} \alias{install_zip_gh} \title{install_zip_gh} \usage{ install_zip_gh(repo, ref = "HEAD", args = "--no-build-vignettes") } \arguments{ \item{repo}{github repo} \item{ref}{github branch, default is HEAD, which means the default branch of the GitHub repo} \item{args}{argument to build package} } \value{ No return value, called for installing github package } \description{ install github package } \details{ it download the zip file first and use \code{install_zip} to install it } \author{ Guangchuang Yu } yulab.utils/man/str-starts-ends.Rd0000644000176200001440000000114414474263201016647 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/str-utils.R \name{str_starts} \alias{str_starts} \alias{str_ends} \title{str_starts} \usage{ str_starts(string, pattern, negate = FALSE) str_ends(string, pattern, negate = FALSE) } \arguments{ \item{string}{input string} \item{pattern}{pattern with which the string starts or ends} \item{negate}{if TRUE, return non-matching elements} } \value{ a logical vector } \description{ Detect the presence or absence of a pattern at the beginning or end of a string or string vector. } \author{ Guangchuang Yu } yulab.utils/man/str_wrap.Rd0000644000176200001440000000075214474263201015437 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/str-utils.R \name{str_wrap} \alias{str_wrap} \title{str_wrap} \usage{ str_wrap(string, width = getOption("width")) } \arguments{ \item{string}{input string} \item{width}{the maximum number of characters before wrapping to a new line} } \value{ update strings with new line character inserted } \description{ wraping long string to multiple lines } \author{ Guangchuang Yu and Erqiang Hu } yulab.utils/man/read.cb.Rd0000644000176200001440000000065714462474155015111 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/file.R \name{read.cb} \alias{read.cb} \title{read.cb} \usage{ read.cb(reader = read.table, ...) } \arguments{ \item{reader}{function to read the clipboard} \item{...}{parameters for the reader} } \value{ clipboard content, output type depends on the output of the reader } \description{ read clipboard } \author{ Guangchuang Yu } yulab.utils/DESCRIPTION0000644000176200001440000000137514555435272014255 0ustar liggesusersPackage: yulab.utils Title: Supporting Functions for Packages Maintained by 'YuLab-SMU' Version: 0.1.4 Authors@R: c(person("Guangchuang", "Yu", email = "guangchuangyu@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-6485-8781"))) Description: Miscellaneous functions commonly used by 'YuLab-SMU'. Imports: cli, digest, fs, memoise, rlang, stats, tools, utils Suggests: httr, jsonlite, openssl ByteCompile: true URL: https://yulab-smu.top/ License: Artistic-2.0 Encoding: UTF-8 RoxygenNote: 7.3.0 NeedsCompilation: no Packaged: 2024-01-28 06:11:55 UTC; HUAWEI Author: Guangchuang Yu [aut, cre] () Maintainer: Guangchuang Yu Repository: CRAN Date/Publication: 2024-01-28 11:30:02 UTC yulab.utils/R/0000755000176200001440000000000014542721451012733 5ustar liggesusersyulab.utils/R/exec.R0000644000176200001440000000063414444011674014005 0ustar liggesusers##' run system command ##' ##' ##' @title exec ##' @param command system command to run ##' @return An `exec` instance that stores system command outputs ##' @export ##' @author Guangchuang Yu exec <- function(command) { res <- system(command, intern=TRUE) structure(res, class = "exec") } ##' @method print exec ##' @export print.exec <- function(x, ...) { cat(x, sep='\n') } yulab.utils/R/scale.R0000644000176200001440000000056614443621642014155 0ustar liggesusers##' normalized data by range ##' ##' ##' @title scale-range ##' @param data the input data. ##' @return normalized data ##' @export ##' @author Guangchuang Yu scale_range <- function(data) { normalized_data <- apply(data, 2, function(x) { (x - min(x, na.rm = TRUE)) / (max(x, na.rm = TRUE) - min(x, na.rm = TRUE)) }) as.data.frame(normalized_data) } yulab.utils/R/zzz.R0000644000176200001440000000025514540507077013721 0ustar liggesusers##' @importFrom memoise memoise .onLoad <- function(libname, pkgname) { yread <<- memoise::memoise(yread) yread_tsv <<- memoise::memoise(yread_tsv) } yulab.utils/R/pkg-utils.R0000644000176200001440000001525714535557160015015 0ustar liggesusers##' loading a package ##' ##' The function use 'library()' to load the package. ##' If the package is not installed, the function will try to install it before loading it. ##' @title pload ##' @param package package name ##' @param action function used to install package. ##' If 'action = "auto"', it will try to use 'BiocManager::install()' if it is available. ##' @return the selected package loaded to the R session ##' @importFrom rlang as_name ##' @importFrom rlang enquo ##' @importFrom rlang check_installed ##' @importFrom cli cli_h2 ##' @importFrom utils getFromNamespace ##' @export ##' @author Guangchuang Yu pload <- function(package, action = "auto") { pkg <- as_name(enquo(package)) if (action == "auto") { if (is.installed("BiocManager")) { install <- getFromNamespace("install", "BiocManager") action <- function(package, ask=FALSE, update=FALSE, ...){ install(package, ask=ask, update = update, ...) } } else { action <- NULL } } check_installed(pkg, action = action) cli::cli_h2(sprintf("loading the package: %s", pkg)) library(pkg, character.only = TRUE) } ##' get reverse dependencies ##' ##' ##' @title get_dependencies ##' @param pkg package name ##' @param repo 'CRAN' and/or 'BioC' ##' @return reverse dependencies ## @importFrom BiocInstaller biocinstallRepos ##' @importFrom tools package_dependencies ##' @export ##' @author Guangchuang Yu get_dependencies <- function(pkg, repo=c("CRAN", "BioC")) { rp <- get_repo(repo) db <- utils::available.packages(repo=rp) tools::package_dependencies(pkg, db=db, reverse=TRUE) } get_repo <- function(repo = c("CRAN", "BioC")) { rp <- c() if ('CRAN' %in% repo) { cran <- getOption("repos")["CRAN"] if (is.null(cran)) { cran <- "http://cloud.r-project.org/" } rp <- c(rp, cran) } if ('BioC' %in% repo) { bioc <- getOption("BioC_mirror") if (is.null(bioc)) { bioc <- "https://mirrors.tuna.tsinghua.edu.cn/bioconductor/" } rp <- c(rp, bioc) } ## options(repos = biocinstallRepos()) sub("/$", "", rp) } ##' Extract package title ##' ##' ##' @title packageTitle ##' @param pkg package name ##' @param repo 'CRAN' and/or 'BioC' ##' @return reverse dependencies ##' @importFrom utils packageDescription ##' @export ##' @author Guangchuang Yu packageTitle <- function(pkg, repo='CRAN') { title <- tryCatch(packageDescription(pkg)$Title, error=function(e) NULL) if (is.null(title)) { repo_url <- get_repo(repo) if (repo == "CRAN") { url <- sprintf("%s/package=%s", repo_url, pkg) } else { bioc_type <- c("bioc", "workflows", "data/annotation", "data/experiment") url <- sprintf("%s/packages/release/%s/html/%s.html", repo_url, bioc_type, pkg) } ## x <- tryCatch(readLines(url), error = function(e) NULL) ## if (is.null(x)) return("") for (u in url) { x <- tryCatch(yread(u), error = function(e) NULL) if (!is.null(x)) { break() } } if (is.null(x)) { return(NA) } i <- grep('^\\s*

', x) if (grepl("

$", x[i])) { xx <- x[i] } else { j <- grep('$', x) xx <- paste(x[i:j], collapse=" ") } title <- gsub('$', '', gsub('\\s*

', '', xx)) } sub("^\\w+\\s*:\\s*", "", gsub("\n", " ", title)) } ##' Check whether the input packages are installed ##' ##' This function check whether the input packages are installed ##' @title is.installed ##' @param packages package names ##' @return logical vector ##' @export ##' @examples ##' is.installed(c("dplyr", "ggplot2")) ##' @author Guangchuang Yu is.installed <- function(packages) { vapply(packages, function(package) { system.file(package=package) != "" }, logical(1)) } ##' Check whether the input packages are installed ##' ##' This function check whether the input packages are installed. If not, it asks the user whether to install the missing packages. ##' @title check_pkg ##' @param pkg package names ##' @param reason the reason to check the pkg. If NULL, it will set the reason to the parent call. ##' @param ... additional parameters that passed to `rlang::check_installed()` ##' @return see also [check_installed][rlang::check_installed] ##' @export ##' @importFrom rlang check_installed ##' @author Guangchuang Yu check_pkg <- function(pkg, reason=NULL, ...) { # v1 # # if (!is.installed(pkg)) { # msg <- sprintf("%s is required, please install it first", pkg) # stop(msg) # } if (is.null(reason)) { call <- sys.call(1L) reason <- sprintf("for %s()", as.character(call)[1]) } rlang::check_installed(pkg, reason, ...) } ##' load function from package ##' ##' ##' @title get_fun_from_pkg ##' @param pkg package ##' @param fun function ##' @return function ##' @export ##' @examples ##' get_fun_from_pkg('utils', 'zip') ##' @author Guangchuang Yu get_fun_from_pkg <- function(pkg, fun) { ## v1 ## ## requireNamespace(pkg) ## eval(parse(text=paste0(pkg, "::", fun))) ## v2 ## ## require(pkg, character.only = TRUE) ## eval(parse(text = fun)) # check_pkg(pkg) utils::getFromNamespace(fun, pkg) } ##' print md text of package with link to homepage (CRAN or Bioconductor) ##' ##' ##' @rdname cran-bioc-pkg ##' @param pkg package name ##' @return md text string ##' @export ##' @author Guangchuang Yu CRANpkg <- function(pkg) { cran <- "https://CRAN.R-project.org/package" fmt <- "[%s](%s=%s)" sprintf(fmt, pkgfmt(pkg), cran, pkg) } ##' @rdname cran-bioc-pkg ##' @export Biocpkg <- function(pkg) { sprintf("[%s](http://bioconductor.org/packages/%s)", pkgfmt(pkg), pkg) } ##' print md text of package with link to github repo ##' ##' ##' @rdname github-pkg ##' @param user github user ##' @param pkg package name ##' @return md text string ##' @export ##' @author Guangchuang Yu Githubpkg <- function(user, pkg) { gh <- "https://github.com" fmt <- "[%s](%s/%s/%s)" sprintf(fmt, pkgfmt(pkg), gh, user, pkg) } ##' print md text of link to a pakcage ##' ##' ##' @title mypkg ##' @param pkg package name ##' @param url package url ##' @return md text string ##' @export ##' @author Guangchuang Yu mypkg <- function(pkg, url) { fmt <- "[%s](%s)" sprintf(fmt, pkgfmt(pkg), url) } pkgfmt <- function(pkg) { fmt <- getOption('yulab.utils_pkgfmt', default="%s") sprintf(fmt, pkg) } yulab.utils/R/regexpr.R0000644000176200001440000000404214536214427014535 0ustar liggesusers##' @rdname regexpr-style ##' @export set_PCRE <- function() { options(regexpr_use_perl = TRUE) } ##' @rdname regexpr-style ##' @export set_TRE <- function() { options(regexpr_use_perl = FALSE) } ##' @rdname regexpr-style ##' @export use_perl <- function() { res <- getOption("regexpr_use_perl", default = auto_set_regexpr_style()) return(res) } ##' switch regular expression style (PCRE vs TRE) ##' ##' The `set_regexpr_style()` allows user to specify which style to be used, ##' while the `auto_set_regexpr_style()` automatically set the style depdending on ##' the operating system (TRE for Windows and PCRE for other OSs (Linux and Mac)). ##' ##' `set_PCRE()` force to use PCRE style while `set_TRE()` force to use TRE. ##' ##' Note that all these functions are not change the behavior of `gsub()` and `regexpr()`. ##' The functions are just set a global option to store the user's choice of whether using `perl = TRUE`. ##' ##' Users can access the option via `use_perl()` and pass the return value to `gusb()` or `regexpr()` to specify the style in use. ##' ##' @rdname regexpr-style ##' @param style one of 'PCRE' or 'TRE' ##' @return logical value of whether use perl ##' @references ##' @export ##' @author Guangchuang Yu set_regexpr_style <- function(style) { if (missing(style)) { message("style is not specific, set automatically.") auto_set_regexpr_style() } else { style <- match.arg(style, c("PCRE", "TRE")) if (style == "PCRE") { set_PCRE() } else { set_TRE() } } res <- getOption("regexpr_use_perl") invisible(res) } ##' @rdname regexpr-style ##' @export auto_set_regexpr_style <- function() { os <- Sys.info()[1] if (os == "Windows") { set_TRE() res <- FALSE } else { set_PCRE() res <- TRUE } invisible(res) } yulab.utils/R/utilities.R0000644000176200001440000000007314404513624015067 0ustar liggesusers`%||%` <- function(a, b) ifelse(is.null(a), b, a) yulab.utils/R/list.R0000644000176200001440000000147614474263164014047 0ustar liggesusers##' rbind a list ##' ##' ##' @title rbindlist ##' @param x a list that have similar elements that can be rbind to a data.frame ##' @return data.frame ##' @author Guangchuang Yu ##' @export rbindlist <- function(x) { do.call('rbind', x) } ##' Convert a list of vector to a data.frame object. ##' ##' ##' @title Convert a list of vector (e.g, gene IDs) to a data.frame object ##' @param inputList A list of vector ##' @return a data.frame object. ##' @export ls2df <- function(inputList) { # ldf <- lapply(1:length(inputList), function(i) { ldf <- lapply(seq_len(length(inputList)), function(i) { data.frame(category=rep(names(inputList[i]), length(inputList[[i]])), value=inputList[[i]]) }) do.call('rbind', ldf) } yulab.utils/R/str-utils.R0000644000176200001440000000731414554361034015031 0ustar liggesusers##' wraping long string to multiple lines ##' ##' ##' @title str_wrap ##' @param string input string ##' @param width the maximum number of characters before wrapping to a new line ##' @return update strings with new line character inserted ##' @export ##' @author Guangchuang Yu and Erqiang Hu str_wrap <- function(string, width = getOption("width")) { ## ## actually, there is a base::strwrap() function available ## # x <- gregexpr(' ', string) # vapply(seq_along(x), # FUN = function(i) { # y <- x[[i]] # n <- nchar(string[i]) # len <- (c(y,n) - c(0, y)) ## length + 1 # idx <- len > width # j <- which(!idx) # if (length(j) && max(j) == length(len)) { # j <- j[-length(j)] # } # if (length(j)) { # idx[j] <- len[j] + len[j+1] > width # } # idx <- idx[-length(idx)] ## length - 1 # start <- c(1, y[idx] + 1) # end <- c(y[idx] - 1, n) # words <- substring(string[i], start, end) # paste0(words, collapse="\n") # }, # FUN.VALUE = character(1) # ) result <- vapply(string, FUN = function(st) { words <- list() i <- 1 while(nchar(st) > width) { if (length(grep(" ", st)) == 0) break y <- gregexpr(' ', st)[[1]] n <- nchar(st) y <- c(y,n) idx <- which(y < width) # When the length of first word > width if (length(idx) == 0) idx <- 1 # Split the string into two pieces # The length of first piece is small than width words[[i]] <- substring(st, 1, y[idx[length(idx)]] - 1) st <- substring(st, y[idx[length(idx)]] + 1, n) i <- i + 1 } words[[i]] <- st paste0(unlist(words), collapse="\n") }, FUN.VALUE = character(1) ) names(result) <- NULL result } ##' Detect the presence or absence of a pattern at the beginning or end of a string or string vector. ##' ##' ##' @title str_starts ##' @rdname str-starts-ends ##' @param string input string ##' @param pattern pattern with which the string starts or ends ##' @param negate if TRUE, return non-matching elements ##' @return a logical vector ##' @export ##' @author Guangchuang Yu str_starts <- function(string, pattern, negate=FALSE) { pattern <- paste0('^', pattern) str_detect(string, pattern, negate) } ##' @rdname str-starts-ends ##' @export str_ends <- function(string, pattern, negate=FALSE) { pattern <- paste0(pattern, '$') str_detect(string, pattern, negate) } ##' @importFrom stats setNames str_detect <- function(string, pattern, negate) { res <- setNames( vapply(string, grepl, pattern=pattern, FUN.VALUE=logical(1)), NULL) if (negate) res <- !res return(res) } ##' Extract a substring using a pattern ##' ##' ##' @title str_extract ##' @rdname str-extract ##' @param string input string ##' @param pattern a regular expression to describe the pattern to extracted from the 'string' ##' @return substring ##' @export ##' @author Guangchuang Yu str_extract <- function(string, pattern) { i <- regexpr(pattern, string) j <- attr(i, 'match.length') res <- substring(string, i, i+j-1) res[res == ""] <- NA return(res) } yulab.utils/R/matrix-utils.R0000644000176200001440000000171314471061074015521 0ustar liggesusers##' convert a matrix to a tidy data frame ##' (from wide to long format as described in the tidyverse concept) ##' ##' ##' @title mat2df ##' @param x the input matrix ##' @return a data.frame in long format with the 'value' column stores the original values ##' and 'row' and 'col' columns stored in row and column index as in x ##' @examples ##' x <- matrix(1:15, nrow = 3) ##' mat2df(x) ##' @export ##' @author Guangchuang Yu mat2df <- function(x) { nr <- nrow(x) nc <- ncol(x) d <- data.frame( value = as.vector(x), row = rep(1:nr, times = nc), col = rep(1:nc, each = nr) ) return(d) } ##' convert a matrix to a list ##' ##' ##' @title mat2list ##' @param x the input matrix ##' @return a list that contains matrix columns as its elements ##' @examples ##' x <- matrix(1:15, nrow = 3) ##' mat2list(x) ##' @export mat2list <- function(x){ lapply(seq_len(ncol(x)), function(i) x[,i]) } yulab.utils/R/combinations.R0000644000176200001440000000050014471060615015535 0ustar liggesusers#' all possible combinations of n sets #' #' @title combinations #' @param n number of sets #' @return a list of all combinations #' @importFrom utils combn #' @export combinations <- function(n){ l <- lapply(seq_len(n), function(x){ m <- combn(n,x) mat2list(m) }) unlist(l, recursive = F) } yulab.utils/R/sudo-install.R0000644000176200001440000000113214444013464015470 0ustar liggesuserssudo_install <- function(pkgs) { ## pkgs_str <- paste0('"', pkgs, '"') %>% ## paste(collapse=',') %>% ## paste("c(", ., ")") ## rcmd0 <- 'options(repos = c(CRAN = "https://mirrors.e-ducation.cn/CRAN/"));' os <- Sys.info()[1] if (os == "Windows") { sudo <- "" } else { sudo <- "sudo" } for (pkg in pkgs) { pkg <- paste0('"', pkg, '"') rcmd <- paste0('install.packages(', pkg, ')') ## rcmd <- paste0(rcmd0, rcmd) cmd <- paste0(sudo, " Rscript -e '", rcmd, "'") system(cmd) } } yulab.utils/R/cache.R0000644000176200001440000000547114543172714014133 0ustar liggesusers##' @rdname yulab-cache ##' @export initial_cache <- function() { pos <- 1 envir <- as.environment(pos) assign(".yulabCache", new.env(), envir = envir) } ##' @rdname yulab-cache ##' @export get_cache <- function() { if (!exists(".yulabCache", envir = .GlobalEnv)) { initial_cache() } get(".yulabCache", envir = .GlobalEnv) } ##' @rdname yulab-cache ##' @export rm_cache <- function() { if (exists(".yulabCache", envir = .GlobalEnv)) { rm(".yulabCache", envir = .GlobalEnv) } } ##' @rdname yulab-cache ##' @export initial_cache_item <- function(item) { env <- get_cache() assign(item, list(), envir = env) } ##' @rdname yulab-cache ##' @export get_cache_item <- function(item) { env <- get_cache() if (!exists(item, envir = env)) { initial_cache_item(item) } get(item, envir = env, inherits = FALSE) } ##' @rdname yulab-cache ##' @export rm_cache_item <- function(item) { env <- get_cache() if (exists(item, envir = env)) { rm(list = item, envir = env) } } ##' cache intermediate data ##' ##' Yulab provides a set of utilities to cache intermediate data, ##' including initialize the cached item, update cached item and rmove the cached item, etc. ##' ##' @rdname yulab-cache ##' @param item the name of the cached item ##' @param elements elements to be cached in the item ##' @return return the cache environment, item or selected elements, depends on the functions. ##' @importFrom utils modifyList ##' @export ##' @examples ##' \dontrun{ ##' slow_fib <- function(x) { ##' if (x < 2) return(1) ##' slow_fib(x-2) + slow_fib(x-1) ##' } ##' ##' fast_fib <- function(x) { ##' if (x < 2) return(1) ##' res <- get_cache_element('fibonacci', as.character(x)) ##' if (!is.null(res)) { ##' return(res) ##' } ##' res <- fast_fib(x-2) + fast_fib(x-1) ##' e <- list() ##' e[[as.character(x)]] <- res ##' update_cache_item('fibonacci', e) ##' return(res) ##' } ##' ##' system.time(slow_fib(30)) ##' system.time(fast_fib(30)) ##' ##' } update_cache_item <- function(item, elements) { msg <- "new elements should be stored as a named list" if (!inherits(elements, 'list')) { stop(msg) } if (is.null(names(elements))) { stop(msg) } if(any(names(elements) == "")) { stop(msg) } env <- get_cache() res <- get_cache_item(item) res <- modifyList(res, elements) assign(item, res, envir = env) } ##' @rdname yulab-cache ##' @export get_cache_element <- function(item, elements) { x <- get_cache_item(item) n <- length(elements) if (n == 1) return(x[[elements]]) return(x[elements]) } yulab.utils/R/install_zip.R0000644000176200001440000000427114506453537015421 0ustar liggesusers##' install github package ##' ##' it download the zip file first and use `install_zip` to install it ##' @title install_zip_gh ##' @param repo github repo ##' @param ref github branch, default is HEAD, which means the default branch of the GitHub repo ##' @param args argument to build package ##' @return No return value, called for installing github package ##' @importFrom utils download.file ##' @export ##' @author Guangchuang Yu install_zip_gh <- function(repo, ref = "HEAD", args = "--no-build-vignettes") { ## repo <- 'GuangchuangYu/nCov2019' url <- paste0('https://codeload.github.com/', repo, '/zip/', ref) f <- tempfile(fileext=".zip") method <- "auto" if (.Platform$OS.type == "windows") method <- "curl" utils::download.file(url, destfile=f, method = method) if (!is_valid_zip(f)) { stop("Invalid zip file downloaded, please check the 'ref' parameter to set a correct github branch.") } install_zip(f, args=args) } ##' install R package from zip file of source codes ##' ##' ##' @title install_zip ##' @param file zip file ##' @param args argument to build package ##' @return No return value, called for install R package from zip file of source codes ##' @export ##' @author Guangchuang Yu install_zip <- function(file, args = "--no-build-vignettes") { dir <- tempfile() utils::unzip(file, exdir=dir) fs <- list.files(path=dir, full.names=T) #if (length(fs) == 1 && dir.exists(fs)) { # dir <- fs #} ## dir <- paste0(dir, '/', basename(repo), '-master') dir <- fs[which.max(file.info(fs)$atime)] if ("INDEX" %in% list.files(dir)) { # file is binary package pkg <- file } else { # file is zip of package source ## remotes::install_local(path=dir, ..., force=TRUE) ## pkg <- pkgbuild::build(dir, args=args) build <- get_fun_from_pkg('pkgbuild', 'build') pkg <- build(dir, args=args) } utils::install.packages(pkg, repos=NULL) } is_valid_zip <- function(zipfile) { fs <- tryCatch(utils::unzip(zipfile, list=TRUE), error = function(e) NULL) if (is.null(fs)) return(FALSE) return(TRUE) } yulab.utils/R/scihub-dl.R0000644000176200001440000000130014404503310014707 0ustar liggesusers##' download publication via scihub ##' ##' using scihub to download publication using doi ##' @rdname scihub-dl ##' @name scihub_dl ##' @param doi doi ##' @param scihub scihub website ##' @param download whether download the pdf file ##' @return pdf url ##' @author Guangchuang Yu ##' @export scihub_dl <- function(doi, scihub = 'sci-hub.tw', download=TRUE) { url <- paste0('https://', scihub, '/', doi) x <- readLines(url) i <- grep('id = "pdf"', x) pdf_url <-sub(".*(//.*\\.pdf).*", "https:\\1", x[i]) if (download) { outfile <- sub(".*/", "", pdf_url) utils::download.file(pdf_url, destfile = outfile) } invisible(pdf_url) } yulab.utils/R/biorxiv.R0000644000176200001440000000264714404503310014536 0ustar liggesusers## biorxiv_get_publication <- function(url) { ## # url <- "https://www.biorxiv.org/search/visualization%20numresults%3A75%20sort%3Arelevance-rank" ## x <- readLines(url) ## pub <- x[grep("/content/10.1101", x)] ## pub_url <- gsub(".*(/content/[[:digit:]\\.v/]+).*", "\\1", pub) ## pub_url <- paste0("https://www.biorxiv.org", pub_url) ## pub_title <- gsub("<[^>]+>", "", pub) %>% ## sub("^\\s+", "", .) %>% ## sub("\\s+$", "", .) ## data.frame(url = pub_url, ## title = pub_title) ## } ## biorxiv_get_correspondance <- function(url) { ## # url <- "https://www.biorxiv.org/content/10.1101/701680v3" ## x <- readLines(url) ## i <- grep("citation_author\"", x) ## j <- grep("citation_author_email", x) ## idx <- vapply(j, function(ii) { ## jj <- ii - i ## i[which(jj == min(jj[jj >0]))] ## }, numeric(1)) ## author <- x[idx] %>% unique %>% ## sub(".*content=\"([^\"]+).*", "\\1", .) ## email <- x[j] %>% unique %>% ## sub(".*content=\"([^\"]+).*", "\\1", .) ## data.frame(author = author, email = email) %>% unique ## } ## url <- "https://www.biorxiv.org/search/visualization%20numresults%3A75%20sort%3Arelevance-rank" ## y <- biorxiv_get_publication(url) ## xx <- lapply(y$url, function(x) { ## cat("parsing", x, "\n") ## biorxiv_get_correspondance(x) ## }) yulab.utils/R/file.R0000644000176200001440000001034714536206314014001 0ustar liggesusers#' @rdname yread #' @export yread_tsv <- function(file, reader = utils::read.delim, params = list(), cache_dir = tempdir() ) { # e.g. params = list(sep = "\t", header = FALSE) yread(file, reader = reader, params = params, cache_dir = cache_dir ) } #' read file with caching #' #' This function read a file (local or url) and cache the content. #' @title yread #' @rdname yread #' @param file a file or url #' @param reader a function to read the 'file_url' #' @param params a list of parameters that passed to the 'reader' #' @param cache_dir a folder to store cache files #' @return the output of using the 'reader' to read the 'file_url' with parameters specified by the 'params' #' @author Yonghe Xia and Guangchuang Yu #' @importFrom fs path_join #' @importFrom digest digest #' @export yread <- function(file, reader = readLines, params = list(), cache_dir = tempdir()) { # Generate a unique cache filename based on the file URL cache_filename <- fs::path_join(c(cache_dir, paste0(digest::digest(file), ".rds"))) # Check if the cached file exists if (file.exists(cache_filename)) { # If cached file exists, load and return the cached data cached_data <- readRDS(cache_filename) return(cached_data) } else { # If cached file does not exist, read and cache the data data <- do.call(reader, args = c(file, params)) saveRDS(data, cache_filename) return(data) } } ##' read clipboard ##' ##' ##' @title read.cb ##' @param reader function to read the clipboard ##' @param ... parameters for the reader ##' @return clipboard content, output type depends on the output of the reader ##' @author Guangchuang Yu ##' @importFrom utils read.table ##' @export read.cb <- function(reader = read.table, ...) { os <- Sys.info()[1] if (os == "Darwin") { clip <- pipe("pbpaste") } else { clip <- "clipboard" } reader(clip, ...) } ##' open selected directory or file ##' ##' ##' @title o ##' @param file to be open; open working directory by default ##' @return No return value, called for opening specific directory or file ##' @examples ##' \dontrun{ ##' ## to open current working directory ##' o() ##' } ##' @export ##' @author Guangchuang Yu o <- function(file=".") { file <- normalizePath(file) os <- Sys.info()[1] if (is.rserver()) { if (dir.exists(file)) { stop("open directory in RStudio Server is not supported.") } rserver_ip <- getOption("rserver_ip") if (!is.null(rserver_ip)) { rserver_port <- getOption("rserver_port") %||% '8787' if (!startsWith(rserver_ip, "http")) { rserver_ip = paste0("http://", rserver_ip) } utils::browseURL( paste0( paste(rserver_ip, rserver_port, sep=":"), "/file_show?path=", file )) } else { file.edit <- get("file.edit") file.edit(file) } } else if (os == "Darwin") { cmd <- paste("open", file) system(cmd) } else if (os == "Linux") { cmd <- paste("xdg-open", file, "&") system(cmd) } else if (os == "Windows") { ## wd <- sub("/", "\\", getwd()) ## cmd <- paste("explorer", wd) ## suppressWarnings(shell(cmd)) cmd <- paste("start", file) shell(cmd) } } is.rserver <- function(){ RStudio.Version = tryCatch(get("RStudio.Version"), error = function(e) NULL) if(is.null(RStudio.Version)) return(FALSE) if(!is.function(RStudio.Version)) return(FALSE) RStudio.Version()$mode == 'server' } ##' Open data frame in Excel. It can be used in pipe. ##' ##' ##' @title show_in_excel ##' @param .data a data frame to be open ##' @return original .data ##' @export ##' @author Guangchuang Yu show_in_excel <- function(.data) { f <- tempfile(fileext = '.csv') utils::write.csv(.data, file=f) o(f) invisible(.data) } yulab.utils/NEWS.md0000644000176200001440000000450214555367665013652 0ustar liggesusers# yulab.utils 0.1.4 + `str_extract()` to extract substring using a regular expression pattern (2024--01-25, Thu) # yulab.utils 0.1.3 + with cache ability (2023-12-27, Wed) - `initial_cache()` - `initial_cache_item()` - `get_cache()` - `get_cache_item()` - `get_cache_element()` - `rm_cache_item()` - `rm_cache()` # yulab.utils 0.1.2 + mv translate functions to the 'fanyi' package (2023-12-14, Thu) + tools to switch from PCRE or TRE in regular expression (2023-12-13, Wed) # yulab.utils 0.1.1 + use `normalizePath()` in `o()` to convert file paths to canonical form (2023-10-06, Fri, #4) + change the default parameter, `ref = "master"` to `ref = "HEAD"` in the `install_zip_gh()` function to use the default branch of the GitHub repo (2023-10-02, Mon) # yulab.utils 0.1.0 + `install_zip()` allows both binary and source zip files (2023-09-20, Wed) + `pload()` for loading package with the ability to install it if not available (2023-09-16, Sat) + `get_dependencies()` and `packageTitle()` (2023-09-11, Mon) + import 'fs' and 'digest' (2023-09-07, Thu) # yulab.utils 0.0.9 + `ls2df()` convert list of vector to a data.frame (2023-09-01, Fri) # yulab.utils 0.0.8 + `mat2list()` and `combinations()` (2023-08-22, Tue) + remove default 'params' setting in `yread_tsv()` (2023-08-15, Tue) # yulab.utils 0.0.7 + update `check_pkg()` to call `rlang::check_installed()` with reason set automatically (2023-08-03, Thu) + `yread()` and `yread_tsv()` that read file with caching (2023-08-02, Wed) + `rbindlist()` to rbind a list (2023-08-01, Tue) + `exec()` to run system command (2023-06-19, Mon) + `scale_range()` to normalize data by range (2023-06-18, Sun) # yulab.utils 0.0.6 + `mat2df()` to convert matrix to a tidy data frame (2022-12-20, Tue) + `str_starts()` and `str_ends()` (2022-07-29, Fri) # yulab.utils 0.0.5 + `get_fun_from_pkg()` outputs friendly message if the pkg is not installed (2022-06-08, Wed) + `show_in_excel()`, `CRANpkg()`, `Biocpkg()`, `Githubpkg()`, `mypkg()` (2021-10-13, Wed) # yulab.utils 0.0.4 + `str_wrap()` (2021-10-09, Sat) # yulab.utils 0.0.3 + `read.cb()` (2021-08-17) # yulab.utils 0.0.2 + `o()`, `install_zip()`, `get_fun_from_pkg()` # yulab.utils 0.0.1 + `is.installed()`, `scihub_dl()`, `sudo_install()` yulab.utils/MD50000644000176200001440000000442514555435272013056 0ustar liggesuserse1d3e3ffc9ff7206a6c7dec198e3ad42 *DESCRIPTION 7dc6be581094bf13b1624c2c92b54641 *NAMESPACE f05a974e987d7ae6d76199557e7b24e8 *NEWS.md 8c817a90acb8deb76024a36d5662c824 *R/biorxiv.R 09a18d0b822d2e29ca10ba3e76fb7485 *R/cache.R 95effca842167b8d4ab1d11056e3e84e *R/combinations.R 46832915177d0b9752c76949234b3d1c *R/exec.R 08fdbbe6af33aa4bb300411bd831b432 *R/file.R dfe0b5ad13f1159c83c2aaf1b9e6cf6d *R/install_zip.R 29332963a97b933d165880d14b5a926f *R/list.R c9d9db73e55f3aadfa2a3cde09cd51c6 *R/matrix-utils.R 6af90ab737708233d6c8482130740b20 *R/pkg-utils.R 3df8fa9cdfda330d886174be882bc35f *R/regexpr.R 0db1a99ecdc6501760d342d82da783a8 *R/scale.R 8b2467b550b0debf2161c3ffa984f73c *R/scihub-dl.R 3c9db1180c151013ad9fdaf4d5bddc11 *R/str-utils.R a33656388df140e42f096042e4d94c4f *R/sudo-install.R 6a94734c56273189e5861de9a7760e3c *R/utilities.R 18c7df3c255d29c3bb86ca3092893504 *R/zzz.R 438fff93f806ab18e9db99060cbabb1b *man/check_pkg.Rd 740f5276df44ad1e6766f7a37fe1d21a *man/combinations.Rd db93bb4ab3c70d03ce07c3a35f237cdd *man/cran-bioc-pkg.Rd 42a044445a567e63fbe9f8d7b4d5d399 *man/exec.Rd e729417aa83b01b31ac177ed6f6c3a14 *man/get_dependencies.Rd feeda9894ca366d3cecd321a26b1c757 *man/get_fun_from_pkg.Rd 4037c412514457e4aa46f4ae2e87a25d *man/github-pkg.Rd dfbc4e67550a8ff93dd167f828333c0a *man/install_zip.Rd 27416a715194cdda190410318907fcb7 *man/install_zip_gh.Rd f1fb5a178766a681c0ee36d3ee16f50f *man/is.installed.Rd 7429eb4c6b9f62553ecae5e16edc4824 *man/ls2df.Rd 6ad39ca2459889f1cdd3f10b50cca2b1 *man/mat2df.Rd 035dbcab8d8db17527a76278426722ca *man/mat2list.Rd 5de5c1a676be17dc7fbe1de44a430b38 *man/mypkg.Rd 350771e856ec3d6a012327e9f9a7661c *man/o.Rd e101a49107b31f0d3bedef24de40e2a5 *man/packageTitle.Rd 8317241089ca88b826c9fab73d536d8e *man/pload.Rd 340d383c001465de8a3773b6cd1db10b *man/rbindlist.Rd 0e20524bfebe8e2ef91eea11dbb62ccb *man/read.cb.Rd 94015f38ecbf2eeb9f295345d938b702 *man/regexpr-style.Rd e4439fe352c1817015d3bc28bd4f5abf *man/scale_range.Rd 7ca4626445edad5c55b084c9a360cff2 *man/scihub-dl.Rd 376e2961dcdfc973c2449512a05eb2a3 *man/show_in_excel.Rd 0ee359877a2bc4bd14136104fd61d24f *man/str-extract.Rd be70aa2c7a2cc288386c27b41a1d122a *man/str-starts-ends.Rd a348ee3c2d8e551de7451333bc097036 *man/str_wrap.Rd e72d8c8b7cef389d2f3235e994bc48f0 *man/yread.Rd 0c88c99a76427c4980cf90320e9c3057 *man/yulab-cache.Rd