Title: | Encoding of Sequences Based on Frequency Matrix Chaos Game Representation |
---|---|
Description: | Sequences encoding by using the chaos game representation. Löchel et al. (2019) <doi:10.1093/bioinformatics/btz493>. |
Authors: | Dominik Eger and Hannah Franziska Löchel |
Maintainer: | Hannah Franziska Löchel <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.2 |
Built: | 2024-11-01 03:38:50 UTC |
Source: | https://github.com/cran/kaos |
Chaos Game Representation Object
cgr(data, seq.base = row.names(table(data)), sf = F, res = 100)
cgr(data, seq.base = row.names(table(data)), sf = F, res = 100)
data |
Input as list/vector of characters from fasta file or similar |
seq.base |
By default the included unique elements in data will be used
in alphabetical order. It is also possible to define the alphabet
explicitly.
|
sf |
By default, the scaling factor for fractal polygons is used; the scaling factor can also explicitly set to values between 0 and 1. |
res |
resolution of the frequency matrix |
This function produces a chaos game representation (CGR) object from a sequence (data)
CGR object as list of:
matrix: frequency matrix with given resolution
x: x-coordinates for the CGR
y: y-coordinates for the CGR
sf: applied scaling factor for the CGR
res: applied resolution to calculate the FCGR
base.seq: chars or letters to build the edges of the CGR
###HIV data data("HIV") ### encoding the sequence HIV.cgr = cgr(HIV, res = 100) ###plot the sequence cgr.plot(HIV.cgr, mode = "points") ###plot the FCGR cgr.plot(HIV.cgr, mode = "matrix") ###change the resolution of matrix from 100x100 to 200x200 cgr.res(HIV.cgr, 200) ### get the FCGR encoded vector vectorize(HIV.cgr)
###HIV data data("HIV") ### encoding the sequence HIV.cgr = cgr(HIV, res = 100) ###plot the sequence cgr.plot(HIV.cgr, mode = "points") ###plot the FCGR cgr.plot(HIV.cgr, mode = "matrix") ###change the resolution of matrix from 100x100 to 200x200 cgr.res(HIV.cgr, 200) ### get the FCGR encoded vector vectorize(HIV.cgr)
Plot from a CGR object
cgr.plot(data, mode, corners = F, labels = F)
cgr.plot(data, mode, corners = F, labels = F)
data |
CGR object |
mode |
character string
|
corners |
if true, the corners are added as red dots |
labels |
if true, the symbol associated with the corner is added |
This function plots the chaos game reprasentation as points or as frequency matrix representation
Produces a new matrix with new resolution
cgr.res(data, res)
cgr.res(data, res)
data |
CGR object |
res |
new resolution |
This function adjust the resolution of the FCGR of a CGR object.
matrix: frequency matrix with new given resolution
x: x-coordinates for the CGR
y: y-coordinates for the CGR
sf: applied scaling factor for the CGR
res: applied resolution to calculate the FCGR
base.seq: chars or letters to build the edges of the CGR
Complete HIV 1 genome
A vector containing the genome of HIV-1 as single characters
NC_001802.1 Human immunodeficiency virus 1, complete genome
Vectorizes the FCGR
vectorize(data)
vectorize(data)
data |
CGR object from cgr.R |
This function returns the FCGR as vector.
Vector with FCGR-encoding