table2fasta: Write unique sequences to a fasta file for each sample where...

View source: R/table2fasta.R

table2fastaR Documentation

Write unique sequences to a fasta file for each sample where sequence names match the sequence table and include abundance data

Description

table2fasta takes the output from makeSequenceTable or the table element from data.proc as input and generates a fasta file for each sample with unique sequences. It uses internally uniquesToFasta. However, sequences are named with a sequential number, which is consistent across all samples and abundance data is appended to the sequence names.

Usage

table2fasta(stable, seq.list = NULL, dir.out = NULL, verbose = TRUE)

Arguments

stable

The sequence table (output of dada2::makeSequenceTable) or data.proc

seq.list

The seq_list element from data.proc. Required if the input table is the output from data.proc. If NULL (default), it is assumed that the input table is from dada2::makeSequenceTable and sequences are named with a seq# pattern, where # is a sequential number respect to the sequence in the table.

dir.out

The directory where to save fasta files

verbose

Logical. Whether information on progress should be outputted (default: TRUE)

Details

The input can be either the makeSequenceTable or data.proc output. Note that data.proc output is actually a modified makeSequenceTable output where the column names, which normally are the actual sequeces, have been replaced for convinience. data.proc reports the sequence IDs and matching sequences in a separated elelment of the returned list. If the input is from data.proc, then also the seq_list element needs to be passed to table2fasta.

In each file, sequences are named with a sequential number, which is consistent across all samples. For example, if sample1 has sequence seq1 and seq2 and sample2 has seq1 and seq3, the sequences in the fasta file for sample1 will be named seq1 and seq2, and those in the fasta file for sample2 will be named seq1 and seq3, so that it will be possible to match back the same sequences in different samples in down stream analysis.

Value

A fasta file for each sample

See Also

data.proc, uniquesToFasta, makeSequenceTable


carlopacioni/amplicR documentation built on Aug. 19, 2023, 7:59 p.m.