collate.seqs | R Documentation |
collate.seqs
can be used to collate together outputs from
data.proc
.
collate.seqs(ldproc = NULL, rdas.in = NULL, dir.out = NULL)
ldproc |
If the data are already in R memory, a list whose element are
|
rdas.in |
If |
dir.out |
The directory where to save the results. If NULL (default) then it will be set to the working directory |
This function was developed because, if, for example, sequencing runs are
carried out for the same samples, different data.proc
outputs will
also exists and you may want to collate together all the sequences from the
same sample. collate.seqs
does exactly this. By passing either the
path to, or a list of, data.proc
outputs, collate.seqs
collate
together the sequences.
collate.seqs
will generate an output that it is very similar to
data.proc
but with the combined seqs for the same samples.
Return a list with several elements:
$lbysamples: A list whose elements are vectors with the unique sequences (names) for each sample and their abundance (values).
$stable: The sequence table
$seq_list: The sequences and matching sequences IDs
$call: The function call
Several files are also saved to disk, these include:
Seq_table.csv Sequence table
Seq_list.csv List of sequences and their matching IDs
collated.rda R data file containing the list returned by collate.seqs (see above)
# Select the directory where the example data are stored
example.data <- system.file("extdata", "HTJ", package="amplicR")
# Select a temporary directory where to store the outputs
out <- tempdir()
# Run data.proc with bp=140 and save in a sub folder
out140 <- paste(out, "out140", sep="/")
HTJ.140 <- data.proc(example.data, out140, bp=140)
# Repeat the process in a different sub folder
out140bis <- paste(out, "out140bis", sep="/")
HTJ.140bis <- data.proc(example.data, out140bis, bp=140)
# Collate seqs of the two objects HTJ.140 and HTJ.140bis
# Note that the sequences are recognised to be identical and size is summed
collate.seqs(ldproc=list(HTJ.140, HTJ.140bis), dir.out=out)
# As above but using the .rda files
rdas <- paste(out, c("out140", "out140bis"), "data.proc.rda", sep="/")
collate.seqs(rdas.in=rdas, dir.out=out)
# Clean up the temp directory
unlink(out, recursive=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.