Description Usage Arguments Value Author(s) References See Also Examples
These functions take a list of DNA or amino acid sequences in
DNAbin
or AAbin
format
and outputs a text file to a specified directory.
1 2 3 |
x |
a list of sequences in |
file |
character string giving a valid file path to output the text to. If file = "" (default setting) the text file is written to the console. |
compress |
logical indicating whether the output file should be gzipped. |
append |
logical indicating whether the output should be appended to the file. |
wrap |
integer giving the maximum number of characters on each sequence line. Defaults to NULL (no wrapping). |
NULL (invisibly).
Shaun Wilkinson
Illumina help page: https://help.basespace.illumina.com/articles/descriptive/fastq-files/
readFASTQ
for reading FASTQ files into R,
and write.dna
in the ape package
for writing DNA to text in FASTA and other formats.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## 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_sample2.fastq"))
## trim primers from sequences
mlCOIintF <- "GGWACWGGWTGAACWGTWTAYCCYCC"
jgHCO2198 <- "TAIACYTCIGGRTGICCRAARAAYCA"
x <- trim(x, up = mlCOIintF, down = jgHCO2198)
## quality filter with size selection and singleton removal
x <- qfilter(x, minlength = 250, maxlength = 350)
## output filtered FASTQ file
writeFASTQ(x, file = paste0(td, "/COI_sample2_filtered.fastq"))
writeFASTA(x, file = paste0(td, "/COI_sample2_filtered.fasta"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.