cgr: Chaos Game Representation Object

Description Usage Arguments Details Value Examples

View source: R/cgr.R

Description

Chaos Game Representation Object

Usage

1
cgr(data, seq.base = row.names(table(data)), sf = F, res = 100)

Arguments

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.
Predefined alphabets can be used as well:

  • "digits": numbers from 0 to 9

  • "AMINO": alphabetical order of the amino acids in capital letters

  • "amino": alphabetical order of the amino acids in lowercase letters

  • "DNA": the four bases of DNA ("A","G","T","C") in capital letters

  • "dna": the four bases of DNA ("a","g","t","c") in lowercase letters

  • "LETTERS": The alphabetical order of capital letters from A to Z

  • "letters": The alphabetical order of lowercase Letters from a to z

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

Details

This function produces a chaos game representation (CGR) object from a sequence (data)

Value

CGR object as list of:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
###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)

kaos documentation built on Sept. 27, 2019, 9:04 a.m.

Related to cgr in kaos...