View source: R/cluster_reads.R
| cluster_reads | R Documentation |
Cluster marker-gene reads into similarity-threshold OTUs and assemble
them into a phyloseq::phyloseq-class() object with an otu_table of
per-sample abundances and the representative (seed/centroid) sequence of
each OTU in the refseq slot: reads are dereplicated per sample with
vsearch, pooled, dereplicated
again, and clustered with vsearch (--cluster_size, default) or
SWARM (d > 1 recommended).
This complements asv2otu(), which post-clusters ASVs already stored in
a phyloseq object: cluster_reads() starts one step earlier, directly
from sequence files or a vector of DNA sequences. Use denoised_reads()
instead of this function to denoise reads into ASVs/zOTUs (dada2
pipeline, SWARM d = 1 or vsearch UNOISE).
cluster_reads(
path_to_fastx = NULL,
dna_seq = NULL,
sample_name = "sample_1",
method = c("vsearch", "swarm"),
id = 0.97,
d = 1,
fastidious = TRUE,
minsize = 1,
nproc = 1,
vsearchpath = find_vsearch(),
swarmpath = "swarm",
vsearch_args = "--strand both",
swarm_args = "",
keep_temporary_files = FALSE
)
path_to_fastx |
(character) Path(s) to fasta or fastq files
(optionally gzipped). Each file is treated as one sample; the sample
name is the basename stripped of its extension. Set either
|
dna_seq |
A named character vector or
|
sample_name |
(default: |
method |
(default: |
id |
(default: 0.97) Identity threshold for vsearch clustering. |
d |
(default: 1) SWARM resolution. |
fastidious |
(logical, default: TRUE) Use SWARM fastidious mode.
Ignored when |
minsize |
(default: 1) Discard dereplicated sequences with an
abundance strictly lower than |
nproc |
(default: 1) Number of threads for the clustering tool. |
vsearchpath |
(default: |
swarmpath |
(default: |
vsearch_args |
(default: |
swarm_args |
(default: |
keep_temporary_files |
(logical, default: FALSE) Keep the dereplicated fasta files, the pooled fasta, the cluster table and the representative-sequences fasta in a temporary directory. |
vsearch is required (per-sample and pool-level dereplication, and
clustering for method = "vsearch"); swarm is additionally required for
method = "swarm". Use is_vsearch_installed() and
is_swarm_installed() to check availability. This function is mainly a
wrapper of the work of others: please cite
vsearch
(\Sexpr[results=rd]{tools:::Rd_expr_doi("10.7717/peerj.2584")}) and/or
SWARM
(\Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/bioinformatics/btab493")}).
A phyloseq::phyloseq-class() object with one row (taxon) per
OTU named OTU_1, OTU_2, ... ordered by decreasing total abundance,
one column (sample) per input file, the representative sequence of each
OTU in the refseq slot, and (for file input) the source file paths in
the sample_data slot.
Adrien Taudière
denoised_reads(), asv2otu(), swarm_clustering(),
vsearch_clustering(), find_vsearch(), install_vsearch()
f1 <- system.file("extdata", "ex_R1_001.fasta", package = "MiscMetabar")
f2 <- system.file("extdata", "ex_R1_002.fasta", package = "MiscMetabar")
(pq_otu <- cluster_reads(path_to_fastx = c(f1, f2)))
cluster_reads(path_to_fastx = c(f1, f2), method = "swarm", d = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.