dada_to_fasta: Write DADA sequences to fasta.

View source: R/dada_to_fasta.R

dada_to_fastaR Documentation

Write DADA sequences to fasta.

Description

Rename sequences to their hash values and write them to fasta file.

Usage

dada_to_fasta(seqtab, out = "DADA2.fasta", hash = "sha1", ...)

Arguments

seqtab

dada-class or derep-class objects

out

Output file name (fasta)

hash

Hash function to use: "sha1" (default), "sha256", "md5"

...

Additional parameters passed on to uniquesToFasta

Details

This function relabels sequences using diffetent message digest algorithms applied to each sequence. This approach guarantees (with a very high probability) that FASTA entries from different projects with identical names will also have identical sequences. MD5 algorithm generates a 128-bit digest that is represented by 32 hexadecimal characters. SHA1 generates a 160-bit digest that is represented by 40 hexadecimal characters. SHA256 generates a 256-bit digest that is represented by 64 hexadecimal characters. The probability of a collision (two non-identical sequences resulting in the same digest) is smaller for the SHA-algorithms than it is for the MD5 algorithm. Default hash function is SHA1 which should produce identical results with "–relabel_sha1" function of VSEARCH.

Value

Invisible returns sequence names in the VSEARCH/USEARCH style.

See Also

uniquesToFasta, getUniques

Examples

derep1 = derepFastq(system.file("extdata", "sam1F.fastq.gz", package="dada2"))
dada1 <- dada(derep1, err=tperr1)
seqtab <- getUniques(dada1)
dada_to_fasta(seqtab, out = "DADA2.fasta", hash = "sha1")


vmikk/metagMisc documentation built on June 20, 2024, 7:20 a.m.