This documentation is intended to present the outputs of a sample dataset.
The workflow consists of 3 steps described in the main package documentation. These 3 steps will be applied on our sample.
NormSAX
allows the normalization and SAX indexing of the dataset:
# The process is launched on the provided example dataset
dim(D <- STMotif::example_dataset)
#> [1] 100 50
# Normalizartion and SAX indexing
DS <- NormSAX(D = STMotif::example_dataset,a =7)
# Information of the normalized and SAX indexing dataset
# The candidates built
head(NormSAX(D = STMotif::example_dataset, a = 7)[,1:10])
#> 1 2 3 4 5 6 7 8 9 10
#> 1 e f e e f e f f d d
#> 2 d e e d f f d b b e
#> 3 d c c c e e b b c e
#> 4 c b c b c c c f f e
#> 5 c c d c b b e f f d
#> 6 e d d e b b c c c c
SearchSTMotifs
allows to check and filter the stmotifs, grouping the motifs from the neighboring block.# The list of motifs
# stmotifs <- SearchSTMotifs(D,DS,w,a,sb,tb,si,ka)
head(stmotifs <- SearchSTMotifs(D,DS,3,7,10,10,3,10))
#> 1/50 - 2%
#> 2/50 - 4%
#> 3/50 - 6%
#> 4/50 - 8%
#> 5/50 - 10%
#> 6/50 - 12%
#> 7/50 - 14%
#> 8/50 - 16%
#> 9/50 - 18%
#> 10/50 - 20%
#> 11/50 - 22%
#> 12/50 - 24%
#> 13/50 - 26%
#> 14/50 - 28%
#> 15/50 - 30%
#> 16/50 - 32%
#> 17/50 - 34%
#> 18/50 - 36%
#> 19/50 - 38%
#> 20/50 - 40%
#> 21/50 - 42%
#> 22/50 - 44%
#> 23/50 - 46%
#> 24/50 - 48%
#> 25/50 - 50%
#> 26/50 - 52%
#> 27/50 - 54%
#> 28/50 - 56%
#> 29/50 - 58%
#> 30/50 - 60%
#> 31/50 - 62%
#> 32/50 - 64%
#> 33/50 - 66%
#> 34/50 - 68%
#> 35/50 - 70%
#> 36/50 - 72%
#> 37/50 - 74%
#> 38/50 - 76%
#> 39/50 - 78%
#> 40/50 - 80%
#> 41/50 - 82%
#> 42/50 - 84%
#> 43/50 - 86%
#> 44/50 - 88%
#> 45/50 - 90%
#> 46/50 - 92%
#> 47/50 - 94%
#> 48/50 - 96%
#> 49/50 - 98%
#> 50/50 - 100%
#> $aaa
#> $aaa$isaxcod
#> [1] "aaa"
#>
#> $aaa$recmatrix
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0 0 0 0 0
#> [2,] 0 0 0 0 0
#> [3,] 0 0 0 0 0
#> [4,] 0 0 0 0 0
#> [5,] 0 0 0 0 0
#> [6,] 0 0 0 0 0
#> [7,] 0 0 0 0 0
#> [8,] 1 0 0 0 0
#> [9,] 0 0 0 0 0
#> [10,] 0 0 0 0 0
#>
#> $aaa$vecst
#> s t
#> 1 1 73
#> 2 2 74
#> 3 3 74
#> 4 4 75
#> 5 5 76
#> 6 6 77
#> 7 7 77
#> 8 8 77
#> 9 9 78
#> 10 10 78
#>
#>
#> $aaa
#> $aaa$isaxcod
#> [1] "aaa"
#>
#> $aaa$recmatrix
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0 0 0 0 0
#> [2,] 0 0 0 0 0
#> [3,] 0 0 0 0 0
#> [4,] 0 0 0 0 0
#> [5,] 0 0 0 0 0
#> [6,] 0 0 0 0 0
#> [7,] 0 0 0 0 0
#> [8,] 0 0 0 0 0
#> [9,] 0 0 2 2 2
#> [10,] 0 0 0 0 0
#>
#> $aaa$vecst
#> s t
#> 11 21 86
#> 12 22 87
#> 13 23 87
#> 14 24 87
#> 15 25 87
#> 16 26 86
#> 17 27 85
#> 18 28 85
#> 19 29 85
#> 20 30 85
#> 21 31 85
#> 22 32 85
#> 23 33 84
#> 24 34 84
#> 25 35 83
#> 26 35 84
#> 27 36 83
#> 28 37 83
#> 29 38 83
#> 30 39 83
#> 31 40 83
#> 32 41 83
#> 33 42 83
#> 34 43 82
#> 35 44 82
#> 36 45 82
#> 37 46 82
#> 38 47 82
#> 39 48 82
#> 40 49 82
#> 41 50 82
#>
#>
#> $ggg
#> $ggg$isaxcod
#> [1] "ggg"
#>
#> $ggg$recmatrix
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0 0 0 0 0
#> [2,] 0 0 0 0 0
#> [3,] 0 0 0 0 0
#> [4,] 0 0 0 0 0
#> [5,] 0 0 0 0 0
#> [6,] 0 0 0 0 0
#> [7,] 0 0 0 0 0
#> [8,] 0 0 0 0 0
#> [9,] 0 0 1 0 0
#> [10,] 0 0 0 0 0
#>
#> $ggg$vecst
#> s t
#> 1 21 81
#> 2 21 82
#> 3 21 83
#> 4 22 81
#> 5 22 82
#> 6 22 83
#> 7 23 82
#> 8 23 83
#> 9 23 84
#> 10 24 82
#> 11 24 83
#> 12 24 84
#> 13 25 82
#> 14 25 83
#> 15 26 81
#> 16 26 82
#> 17 26 83
#> 18 27 81
#> 19 27 82
#> 20 28 81
#> 21 28 82
#> 22 29 81
#> 23 29 82
#> 24 30 81
#>
#>
#> $ggg
#> $ggg$isaxcod
#> [1] "ggg"
#>
#> $ggg$recmatrix
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0 0 0 0 0
#> [2,] 0 0 0 0 0
#> [3,] 0 0 0 0 0
#> [4,] 0 0 0 0 0
#> [5,] 0 0 0 0 0
#> [6,] 0 0 0 0 0
#> [7,] 0 0 0 0 0
#> [8,] 0 0 0 0 2
#> [9,] 0 0 0 0 0
#> [10,] 0 0 0 0 0
#>
#> $ggg$vecst
#> s t
#> 25 41 77
#> 26 41 78
#> 27 42 77
#> 28 42 78
#> 29 43 76
#> 30 43 77
#> 31 43 78
#> 32 44 76
#> 33 44 77
#> 34 44 78
#> 35 45 76
#> 36 45 77
#> 37 45 78
#> 38 46 77
#> 39 46 78
#> 40 47 76
#> 41 47 77
#> 42 47 78
#> 43 48 76
#> 44 48 77
#> 45 48 78
#> 46 49 76
#> 47 49 77
#> 48 49 78
#> 49 50 76
#> 50 50 77
#> 51 50 78
RankSTMotifs
allows to rank the stmotifs list, making a balance between distance among the occurrences of a motif with the encoded information on the motif itself and his quantity.# The rank list of stmotifs
# rstmotifs <- RankSTMotifs(stmotifs)
head(rstmotifs <- RankSTMotifs(stmotifs))
#> $aaa
#> $aaa$isaxcod
#> [1] "aaa"
#>
#> $aaa$recmatrix
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0 0 0 0 0
#> [2,] 0 0 0 0 0
#> [3,] 0 0 0 0 0
#> [4,] 0 0 0 0 0
#> [5,] 0 0 0 0 0
#> [6,] 0 0 0 0 0
#> [7,] 0 0 0 0 0
#> [8,] 1 0 0 0 0
#> [9,] 0 0 0 0 0
#> [10,] 0 0 0 0 0
#>
#> $aaa$vecst
#> s t
#> 1 1 73
#> 2 2 74
#> 3 3 74
#> 4 4 75
#> 5 5 76
#> 6 6 77
#> 7 7 77
#> 8 8 77
#> 9 9 78
#> 10 10 78
#>
#> $aaa$rank
#> $aaa$rank$dist
#> [1] 0.8492424
#>
#> $aaa$rank$word
#> [1] 0
#>
#> $aaa$rank$qtd
#> [1] 3.321928
#>
#> $aaa$rank$proj
#> [,1]
#> 1 2.949463
#>
#>
#>
#> $ggg
#> $ggg$isaxcod
#> [1] "ggg"
#>
#> $ggg$recmatrix
#> [,1] [,2] [,3] [,4] [,5]
#> [1,] 0 0 0 0 0
#> [2,] 0 0 0 0 0
#> [3,] 0 0 0 0 0
#> [4,] 0 0 0 0 0
#> [5,] 0 0 0 0 0
#> [6,] 0 0 0 0 0
#> [7,] 0 0 0 0 0
#> [8,] 0 0 0 0 0
#> [9,] 0 0 1 0 0
#> [10,] 0 0 0 0 0
#>
#> $ggg$vecst
#> s t
#> 1 21 81
#> 2 21 82
#> 3 21 83
#> 4 22 81
#> 5 22 82
#> 6 22 83
#> 7 23 82
#> 8 23 83
#> 9 23 84
#> 10 24 82
#> 11 24 83
#> 12 24 84
#> 13 25 82
#> 14 25 83
#> 15 26 81
#> 16 26 82
#> 17 26 83
#> 18 27 81
#> 19 27 82
#> 20 28 81
#> 21 28 82
#> 22 29 81
#> 23 29 82
#> 24 30 81
#>
#> $ggg$rank
#> $ggg$rank$dist
#> [1] 1
#>
#> $ggg$rank$word
#> [1] 0
#>
#> $ggg$rank$qtd
#> [1] 4.584963
#>
#> $ggg$rank$proj
#> [,1]
#> 3 3.949165
The function runVisualization
allows to launch the shiny application to see the result. There are two ways to visualize the result.
# Plot the intensity of the dataset and highlight one selected motif
intensityDataset(dataset = D,rankList = rstmotifs,position = 1,alpha = 7)
# Plot five specific spatial-series which some of them contain the best motif
displayPlotSeries(dataset = D, rmotifs = rstmotifs ,position = 1 ,space = c(1,2,5:7))