diff --git a/.gitignore b/.gitignore index 6a6b6d8..6959d3c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ .Rproj.user +.Rhistory .radian_history Scratch.RConsole - /.quarto/ README.html docs diff --git a/NAMESPACE b/NAMESPACE index 0454c17..8913399 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -8,6 +8,7 @@ export(appmamba_rc) export(arg) export(arg0) export(bcftools) +export(bedtools) export(bowtie2) export(cellranger) export(cmd_background) diff --git a/R/cmd-bedtools.R b/R/cmd-bedtools.R new file mode 100644 index 0000000..d6ba1bd --- /dev/null +++ b/R/cmd-bedtools.R @@ -0,0 +1,38 @@ +#' Run bedtools +#' +#' The `bedtools` is a powerful toolset for genome arithmetic. +#' @param subcmd Sub-Command of bedtools. Details see: `r rd_help("bedtools")`. +#' @param ... `r rd_dots("bedtools")`. +#' @param bedtools `r rd_cmd("bedtools")`. +#' @seealso +#' - +#' - +#' +#' `r rd_seealso()` +#' @inherit exec return +#' @family command +#' @export +bedtools <- make_command( + "bedtools", + function(subcmd = NULL, ..., bedtools = NULL) { + assert_string(subcmd, allow_empty = FALSE, allow_null = TRUE) + assert_string(bedtools, allow_empty = FALSE, allow_null = TRUE) + BEDTools$new(cmd = bedtools, ..., subcmd = subcmd) + } +) + +BEDTools <- R6Class( + "BEDTools", + inherit = Command, + private = list( + alias = function() "bedtools", + setup_help_params = function() "--help", + combine_params = function(subcmd) { + if (private$help) { + c(super$combine_params(), subcmd) + } else { + c(subcmd, super$combine_params()) + } + } + ) +) diff --git a/man/allele_counter.Rd b/man/allele_counter.Rd index 1db2bc0..cfa696b 100644 --- a/man/allele_counter.Rd +++ b/man/allele_counter.Rd @@ -44,6 +44,7 @@ between some other projects, specifically \code{AscatNGS} and \code{Battenberg}. Other \code{commands}: \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/bcftools.Rd b/man/bcftools.Rd index a6960cb..f884a5e 100644 --- a/man/bcftools.Rd +++ b/man/bcftools.Rd @@ -34,6 +34,7 @@ All commands work transparently with both VCFs and BCFs, both uncompressed and B Other \code{commands}: \code{\link{allele_counter}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/bedtools.Rd b/man/bedtools.Rd new file mode 100644 index 0000000..869b61c --- /dev/null +++ b/man/bedtools.Rd @@ -0,0 +1,52 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cmd-bedtools.R +\name{bedtools} +\alias{bedtools} +\title{Run bedtools} +\usage{ +bedtools(subcmd = NULL, ..., bedtools = NULL) +} +\arguments{ +\item{subcmd}{Sub-Command of bedtools. Details see: \code{cmd_help(bedtools())}.} + +\item{...}{<\link[rlang:dyn-dots]{dynamic dots}> Additional arguments passed to \code{bedtools} command. Empty arguments are automatically trimmed. If a single argument, such as a file path, contains spaces, it must be quoted, for example using \code{\link[=shQuote]{shQuote()}}. Details see: \code{cmd_help(bedtools())}.} + +\item{bedtools}{A string of path to \code{bedtools} command.} +} +\value{ +A \code{command} object. +} +\description{ +The \code{bedtools} is a powerful toolset for genome arithmetic. +} +\seealso{ +\itemize{ +\item \url{http://bedtools.readthedocs.io/} +\item \url{https://github.com/arq5x/bedtools2/} +\item \code{\link[=cmd_wd]{cmd_wd()}}/\code{\link[=cmd_envvar]{cmd_envvar()}}/\code{\link[=cmd_envpath]{cmd_envpath()}}/\code{\link[=cmd_condaenv]{cmd_condaenv()}} +\item \code{\link[=cmd_on_start]{cmd_on_start()}}/\code{\link[=cmd_on_exit]{cmd_on_exit()}} +\item \code{\link[=cmd_on_succeed]{cmd_on_succeed()}}/\code{\link[=cmd_on_fail]{cmd_on_fail()}} +\item \code{\link[=cmd_parallel]{cmd_parallel()}} +} + +Other \code{commands}: +\code{\link{allele_counter}()}, +\code{\link{bcftools}()}, +\code{\link{bowtie2}()}, +\code{\link{cellranger}()}, +\code{\link{conda}()}, +\code{\link{fastp}()}, +\code{\link{fastq_pair}()}, +\code{\link{gistic2}()}, +\code{\link{kraken2}()}, +\code{\link{kraken_tools}()}, +\code{\link{perl}()}, +\code{\link{pyscenic}()}, +\code{\link{python}()}, +\code{\link{samtools}()}, +\code{\link{seqkit}()}, +\code{\link{snpEff}()}, +\code{\link{trust4}()}, +\code{\link{varscan}()} +} +\concept{command} diff --git a/man/blit-package.Rd b/man/blit-package.Rd index 8b14d4f..2cdff85 100644 --- a/man/blit-package.Rd +++ b/man/blit-package.Rd @@ -14,6 +14,7 @@ An all-encompassing R toolkit designed to streamline the process of calling vari Useful links: \itemize{ \item \url{https://github.com/WangLabCSU/blit} + \item \url{https://wanglabcsu.github.io/blit/} \item Report bugs at \url{https://github.com/WangLabCSU/blit/issues} } diff --git a/man/bowtie2.Rd b/man/bowtie2.Rd index ebafeeb..361c175 100644 --- a/man/bowtie2.Rd +++ b/man/bowtie2.Rd @@ -41,6 +41,7 @@ Bowtie 2 supports gapped, local, and paired-end alignment modes. Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, \code{\link{fastp}()}, diff --git a/man/cellranger.Rd b/man/cellranger.Rd index 7ebe5c7..f52c025 100644 --- a/man/cellranger.Rd +++ b/man/cellranger.Rd @@ -49,6 +49,7 @@ cellranger( Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{conda}()}, \code{\link{fastp}()}, diff --git a/man/conda.Rd b/man/conda.Rd index 27fd8b3..9fe0555 100644 --- a/man/conda.Rd +++ b/man/conda.Rd @@ -30,6 +30,7 @@ Run conda Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{fastp}()}, diff --git a/man/exec.Rd b/man/exec.Rd index 552db59..31fb607 100644 --- a/man/exec.Rd +++ b/man/exec.Rd @@ -22,6 +22,7 @@ Invoke a System Command \itemize{ \item \code{\link[=allele_counter]{allele_counter()}} \item \code{\link[=bcftools]{bcftools()}} +\item \code{\link[=bedtools]{bedtools()}} \item \code{\link[=bowtie2]{bowtie2()}} \item \code{\link[=cellranger]{cellranger()}} \item \code{\link[=conda]{conda()}} diff --git a/man/fastp.Rd b/man/fastp.Rd index 2b023e1..ec3e879 100644 --- a/man/fastp.Rd +++ b/man/fastp.Rd @@ -34,6 +34,7 @@ and quality control for FastQ data. Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/fastq_pair.Rd b/man/fastq_pair.Rd index b541517..3764bc6 100644 --- a/man/fastq_pair.Rd +++ b/man/fastq_pair.Rd @@ -55,6 +55,7 @@ they demand paired end files have the same number of reads. Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/gistic2.Rd b/man/gistic2.Rd index c0196c9..42e9a6a 100644 --- a/man/gistic2.Rd +++ b/man/gistic2.Rd @@ -52,6 +52,7 @@ deletion, and it lists genes found in each "wide peak" region. Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/kraken2.Rd b/man/kraken2.Rd index 7bd384f..0a1adc0 100644 --- a/man/kraken2.Rd +++ b/man/kraken2.Rd @@ -58,6 +58,7 @@ given k-mer. Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/kraken_tools.Rd b/man/kraken_tools.Rd index 8f45d24..fece02b 100644 --- a/man/kraken_tools.Rd +++ b/man/kraken_tools.Rd @@ -34,6 +34,7 @@ analysis of Kraken results. Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/perl.Rd b/man/perl.Rd index 8b52cd1..c2b8c8e 100644 --- a/man/perl.Rd +++ b/man/perl.Rd @@ -31,6 +31,7 @@ years of development. Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/pyscenic.Rd b/man/pyscenic.Rd index 63fe252..63f20fc 100644 --- a/man/pyscenic.Rd +++ b/man/pyscenic.Rd @@ -31,6 +31,7 @@ Run pyscenic Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/python.Rd b/man/python.Rd index e8da32b..d4e32a3 100644 --- a/man/python.Rd +++ b/man/python.Rd @@ -31,6 +31,7 @@ systems more effectively. Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/samtools.Rd b/man/samtools.Rd index 9364bf7..5b1c133 100644 --- a/man/samtools.Rd +++ b/man/samtools.Rd @@ -33,6 +33,7 @@ systems more effectively. Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/seqkit.Rd b/man/seqkit.Rd index c3b8a54..fcfe722 100644 --- a/man/seqkit.Rd +++ b/man/seqkit.Rd @@ -31,6 +31,7 @@ Run seqkit Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/snpEff.Rd b/man/snpEff.Rd index 192c30b..79b611a 100644 --- a/man/snpEff.Rd +++ b/man/snpEff.Rd @@ -33,6 +33,7 @@ It annotates and predicts the effects of genetic variants on genes and proteins Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/trust4.Rd b/man/trust4.Rd index ea508ac..cdcc7bd 100644 --- a/man/trust4.Rd +++ b/man/trust4.Rd @@ -86,6 +86,7 @@ data Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/man/varscan.Rd b/man/varscan.Rd index edbe779..03ae011 100644 --- a/man/varscan.Rd +++ b/man/varscan.Rd @@ -33,6 +33,7 @@ developed at the Genome Institute at Washington University to detect variants in Other \code{commands}: \code{\link{allele_counter}()}, \code{\link{bcftools}()}, +\code{\link{bedtools}()}, \code{\link{bowtie2}()}, \code{\link{cellranger}()}, \code{\link{conda}()}, diff --git a/tests/testthat/test-exec.R b/tests/testthat/test-exec.R index 96557e5..2e848cc 100644 --- a/tests/testthat/test-exec.R +++ b/tests/testthat/test-exec.R @@ -3,6 +3,11 @@ testthat::test_that("`allele_counter()` works as expected", { allele_counter() |> cmd_help() }) +testthat::test_that("`bedtools()` works as expected", { + testthat::skip_if_not(nzchar(Sys.which("bedtools"))) + bedtools() |> cmd_help() +}) + testthat::test_that("`cellranger()` works as expected", { testthat::skip_if_not(nzchar(Sys.which("cellranger"))) cellranger() |> cmd_help()