SequenceCluster-class | R Documentation |
"SequenceCluster"
The SequenceCluster
class is used to cluster sequences of "words"
from an arbitrarily long alphabet. The SequenceCluster
function
returns a new object of the SequenceCluster
class.
SequenceCluster(rawseq, method = c("needelman", "levenshtein"), NC = 5)
## S4 method for signature 'SequenceCluster,missing'
plot(x, type = "rooted", main = "Colored Clusters", ...)
updateClusters(sc, NC)
heat(x, ...)
rawseq |
A character vector that contains all words or "sequences" to be clustered. |
method |
The algorithm to use to compute distances between sequences. The choices are "levenshstein", which uses the Levenshtein edit distance, or "needelman", which uses the Needelman-Wunsch global alignment algorithm. |
x |
An object of the |
sc |
An object of the |
NC |
An integer; the number of clusters to cut from the dendrogram. |
type |
A character strnig; the type of plot to make. Valid types are "rooted", "clipped", or "unrooted". |
main |
Character; the plot title. |
... |
extra arguments for generic or plotting routines |
The SequenceCluster
function returns a new object of the SequenceCluster
class.
Objects should be defined using the SequenceCluster
constructor. You
typically pass in a character vector of "words" to be clustered.
method
:A character vector describing which algorithm was used.
A character vector that contains the input words or "sequences" tthat were clustered.
A numeric vactor; the numbof times each unique raw sequence occurs.
distance
:A dist
object.
hc
:An hclust
object.
NC
:An integer; the number of clusters cut from the dendrogram.
clusters
:An integer vector containing cluster assignments.
Kevin R. Coombes <krc@silicovore.com>
data(longreads)
sequences <- longreads$connection[1:30] # named character vector
sequences <- sequences[!duplicated(sequences)] # dedup
sc <- SequenceCluster(sequences) # cluster
plot(sc) # visualize
sc <- updateClusters(sc, NC = 7)
plot(sc, type = "unrooted")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.