Description Usage Arguments Value Examples
This function counts the number of reads in samples present in the specified folder. Useful if you don't have the info (e.g. generated by stacks process_radtags), and you want to check the distribution in the number of reads between samples.
1 2 3 4 5 6 7 8 | read_counter(
path.samples,
recursive = FALSE,
strata = NULL,
plot.reads = TRUE,
write = TRUE,
parallel.core = parallel::detectCores() - 1
)
|
path.samples |
(character, path) Path of folder containing the samples to count reads |
recursive |
(logical) Should the listing recurse into the directory?
e.g. when |
strata |
(optional)
The strata file is a tab delimited file with 2 columns headers:
|
plot.reads |
With default |
write |
With default |
parallel.core |
(optional) The number of core for parallel computing.
By default: |
a list with a data frame with the sample id and the number of reads. If option to generate figures was selected, the list also returns 2 figures (see example below)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ## Not run:
library(stackr)
# To run this function, bioconductor \code{ShortRead} package is necessary:
source("http://bioconductor.org/biocLite.R")
biocLite("ShortRead")
# Using OpenMP threads
nthreads <- .Call(ShortRead:::.set_omp_threads, 1L)
on.exit(.Call(ShortRead:::.set_omp_threads, nthreads))
# with defaults
read.info <- stackr::read_counter(path.samples = "corals")
# to extract info from the list
reads = read.info$reads
reads.distribution <- read.info$reads.distribution
reads.boxplot <- read.info$reads.boxplot
# If the default figures saved were not good, save with new width and height
# the histogram
ggplot2::ggsave(
filename = "reads.distribution.pdf",
plot = reads.distribution,
width = 15, height = 15,
dpi = 600, units = "cm", useDingbats = FALSE, limitsize = FALSE)
# the boxplot
ggplot2::ggsave(
filename = "reads.boxplot.pdf",
plot = reads.boxplot,
width = 15, height = 15,
dpi = 600, units = "cm", useDingbats = FALSE, limitsize = FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.