FiltbyQ30: Filter haplotypes by Q30

View source: R/FiltbyQ30.R

FiltbyQ30R Documentation

Filter haplotypes by Q30

Description

This function applies FastqStreamer over a fastq file and removes all reads that have a defined fraction of bases below Q30. The remaining reads will be saved in a new fastq file.

Usage

FiltbyQ30(max.pct = 0.05, flashfiles, flashres, ncores = 1)

Arguments

max.pct

The maximum percentage of bases below Q30 allowed in reads (by default,5%).

flashfiles

Vector including the paths of files that are going to be processed, with fastq extension.

flashres

Table of results obtained after the execution of R1R2toFLASH function.

ncores

Number of cores to use for parallelization with mclapply.hack.

Details

This function is designed to be applied after R1R2toFLASH function from the same package. If flashres is not specified but FLASH extension was previously done, the function will try to load the FLASH results table from the reports folder.

Value

A data.frame object containing FLASH and Filtering results. This results table includes two new columns with respect to FLASH results table, named FiltQ30 (number of filtered reads) and Raw (total sequencing reads).

After the execution, a fastq file with remaining reads for each pool will be saved in a new flashFilt folder (if it is not previously created). Additionaly, two report files will be generated in a reports folder:

  1. FiltQ30.barplot.pdf: Includes a first Bar plot representing raw reads, extended reads by FLASH and filtered reads, and a second Bar plot with the yield by process for each pool.

  2. FiltQ30_report.txt: Includes the same data frame returned by the function containing FLASH and Filtering results.

Author(s)

Alicia Aranda

See Also

R1R2toFLASH, FastqStreamer

Examples

runDir <- "./run"
runfiles <- list.files(runDir,recursive=TRUE,full.names=TRUE,include.dirs=TRUE)
flash <- "./FLASH/flash.exe"
flashDir <- "./flash"
flashfiles <- list.files(flashDir,recursive=TRUE,full.names=TRUE,include.dirs=TRUE)
flashres <- R1R2toFLASH(runfiles,flash)
filtres <- FiltbyQ30(max.pct=0.05,flashfiles,flashres)

aliafdz/QApckg documentation built on June 2, 2022, 10:29 a.m.