diff --git a/DESCRIPTION b/DESCRIPTION index 7845aa6..68996bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -34,6 +34,6 @@ Suggests: Config/testthat/edition: 3 Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 URL: https://github.com/WangLabCSU/blit, https://wanglabcsu.github.io/blit/ BugReports: https://github.com/WangLabCSU/blit/issues diff --git a/NAMESPACE b/NAMESPACE index d72f6da..ec82fad 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -35,12 +35,14 @@ export(install_appmamba) export(kraken2) export(kraken_tools) export(make_command) +export(minimap2) export(perl) export(pyscenic) export(python) export(samtools) export(seqkit) export(snpEff) +export(strelka) export(trust4) export(trust4_gene_names) export(trust4_imgt_annot) diff --git a/NEWS.md b/NEWS.md index 98a6c28..c81f907 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,6 +16,10 @@ * new command `bedtools` +* new command `strelka` + +* new command `minimap2` + # blit 0.2.0 ## New features diff --git a/R/cmd-strelka.R b/R/cmd-strelka.R new file mode 100644 index 0000000..a760e4f --- /dev/null +++ b/R/cmd-strelka.R @@ -0,0 +1,50 @@ +#' Run strelka +#' +#' Strelka is a fast and accurate small variant caller optimized for analysis of germline variation +#' in small cohorts and somatic variation in tumor/normal sample pairs. +#' +#' @param script Name of the Strelka script. One of +#' `r oxford_comma(code_quote(StrelkaScripts))`. +#' @param ... `r rd_dots("strelka")`. +#' @param strelka `r rd_cmd("strelka")`. +#' @seealso +#' - +#' +#' `r rd_seealso()` +#' @inherit exec return +#' @family command +#' @export +strelka <- make_command( + "strelka", + function(script, ...) { + script <- rlang::arg_match0(script, StrelkaScripts) + Strelka$new( + script = script, + ... + ) + } +) + +Strelka <- R6::R6Class( + "Strelka", + inherit = Command, + private = list( + alias = function() "strelka", + command_locate = function() { + py2 <- Sys.which("python2") + if (py2 == "") { + stop("Cannot locate python2. Please install it or activate a Conda environment with Python2.") + }else{py2} + }, + setup_help_params = function() "--help", + setup_command_params = function(script) { + script_path <- pkg_extdata("strelka", paste0(script, ".py")) + file_executable(script_path) + c(script_path, super$combine_params()) + } + ) +) + +StrelkaScripts <- c( + "configureStrelkaGermlineWorkflow", "configureStrelkaSomaticWorkflow", "runWorkflow" +) \ No newline at end of file diff --git a/R/minimap2.R b/R/minimap2.R new file mode 100644 index 0000000..bb75d40 --- /dev/null +++ b/R/minimap2.R @@ -0,0 +1,70 @@ +#' Run minimap2 +#' +#' Minimap2 is a versatile sequence alignment program that aligns DNA or mRNA sequences against a large reference database. +#' Typical use cases include: +#' (1) mapping PacBio or Oxford Nanopore genomic reads to the human genome; +#' (2) finding overlaps between long reads with error rate up to ~15%; +#' (3) splice-aware alignment of PacBio Iso-Seq or Nanopore cDNA or Direct RNA reads against a reference genome; +#' (4) aligning Illumina single- or paired-end reads; +#' (5) assembly-to-assembly alignment; +#' (6) full-genome alignment between two closely related species with divergence below ~15%. +#' +#' @param method Mapping preset: "map-ont" (single-end long reads) or "sr" (paired-end short reads). +#' @param ref Path to the reference genome FASTA file. +#' @param reads A character vector of FASTQ files used as input to minimap2. +#' @param ofile A string of path to the output SAM file. +#' @param ... `r rd_dots("minimap2")`. +#' @param minimap2 `r rd_cmd("minimap2")`. +#' @family command +#' @inherit exec return +#' @seealso +#' - +#' +#' `r rd_seealso()` +#' @export +minimap2 <- make_command( + "minimap2", + function( + method, + ref, + reads, + ofile, + ..., + minimap2 = NULL + ){ + assert_string(minimap2, allow_empty = FALSE, allow_null = TRUE) + Minimap2$new( + cmd = minimap2, + ..., + method = method, + ref = ref, + reads = reads, + ofile = ofile + ) + } +) + +Minimap2 <- R6Class( + "Minimap2", + inherit = Command, + private = list( + alias = function() "minimap2", + setup_help_params = function() "--help", + setup_command_params = function(method, ref, reads, ofile){ + c( + if (!method %in% c("map-ont", "sr")){ + cli::cli_abort("{.arg method} must be map-ont or sr!") + } else { arg0("-ax", method) }, + ref, + if (length(reads) == 1L){ + reads + } else if (length(reads) == 2L){ + reads + } else { + cli::cli_abort("{.arg reads} must be of length 1 or 2") + }, + arg0(">", ofile) + ) + } + ) +) diff --git a/_pkgdown.yml b/_pkgdown.yml index 39afd0d..660ec38 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -52,6 +52,7 @@ reference: - varscan - snpEff - gistic2 + - strelka - title: "Transcriptomic tools" desc: "Wrappers for transcriptome sequencing data processing and analysis tools." diff --git a/inst/extdata/strelka/configureStrelkaGermlineWorkflow.py b/inst/extdata/strelka/configureStrelkaGermlineWorkflow.py new file mode 100755 index 0000000..ef2f5af --- /dev/null +++ b/inst/extdata/strelka/configureStrelkaGermlineWorkflow.py @@ -0,0 +1,189 @@ +#!/usr/bin/env python2 +# +# Strelka - Small Variant Caller +# Copyright (c) 2009-2018 Illumina, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# + +""" +This script configures the strelka germline small variant calling workflow +""" + +import os,sys + +if sys.version_info >= (3,0): + import platform + raise Exception("Strelka does not currently support python3 (version %s detected)" % (platform.python_version())) + +if sys.version_info < (2,6): + import platform + raise Exception("Strelka requires python2 version 2.6+ (version %s detected)" % (platform.python_version())) + + +scriptDir='/home/dingjia/.local/share/R/blit/appmamba/envs/strelka/share/strelka-2.9.10-2/bin' +scriptName=os.path.basename(__file__) +workflowDir='/home/dingjia/.local/share/R/blit/appmamba/envs/strelka/share/strelka-2.9.10-2/lib/python' + +sys.path.append(workflowDir) + +from configBuildTimeInfo import workflowVersion +from strelkaSharedOptions import StrelkaSharedWorkflowOptionsBase +from configureUtil import BamSetChecker, groomBamList, joinFile, OptParseException, checkFixTabixIndexedFileOption +from makeRunScript import makeRunScript +from strelkaGermlineWorkflow import StrelkaGermlineWorkflow +from workflowUtil import ensureDir, exeFile + + + +class StrelkaGermlineWorkflowOptions(StrelkaSharedWorkflowOptionsBase) : + + def workflowDescription(self) : + return """Version: %s + +This script configures Strelka germline small variant calling. +You must specify an alignment file (BAM or CRAM) for at least one sample. +""" % (workflowVersion) + + + def addWorkflowGroupOptions(self,group) : + group.add_option("--bam", type="string",dest="bamList",metavar="FILE", action="append", + help="Sample BAM or CRAM file. May be specified more than once, multiple inputs will be treated as each BAM file representing a different sample. [required] (no default)") + group.add_option("--ploidy", type="string", dest="ploidyFilename", metavar="FILE", + help="Provide ploidy file in VCF. The VCF should include one sample column per input sample labeled with the same sample names found in the input BAM/CRAM RG header sections." + " Ploidy should be provided in records using the FORMAT/CN field, which are interpreted to span the range [POS+1, INFO/END]. Any CN value besides 1 or 0 will be treated as 2." + " File must be tabix indexed. (no default)") + group.add_option("--noCompress", type="string", dest="noCompressBed", metavar="FILE", + help="Provide BED file of regions where gVCF block compression is not allowed. File must be bgzip-compressed/tabix-indexed. (no default)") + group.add_option("--callContinuousVf", type="string", dest="callContinuousVf", metavar="CHROM", action="append", + help="Call variants on CHROM without a ploidy prior assumption, issuing calls with continuous variant frequencies (no default)") + group.add_option("--rna", dest="isRNA", action="store_true", + help="Set options for RNA-Seq input.") + + StrelkaSharedWorkflowOptionsBase.addWorkflowGroupOptions(self,group) + + + def addExtendedGroupOptions(self,group) : + # note undocumented library behavior: "dest" is optional, but not including it here will + # cause the hidden option to always print + group.add_option("--disableSequenceErrorEstimation", dest="isEstimateSequenceError", action="store_false", + help="Disable estimation of sequence error rates from data.") + group.add_option("--useAllDataForSequenceErrorEstimation", dest="isErrorEstimationFromAllData", action="store_true", + help="Instead of sampling a subset of data for error estimation, use all data from sufficiently large chromosomes." + " This could greatly increase the workflow's runtime.") + + StrelkaSharedWorkflowOptionsBase.addExtendedGroupOptions(self,group) + + + def getOptionDefaults(self) : + + self.configScriptDir=scriptDir + defaults=StrelkaSharedWorkflowOptionsBase.getOptionDefaults(self) + + libexecDir=defaults["libexecDir"] + + configDir=os.path.abspath(os.path.join(scriptDir,"../share/config")) + assert os.path.isdir(configDir) + + defaults.update({ + 'runDir' : 'StrelkaGermlineWorkflow', + 'strelkaGermlineBin' : joinFile(libexecDir,exeFile("starling2")), + 'bgzip9Bin' : joinFile(libexecDir, exeFile("bgzip9")), + 'configDir' : configDir, + 'germlineSnvScoringModelFile' : joinFile(configDir,'germlineSNVScoringModels.json'), + 'germlineIndelScoringModelFile' : joinFile(configDir,'germlineIndelScoringModels.json'), + 'rnaSnvScoringModelFile' : joinFile(configDir,'RNASNVScoringModels.json'), + 'rnaIndelScoringModelFile' : joinFile(configDir,'RNAIndelScoringModels.json'), + 'callContinuousVf' : [], + 'getCountsBin' : joinFile(libexecDir,exeFile("GetSequenceAlleleCounts")), + 'mergeCountsBin' : joinFile(libexecDir,exeFile("MergeSequenceAlleleCounts")), + 'estimateVariantErrorRatesBin' : joinFile(libexecDir,exeFile("EstimateVariantErrorRates")), + 'thetaParamFile' : joinFile(configDir,'theta.json'), + 'indelErrorRateDefault' : joinFile(configDir,'indelErrorModel.json'), + 'isEstimateSequenceError' : True, + 'isErrorEstimationFromAllData' : False + }) + return defaults + + + def validateAndSanitizeOptions(self,options) : + + StrelkaSharedWorkflowOptionsBase.validateAndSanitizeOptions(self,options) + + options.ploidyFilename = checkFixTabixIndexedFileOption(options.ploidyFilename,"ploidy file") + options.noCompressBed = checkFixTabixIndexedFileOption(options.noCompressBed,"no-compress bed") + if options.snvScoringModelFile is None : + if options.isRNA : + options.snvScoringModelFile = options.rnaSnvScoringModelFile + else : + options.snvScoringModelFile = options.germlineSnvScoringModelFile + + if options.indelScoringModelFile is None : + if options.isRNA : + options.indelScoringModelFile = options.rnaIndelScoringModelFile + else : + options.indelScoringModelFile = options.germlineIndelScoringModelFile + + # Disable dynamic error estimation for Exome + if options.isExome : + options.isEstimateSequenceError = False + + # Disable dynamic error estimation for RNA + if options.isRNA : + options.isEstimateSequenceError = False + + groomBamList(options.bamList,"input") + + def safeLen(x) : + if x is None : return 0 + return len(x) + + if safeLen(options.bamList) == 0 : + raise OptParseException("No input sample alignment files specified") + + bamSetChecker = BamSetChecker() + bamSetChecker.appendBams(options.bamList,"Input") + bamSetChecker.check(options.htsfileBin, options.referenceFasta) + + + +def main() : + + primarySectionName="StrelkaGermline" + options,iniSections=StrelkaGermlineWorkflowOptions().getRunOptions(primarySectionName, version=workflowVersion) + + # we don't need to instantiate the workflow object during configuration, + # but this is done here to trigger additional parameter validation: + # + StrelkaGermlineWorkflow(options) + + # generate runscript: + # + ensureDir(options.runDir) + workflowScriptPath = os.path.join(options.runDir, options.workflowScriptName) + + makeRunScript(workflowScriptPath,os.path.join(workflowDir,"strelkaGermlineWorkflow.py"),"StrelkaGermlineWorkflow",primarySectionName,iniSections) + + notefp=sys.stdout + notefp.write(""" +Successfully created workflow run script. +To execute the workflow, run the following script and set appropriate options: + +%s +""" % (workflowScriptPath)) + + +if __name__ == "__main__" : + main() diff --git a/inst/extdata/strelka/configureStrelkaSomaticWorkflow.py b/inst/extdata/strelka/configureStrelkaSomaticWorkflow.py new file mode 100755 index 0000000..a5634fe --- /dev/null +++ b/inst/extdata/strelka/configureStrelkaSomaticWorkflow.py @@ -0,0 +1,161 @@ +#!/usr/bin/env python2 +# +# Strelka - Small Variant Caller +# Copyright (c) 2009-2018 Illumina, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +# + +""" +This script configures the Strelka somatic small variant calling workflow +""" + +import os,sys + +if sys.version_info >= (3,0): + import platform + raise Exception("Strelka does not currently support python3 (version %s detected)" % (platform.python_version())) + +if sys.version_info < (2,6): + import platform + raise Exception("Strelka requires python2 version 2.6+ (version %s detected)" % (platform.python_version())) + + +scriptDir='/home/dingjia/.local/share/R/blit/appmamba/envs/strelka/share/strelka-2.9.10-2/bin' +scriptName=os.path.basename(__file__) +workflowDir='/home/dingjia/.local/share/R/blit/appmamba/envs/strelka/share/strelka-2.9.10-2/lib/python' +templateConfigDir=os.path.abspath(os.path.join(scriptDir,'../share/config')) + +sys.path.append(workflowDir) + +from configBuildTimeInfo import workflowVersion +from strelkaSharedOptions import StrelkaSharedWorkflowOptionsBase +from configureUtil import BamSetChecker, groomBamList, OptParseException, joinFile, \ + checkFixTabixListOption, validateFixExistingFileArg +from makeRunScript import makeRunScript +from strelkaSomaticWorkflow import StrelkaSomaticWorkflow +from workflowUtil import ensureDir, exeFile + + + +class StrelkaSomaticWorkflowOptions(StrelkaSharedWorkflowOptionsBase) : + + def workflowDescription(self) : + return """Version: %s + +This script configures Strelka somatic small variant calling. +You must specify an alignment file (BAM or CRAM) for each sample of a matched tumor-normal pair. +""" % (workflowVersion) + + + def addWorkflowGroupOptions(self,group) : + group.add_option("--normalBam", type="string",dest="normalBamList",metavar="FILE", action="append", + help="Normal sample BAM or CRAM file. (no default)") + group.add_option("--tumorBam","--tumourBam", type="string",dest="tumorBamList",metavar="FILE", action="append", + help="Tumor sample BAM or CRAM file. [required] (no default)") + group.add_option("--outputCallableRegions", dest="isOutputCallableRegions", action="store_true", + help="Output a bed file describing somatic callable regions of the genome") + + StrelkaSharedWorkflowOptionsBase.addWorkflowGroupOptions(self,group) + + + def addExtendedGroupOptions(self,group) : + group.add_option("--noiseVcf", type="string",dest="noiseVcfList",metavar="FILE", action="append", + help="Noise vcf file (submit argument multiple times for more than one file)") + + StrelkaSharedWorkflowOptionsBase.addExtendedGroupOptions(self,group) + + + def getOptionDefaults(self) : + + self.configScriptDir=scriptDir + defaults=StrelkaSharedWorkflowOptionsBase.getOptionDefaults(self) + + libexecDir=defaults["libexecDir"] + + configDir=os.path.abspath(os.path.join(scriptDir,"../share/config")) + assert os.path.isdir(configDir) + + defaults.update({ + 'runDir' : 'StrelkaSomaticWorkflow', + 'strelkaSomaticBin' : joinFile(libexecDir,exeFile("strelka2")), + 'minTier2Mapq' : 0, + 'snvScoringModelFile' : joinFile(configDir,'somaticSNVScoringModels.json'), + 'indelScoringModelFile' : joinFile(configDir,'somaticIndelScoringModels.json'), + 'isOutputCallableRegions' : False, + 'noiseVcfList' : None + }) + return defaults + + + def validateAndSanitizeOptions(self,options) : + + StrelkaSharedWorkflowOptionsBase.validateAndSanitizeOptions(self,options) + + checkFixTabixListOption(options.noiseVcfList,"noise vcf") + + groomBamList(options.normalBamList,"normal sample") + groomBamList(options.tumorBamList, "tumor sample") + + def checkRequired(bamList,label): + if (bamList is None) or (len(bamList) == 0) : + raise OptParseException("No %s sample BAM/CRAM files specified" % (label)) + + checkRequired(options.tumorBamList,"tumor") + + bamSetChecker = BamSetChecker() + + def singleAppender(bamList,label): + if bamList is None : return + if len(bamList) > 1 : + raise OptParseException("More than one %s sample BAM/CRAM files specified" % (label)) + bamSetChecker.appendBams(bamList,label) + + singleAppender(options.normalBamList,"normal") + singleAppender(options.tumorBamList,"tumor") + bamSetChecker.check(options.htsfileBin, + options.referenceFasta) + + + +def main() : + + primarySectionName="StrelkaSomatic" + options,iniSections=StrelkaSomaticWorkflowOptions().getRunOptions(primarySectionName, + version=workflowVersion) + + # we don't need to instantiate the workflow object during configuration, + # but this is done here to trigger additional parameter validation: + # + StrelkaSomaticWorkflow(options) + + # generate runscript: + # + ensureDir(options.runDir) + workflowScriptPath = os.path.join(options.runDir, options.workflowScriptName) + + makeRunScript(workflowScriptPath,os.path.join(workflowDir,"strelkaSomaticWorkflow.py"),"StrelkaSomaticWorkflow",primarySectionName,iniSections) + + notefp=sys.stdout + notefp.write(""" +Successfully created workflow run script. +To execute the workflow, run the following script and set appropriate options: + +%s +""" % (workflowScriptPath)) + + +if __name__ == "__main__" : + main() diff --git a/man/allele_counter.Rd b/man/allele_counter.Rd index 1d2fa45..86bc57f 100644 --- a/man/allele_counter.Rd +++ b/man/allele_counter.Rd @@ -54,12 +54,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/bcftools.Rd b/man/bcftools.Rd index fd249fb..e19bcee 100644 --- a/man/bcftools.Rd +++ b/man/bcftools.Rd @@ -44,12 +44,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/bedtools.Rd b/man/bedtools.Rd index e85eb08..fd62904 100644 --- a/man/bedtools.Rd +++ b/man/bedtools.Rd @@ -41,12 +41,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/bowtie2.Rd b/man/bowtie2.Rd index a103f2d..2bf9c34 100644 --- a/man/bowtie2.Rd +++ b/man/bowtie2.Rd @@ -50,12 +50,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/bwa.Rd b/man/bwa.Rd index 908161b..fd0dbaf 100644 --- a/man/bwa.Rd +++ b/man/bwa.Rd @@ -56,12 +56,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/cellranger.Rd b/man/cellranger.Rd index 8b51c7e..af2928b 100644 --- a/man/cellranger.Rd +++ b/man/cellranger.Rd @@ -58,12 +58,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/conda.Rd b/man/conda.Rd index 6ca35db..759df0b 100644 --- a/man/conda.Rd +++ b/man/conda.Rd @@ -39,12 +39,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/exec.Rd b/man/exec.Rd index 32bc558..4771fb9 100644 --- a/man/exec.Rd +++ b/man/exec.Rd @@ -38,8 +38,10 @@ Invoke a System Command \item \code{\link[=samtools]{samtools()}} \item \code{\link[=seqkit]{seqkit()}} \item \code{\link[=snpEff]{snpEff()}} +\item \code{\link[=strelka]{strelka()}} \item \code{\link[=trust4]{trust4()}} \item \code{\link[=varscan]{varscan()}} +\item \code{\link[=minimap2]{minimap2()}} } } diff --git a/man/fastp.Rd b/man/fastp.Rd index 4546142..6e9a10d 100644 --- a/man/fastp.Rd +++ b/man/fastp.Rd @@ -43,12 +43,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/fastq_pair.Rd b/man/fastq_pair.Rd index ebd9fbf..a684af0 100644 --- a/man/fastq_pair.Rd +++ b/man/fastq_pair.Rd @@ -64,12 +64,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/gistic2.Rd b/man/gistic2.Rd index a1f8c0f..d035b02 100644 --- a/man/gistic2.Rd +++ b/man/gistic2.Rd @@ -61,12 +61,14 @@ Other \code{commands}: \code{\link{fastq_pair}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/kraken2.Rd b/man/kraken2.Rd index c67271a..174cf5f 100644 --- a/man/kraken2.Rd +++ b/man/kraken2.Rd @@ -67,12 +67,14 @@ Other \code{commands}: \code{\link{fastq_pair}()}, \code{\link{gistic2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/kraken_tools.Rd b/man/kraken_tools.Rd index 813ad80..fe9bed6 100644 --- a/man/kraken_tools.Rd +++ b/man/kraken_tools.Rd @@ -43,12 +43,14 @@ Other \code{commands}: \code{\link{fastq_pair}()}, \code{\link{gistic2}()}, \code{\link{kraken2}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/minimap2.Rd b/man/minimap2.Rd new file mode 100644 index 0000000..5e4ec9e --- /dev/null +++ b/man/minimap2.Rd @@ -0,0 +1,67 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/minimap2.R +\name{minimap2} +\alias{minimap2} +\title{Run minimap2} +\usage{ +minimap2(method, ref, reads, ofile, ..., minimap2 = NULL) +} +\arguments{ +\item{method}{Mapping preset: "map-ont" (single-end long reads) or "sr" (paired-end short reads).} + +\item{ref}{Path to the reference genome FASTA file.} + +\item{reads}{A character vector of FASTQ files used as input to minimap2.} + +\item{ofile}{A string of path to the output SAM file.} + +\item{...}{<\link[rlang:dyn-dots]{dynamic dots}> Additional arguments passed to \code{minimap2} 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(minimap2())}.} + +\item{minimap2}{A string of path to \code{minimap2} command.} +} +\value{ +A \code{command} object. +} +\description{ +Minimap2 is a versatile sequence alignment program that aligns DNA or mRNA sequences against a large reference database. +Typical use cases include: +(1) mapping PacBio or Oxford Nanopore genomic reads to the human genome; +(2) finding overlaps between long reads with error rate up to ~15\%; +(3) splice-aware alignment of PacBio Iso-Seq or Nanopore cDNA or Direct RNA reads against a reference genome; +(4) aligning Illumina single- or paired-end reads; +(5) assembly-to-assembly alignment; +(6) full-genome alignment between two closely related species with divergence below ~15\%. +} +\seealso{ +\itemize{ +\item \url{https://github.com/lh3/minimap2} +\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{bedtools}()}, +\code{\link{bowtie2}()}, +\code{\link{bwa}()}, +\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{strelka}()}, +\code{\link{trust4}()}, +\code{\link{varscan}()} +} +\concept{command} diff --git a/man/perl.Rd b/man/perl.Rd index 0b5d27a..8d8447c 100644 --- a/man/perl.Rd +++ b/man/perl.Rd @@ -41,11 +41,13 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/pyscenic.Rd b/man/pyscenic.Rd index 5fa2b6a..759fc55 100644 --- a/man/pyscenic.Rd +++ b/man/pyscenic.Rd @@ -41,11 +41,13 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/python.Rd b/man/python.Rd index b733052..3c8b62b 100644 --- a/man/python.Rd +++ b/man/python.Rd @@ -41,11 +41,13 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/samtools.Rd b/man/samtools.Rd index 7a3d4a5..0591ceb 100644 --- a/man/samtools.Rd +++ b/man/samtools.Rd @@ -43,11 +43,13 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/seqkit.Rd b/man/seqkit.Rd index 5dff545..bc96c50 100644 --- a/man/seqkit.Rd +++ b/man/seqkit.Rd @@ -41,11 +41,13 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/snpEff.Rd b/man/snpEff.Rd index c6fa9a1..07710d6 100644 --- a/man/snpEff.Rd +++ b/man/snpEff.Rd @@ -43,11 +43,13 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, +\code{\link{strelka}()}, \code{\link{trust4}()}, \code{\link{varscan}()} } diff --git a/man/strelka.Rd b/man/strelka.Rd new file mode 100644 index 0000000..ff0560c --- /dev/null +++ b/man/strelka.Rd @@ -0,0 +1,56 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/cmd-strelka.R +\name{strelka} +\alias{strelka} +\title{Run strelka} +\usage{ +strelka(script, ...) +} +\arguments{ +\item{script}{Name of the Strelka script. One of +\code{"configureStrelkaGermlineWorkflow"}, \code{"configureStrelkaSomaticWorkflow"}, and \code{"runWorkflow"}.} + +\item{...}{<\link[rlang:dyn-dots]{dynamic dots}> Additional arguments passed to \code{strelka} 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(strelka())}.} + +\item{strelka}{A string of path to \code{strelka} command.} +} +\value{ +A \code{command} object. +} +\description{ +Strelka is a fast and accurate small variant caller optimized for analysis of germline variation +in small cohorts and somatic variation in tumor/normal sample pairs. +} +\seealso{ +\itemize{ +\item \url{https://github.com/Illumina/strelka} +\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{bedtools}()}, +\code{\link{bowtie2}()}, +\code{\link{bwa}()}, +\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{minimap2}()}, +\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/trust4.Rd b/man/trust4.Rd index 3956a32..4703ce7 100644 --- a/man/trust4.Rd +++ b/man/trust4.Rd @@ -96,12 +96,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{varscan}()} } \concept{command} diff --git a/man/varscan.Rd b/man/varscan.Rd index 6c949eb..4f2f3b2 100644 --- a/man/varscan.Rd +++ b/man/varscan.Rd @@ -43,12 +43,14 @@ Other \code{commands}: \code{\link{gistic2}()}, \code{\link{kraken2}()}, \code{\link{kraken_tools}()}, +\code{\link{minimap2}()}, \code{\link{perl}()}, \code{\link{pyscenic}()}, \code{\link{python}()}, \code{\link{samtools}()}, \code{\link{seqkit}()}, \code{\link{snpEff}()}, +\code{\link{strelka}()}, \code{\link{trust4}()} } \concept{command} diff --git a/tests/testthat/test-exec.R b/tests/testthat/test-exec.R index e325bef..145765f 100644 --- a/tests/testthat/test-exec.R +++ b/tests/testthat/test-exec.R @@ -130,3 +130,13 @@ testthat::test_that("`bowtie2()` works as expected", { testthat::skip_if_not(nzchar(Sys.which("bowtie2"))) bowtie2() |> cmd_help() }) + +testthat::test_that("`strelka()` works as expected", { + testthat::skip_if_not(nzchar(Sys.which("strelka"))) + strelka() |> cmd_help() +}) + +testthat::test_that("`minimap2()` works as expected", { + testthat::skip_if_not(nzchar(Sys.which("strelka"))) + strelka() |> cmd_help() +})