uniquesToFasta: Write a uniques vector to a FASTA file

Description Usage Arguments Value Examples

View source: R/sequenceIO.R

Description

A wrapper for writeFastq in the ShortRead package. Default output format is compatible with uchime.

Usage

1
uniquesToFasta(unqs, fout, ids = NULL, mode = "w", width = 20000, ...)

Arguments

unqs

(Required). A uniques-vector or any object that can be coerced into one with getUniques.

fout

(Required). The file path of the output file.

ids

(Optional). character. Default NULL. A vector of sequence ids, one for each element in unqs. If NULL, a uchime-compatible ID is assigned.

mode

(Optional). Default "w". Passed on to writeFasta indicating the type of file writing mode. Default is "w".

width

(Optional). Default 20000. The number of characters per line in the file. Default is effectively one line per sequence. Passed on to writeFasta.

...

Additional parameters passed on to writeFasta.

Value

NULL.

Examples

1
2
3
4
derep1 = derepFastq(system.file("extdata", "sam1F.fastq.gz", package="dada2"))
outfile <- tempfile(fileext=".fasta")
uniquesToFasta(derep1, outfile)
uniquesToFasta(derep1, outfile, ids=paste0("Sequence", seq(length(getSequences(derep1)))))

dada2 documentation built on Nov. 8, 2020, 6:48 p.m.