View source: R/scAPAtrap_funlib.R
scAPAtrap | R Documentation |
Wrapper function for one-step running of scAPAtrap
scAPAtrap(tools, trap.params, inputBam, outputDir, ...)
tools |
A list contains four tools used in scAPAtrap. |
trap.params |
Parameters of running scAPAtrap, see global variable |
inputBam |
Input bam file name. If trap.params$chr is NULL, will try to get chrs from inputBam. |
outputDir |
Output dir for storing scAPAtrap's final output – peaks and counts files. If only dirname is given (e.g., APAres but not ./APAres), then will add path of inputBam to the dir name. If outputDir already exists, an error will be raised to avoid overwritting. However, many temporary files are generated during running scAPAtrap, which could be seen from global variable TRAPFILES. Those files marked with * could be savely deleted. |
... |
Arguments passed to other methods and/or advanced arguments. Advanced arguments:
|
A file name storing scAPAtrapData object, which is <outputDir>/scAPAtrapData.rda
## Not run:
tools=list(samtools='/home/dell/miniconda3/envs/scAPA/bin/samtools',
umitools='/home/dell/miniconda3/envs/scAPA/bin/umi_tools',
featureCounts="/home/dell/miniconda3/envs/scAPA/bin/featureCounts",
star='/home/dell/miniconda3/envs/scAPA/bin/STAR')
trap.params=TRAP.PARAMS()
trap.params$chrs=c('2L','2R','3L','3R','4','X','Y')
## input BAM
dir0='/mnt/64cf3476-350c-46ad-bc48-574fa64a0334/test/xwu/dataFly/'
inputBam=paste0(dir0, "filterCB.bam")
## log file
logf=gsub('.bam', '.scAPAtrap.log', inputBam, fixed=TRUE)
unlink(logf)
## barcode (if have)
barcodefile <- paste0(dir0, 'barcode.17.txt')
barcode <- utils::read.delim2(barcodefile, header = FALSE)
barcode <- gsub('-[0-9]','',barcode$V1)
## add barcode to trap.params
trap.params$barcode=barcode
## output dir (will be under inputBam's dir)
outputDir="APA.result"
## one step scAPAtrap
scAPAtrap(tools=tools, trap.params=trap.params,
inputBam=inputBam, outputDir=outputDir, logf=logf)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.