stitch {insect} | R Documentation |
Paired-end read stitching.
Description
This function aligns forward and reverse reads generated from a 2x amplicon sequencing platform, and produces a consensus sequence with maximum base-call quality scores attached as "quality" attributes.
Usage
stitch(x, y, up = NULL, down = NULL, mindiff = 6, minoverlap = 16)
Arguments
x , y |
DNAbin objects with quality attributes (see |
up , down |
forward and reverse primer sequences (either as concatenated character strings or "DNAbin" objects). Either both or neither should be provided (not one or the other). |
mindiff |
the minimum difference in quality between two different base calls for the higher quality call to be added to the consensus alignment. In cases where the quality differences are less than this threshold, the ambiguity code "N" is added to the consensus sequence. Defaults to 6. |
minoverlap |
integer giving the minimum number of nucleotides that should be shared between the forward and reverse sequence alignments. Defaults to 16. |
Value
a "DNAbin" object or a vector of concatenated character strings, depending on the input.
Author(s)
Shaun Wilkinson
See Also
Examples
## download and extract example FASTQ file to temporary directory
td <- tempdir()
URL <- "https://www.dropbox.com/s/71ixehy8e51etdd/insect_tutorial1_files.zip?dl=1"
dest <- paste0(td, "/insect_tutorial1_files.zip")
download.file(URL, destfile = dest, mode = "wb")
unzip(dest, exdir = td)
x <- readFASTQ(paste0(td, "/COI_sample1_read1.fastq"), bin = FALSE)
y <- readFASTQ(paste0(td, "/COI_sample1_read2.fastq"), bin = FALSE)
z <- stitch(x, y)
z[1]
attr(z, "quality")[1]