reads_length_distribution: Generate the read length distribution of a fastq file

Description Usage Arguments Details Value Examples

View source: R/reads_length_distribution.R

Description

This function reads the fastq file of an individual, lane or chip and generate the read length distribution to help decide the threshold to cut the reads to a specific length.

Usage

1
2
3
4
5
reads_length_distribution(
  fq.file,
  parallel.core = parallel::detectCores() - 1,
  with.future = FALSE
)

Arguments

fq.file

(character, path). The path to the fastq file (individal, lane or chip). Default: fq.file = "my-sample.fq.gz".

parallel.core

(integer) Enable parallel execution with the number of threads. Default: parallel.core = parallel::detectCores() - 1.

with.future

(logical) When TRUE will use future package to run the code in parallel. Set parallel.core to the number of physical, not logical, cores. See example below. Default: with.future = FALSE.

Details

coming soon, just try it in the meantime...

Value

The function returns a plot and a tibble with potential reads length thresholds and associated number of reads.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
require(ShortRead)
reads.length.info <- stackr::reads_length_distribution(
  fq.file = "my-sample.fq.gz")

 # with future package to get faster results:
 require(future)
 require(listenv)
 reads.length.info <- stackr::reads_length_distribution(
  fq.file = "my-sample.fq.gz",
  with.future = TRUE
  )

## End(Not run)

thierrygosselin/stackr documentation built on Nov. 11, 2020, 11 a.m.