Compute shannon information based on position and treatment

Share:

Description

Compute shannon information based on position and treatment

Usage

1
2
calcInformation(dframe, trt = NULL, pos, elems, k = 4, weight = NULL,
  method = "shannon")

Arguments

dframe

data frame of peptide (or any other) sequences and some treatment factors

trt

(vector of) character string(s) of treatment information

pos

character string of position

elems

character string of elements

k

alphabet size: 4 for DNA/RNA sequences, 21 for standard amino acids

weight

number of times each sequence is observed, defaults to 1 in case no weight is given

method

either "shannon" or "frequency" for Shannon information or relative frequency of element by position.

Value

extended data frame with additional information of shannon info in bits and each elements contribution to the total information

Examples

1
2
3
4
5
6
data(sequences)
dm2 <- splitSequence(sequences, "peptide")
dm3 <- calcInformation(dm2, pos="position", trt="class", elems="element", k=21)
# precursor to a logo plot:
library(ggplot2)
# library(biovizBase)