Motif discovery using xsax doi:10.1007/s10618-007-0064-z
Examples
library(daltoolbox)
#loading the example database
data(examples_motifs)
#Using sequence example
dataset <- examples_motifs$simple
head(dataset)
#> serie event
#> 1 1.0000000 FALSE
#> 2 0.9939124 FALSE
#> 3 0.9275826 FALSE
#> 4 0.8066889 FALSE
#> 5 0.6403023 FALSE
#> 6 0.4403224 FALSE
# setting up motif discovery method
model <- hmo_xsax(37, 3, 3)
# fitting the model
model <- fit(model, dataset$serie)
detection <- detect(model, dataset$serie)
# filtering detected events
print(detection[(detection$event),])
#> idx event type seq seqlen
#> 25 25 TRUE motif 0N0P0R 3
#> 50 50 TRUE motif 0N0P0R 3
#> 75 75 TRUE motif 0N0P0R 3