selectVDVreads: Select VDV reads from a set of Nanopore reads

Description Usage Arguments Value Author(s) Examples

View source: R/selectVDVreads.R

Description

The function does the following:

By default, if alignment to the host genome is provided in the ReadClass object (column HostAlign), then the selected VDV reads do not align to the host genome. The function allows the user to exclude reads from the analysis.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
selectVDVreads(
  ReadClass = NULL,
  SizeTolerance = 0.05,
  WithGeneA = NULL,
  WithGeneB = NULL,
  ignoredReads = NULL,
  MaxClusters = 10L,
  makePlot = TRUE,
  plotVar = c("ReadLength", "InsertLength")
)

Arguments

ReadClass

Either a tibble obtained with the AnnotateBACreads function or a path to an rds file containing such a file

SizeTolerance

A single number in [0,1[. Reads with a size corresponding to the estimated size +/- SizeTolerance% are selected

WithGeneA

Logical. Should the VDV reads align with GeneA? Default is NULL, i.e. no filtering on GeneA alignment

WithGeneB

Logical. Should the VDV reads align with GeneB? Default is NULL, i.e. no filtering on GeneB alignment

ignoredReads

(optional) vector of read names that should be ignored.

MaxClusters

Integer. Maximum number of clusters to make with VDV reads to estimate the size of the DNA insert. Default to 10 which in our hands works in most situations.

makePlot

Logical. Should a plot be produced (and saved in the result)

plotVar

Character string. Variable to plot: either 'ReadLength' or InsertLength.

Value

A list with the following objects:

if makePlot is TRUE, then the list also contains:

Author(s)

Pascal GP Martin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Path to file (.rds) created with the AnnotateBACreads function
pathRC <- system.file("extdata", "BAC02_ReadClass.rds", package = "NanoBAC")
## Import the data
annotatedReads <- readRDS(pathRC)
## Select VDV reads that contain alignment to GeneA and GeneB
myVDVreads <- selectVDVreads(ReadClass = annotatedReads,
                             WithGeneA = TRUE,
                             WithGeneB = TRUE)
## Same but making less clusters and producing a plot on insert length rather than read length
myVDVreads <- selectVDVreads(ReadClass = annotatedReads,
                             WithGeneA = TRUE,
                             WithGeneB = TRUE,
                             MaxClusters = 8,
                             plotVar = "InsertLength")

pgpmartin/NanoBAC documentation built on Dec. 11, 2020, 9:51 a.m.