Contents

1 Overview

The “Spaced Words Projection (sWeeP)” is a method for representing biological sequences using relatively, it uses the spacedwords concept by scanning sequences and generating indices to create a higherdimensional vector that is later projected into a smaller randomly oriented orthonormal base. This function is suitable for making high quality comparisons between sequences allowing analyzes that are not possible due to the computational limitation of the traditional techniques. The method is available at sWeeP (PIERRI, 2019). This tool has it’s main speed gain in constanci processing time. The response time grows linear to the number of inputs, while in other methods it grow is exponencial.

1.1 Functions

The package has two functions: orthBase, that generates an orthonormal matrix of a chosen size, and sWeeP, a function that applies the sWeeP method

2 Quick Start

The orthBase function can create a quasi-orthonormal matrix in any desired size. Here it is used to create a matrix to project the sWeeP method, so it must have 160.000 rows and the columns of the size wished for projection.

library(rSWeeP)
baseMatrix <- orthBase(160000,10)

The exdna.fas dataset consists in a list of three strings that simulates a DNA sequence used for demonstration purposes only.

path <- system.file(package = "rSWeeP", "extdata", "exdna.fas")

Then the sWeeP method is applied and the returns a matrix that represents the sequences compared by a vectorial method. And then it’s possible to see a graphic representation in a phylogenetic tree

return <- sWeeP(path,baseMatrix)
distancia <- dist(return, method = "euclidean")
tree <- hclust(distancia, method="ward.D")
plot(tree, hang = -1, cex = 1)

3 Session information

## R Under development (unstable) (2020-01-28 r77731)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.3 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.11-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.11-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] rSWeeP_0.99.13   BiocStyle_2.15.6
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_1.0.3          knitr_1.28          XVector_0.27.0     
##  [4] magrittr_1.5        BiocGenerics_0.33.0 zlibbioc_1.33.1    
##  [7] IRanges_2.21.3      rlang_0.4.4         stringr_1.4.0      
## [10] tools_4.0.0         parallel_4.0.0      xfun_0.12          
## [13] htmltools_0.4.0     yaml_2.2.1          digest_0.6.23      
## [16] crayon_1.3.4        bookdown_0.17       BiocManager_1.30.10
## [19] S4Vectors_0.25.12   evaluate_0.14       rmarkdown_2.1      
## [22] stringi_1.4.5       pracma_2.2.9        compiler_4.0.0     
## [25] magick_2.3          Biostrings_2.55.4   stats4_4.0.0

4 References