seqs_str: Get sequences from the seqArchR result object

View source: R/seqArchR_auxiliary_functionsI.R

seqs_strR Documentation

Get sequences from the seqArchR result object

Description

Wrapper to fetch sequences from the seqArchR result object as character

Usage

seqs_str(res, iter = NULL, cl = NULL, ord = FALSE)

Arguments

res

seqArchR result object

iter

Specify the iteration of seqArchR result. If set to NULL (the default), the original set of sequences ('seqArchRresult$rawSeqs') is returned.

cl

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').

ord

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.

Details

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.

Value

The selected DNA sequences from the DNAStringSet object as a character vector.

Examples


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)



snikumbh/seqArchR documentation built on March 11, 2024, 7:06 p.m.