View source: R/prepareTximportFiles.R
prepareTximportFiles | R Documentation |
Prepare quant files for tximport
prepareTximportFiles(
dir,
type = c("salmon", "kallisto"),
makeNames = c("makeNames", "snakeCase", "camelCase")
)
dir |
|
type |
|
makeNames |
|
Runs the following internal comments:
Extract sample directory name from quant file using
dirname()
and basename()
.
Autopad zeros, if necessary, via
autopadZeros()
.
Sanitizes names with snakeCase()
.
Sorts files alphabetically.
character
.
Return quant file paths, with valid sample names automatically applied.
Updated 2023-07-13.
tximport vignette
suppressPackageStartupMessages({
library(AcidBase)
})
tempdir <- tempdir2()
samples <- c("1-sample-A", "2-sample-B")
salmonDir <- initDir(file.path(tempdir, "salmon"))
kallistoDir <- initDir(file.path(tempdir, "kallisto"))
invisible({
lapply(X = file.path(salmonDir, samples), FUN = initDir)
file.create(file.path(salmonDir, samples, "quant.sf"))
lapply(X = file.path(kallistoDir, samples), FUN = initDir)
file.create(file.path(kallistoDir, samples, "abundance.h5"))
})
salmonFiles <- prepareTximportFiles(dir = salmonDir, type = "salmon")
print(salmonFiles)
kallistoFiles <- prepareTximportFiles(dir = kallistoDir, type = "kallisto")
print(kallistoFiles)
unlink2(tempdir)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.