Wrapper to fetch sequences from the seqArchR result object as character
seqs_str(res, iter = NULL, cl = NULL, ord = FALSE)
seqArchR result object
Specify the iteration of seqArchR result. If set to NULL (the default), the original set of sequences (`seqArchRresult$rawSeqs`) is returned.
Specify the cluster number. Sequences belonging to this cluster in iteration `iter` of seqArchR result are returned as character. When `iter` is NULL, this is treated as denoting the cluster number in seqArchR's final clustering solution (`seqArchRresult$clustSol$clusters`).
Specify TRUE if sequences are ordered by clusters. The original ordering of the sequences can be fetched by setting `iter` to NULL and `ord` to FALSE.
The selected DNA sequences from the DNAStringSet object as a character vector.
Setting iter to NULL will fetch sequences as per the final clustering solution of seqArchR (`clustSol$clusters`). When `iter` is not NULL, use `cl` to further choose a particular cluster. When `cl` is NULL, the set of sequences returned can be ordered by clusters with `ord = TRUE`. Using `ord = FALSE` fetches the sequences by their original order.
res <- system.file("extdata", "example_seqArchRresult.rds",
package = "seqArchR", mustWork = TRUE)
# Fetch sequences from 2nd cluster of seqArchR's final solution
ans <- seqArchR::seqs_str(readRDS(res), iter=NULL, cl=2)
# Fetch all sequences ordered by the final clustering
ans <- seqArchR::seqs_str(readRDS(res), iter=NULL, cl=NULL, ord=TRUE)
# Fetch sequences belonging to first cluster in seqArchR's first iteration
ans <- seqArchR::seqs_str(readRDS(res), iter=1, cl=1)