toComplex: Turning a DNA sequence into a vector of complex numbers

Description Usage Arguments Value Author(s) See Also Examples

Description

The toComplex utility function turns a DNAString object into a complex vector.

Usage

1
toComplex(x, baseValues)

Arguments

x

A DNAString object.

baseValues

A named complex vector containing the values associated to each base e.g. c(A=1+0i, G=0+1i, T=-1+0i, C=0-1i)

Value

A complex vector of the same length as x.

Author(s)

H. Pag├Ęs

See Also

DNAString

Examples

1
2
3
4
5
6
7
8
  seq <- DNAString("accacctgaccattgtcct")
  baseValues1 <- c(A=1+0i, G=0+1i, T=-1+0i, C=0-1i)
  toComplex(seq, baseValues1)

  ## GC content:
  baseValues2 <- c(A=0, C=1, G=1, T=0)
  sum(as.integer(toComplex(seq, baseValues2)))
  ## Note that there are better ways to do this (see ?alphabetFrequency)


Search within the Biostrings package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.