splitDVDreads: Select DVD reads from a set of Nanopore reads and split the...

Description Usage Arguments Value Author(s) Examples

View source: R/splitDVDreads.R

Description

The function does the following:

By default, if alignemnt to the host genome is provided in the ReadClass object (column HostAlign), then the selected DVD reads are selected to not show any significant alignment to the host genome

Usage

1
2
3
4
5
6
7
8
splitDVDreads(
  ReadClass = NULL,
  blastvec = NULL,
  FastaFile = NULL,
  WithGeneA = NULL,
  WithGeneB = NULL,
  MinDNAlength = 10000L
)

Arguments

ReadClass

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

blastvec

Either a table imported with readBlast or a path to a blast file obtained by aligning th evectors on the reads and using -outfmt 6

FastaFile

Either a DNAStringSet object containing the full read sequences or a path to a fasta file containing these sequences

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

MinDNAlength

Integer. Minimum length of the DNA fragment to keep the reads in the results

Value

A list with:

Note that reads with alignment on the opposite strand of the vector ("-" strand) are automatically reverse complemented If no reads are selected, the function returns NULL and a warning.

Author(s)

Pascal GP Martin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## For simplicity (and to limit file size) we only keep the data for 5 pre-selected DVD reads
## Path to file (.rds) created with the AnnotateBACreads function
pathRC <- system.file("extdata", "BAC02_ReadClass.rds", package = "NanoBAC")
RC <- readRDS(pathRC)
selectedReads <- c("BAC02R5572", "BAC02R21438", "BAC02R1152",
                   "BAC02R20794", "BAC02R6278" )
RC <- RC[RC$ReadName %in% selectedReads,]
## Path to a fasta file containing the sequence of the 5 DVD reads
pathFasta <- system.file("extdata", "BAC02_5DVDreads.fa", package = "NanoBAC")
## Path to the file containing the result from the Blast alignment of the vector on the reads
pathBlast <- system.file("extdata", "BAC02_BlastVector.res", package = "NanoBAC")
## Select DVD reads and split the reads
myDVDreads <- splitDVDreads(ReadClass = RC,
                            blastvec = pathBlast,
                            FastaFile = pathFasta,
                            WithGeneA = TRUE,
                            WithGeneB = TRUE,
                            MinDNAlength = 35000)
## Read sequences:
myDVDreads$ReadSequence
## Read definitions:
myDVDreads$ReadDefinition

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