Skip to contents

Motif discovery using Matrix Profile doi:10.32614/RJ-2020-021

Usage

hmo_mp(mode = "stamp", w, qtd)

Arguments

mode

mode of computing distance between sequences. Available options include: "stomp", "stamp", "simple", "mstomp", "scrimp", "valmod", "pmp"

w

word size

qtd

number of occurrences to be classified as motifs

Value

hmo_mp object

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_mp("stamp", 4, 3)

# fitting the model
model <- fit(model, dataset$serie)

detection <- detect(model, dataset$serie)
#> Finished in 0.02 secs

# filtering detected events
print(detection[(detection$event),])
#>    idx event  type seq seqlen
#> 6    6  TRUE motif   3      4
#> 19  19  TRUE motif   2      4
#> 25  25  TRUE motif   1      4
#> 31  31  TRUE motif   3      4
#> 44  44  TRUE motif   2      4
#> 56  56  TRUE motif   3      4
#> 69  69  TRUE motif   2      4
#> 75  75  TRUE motif   1      4
#> 81  81  TRUE motif   3      4
#> 94  94  TRUE motif   2      4