Learn R Programming

BioSeqClass (version 1.30.0)

featureBinary: Feature Coding by Binary Vectors

Description

Sequences are coded by binary vectors.

Usage

featureBinary(seq,class=elements("aminoacid"))

Arguments

seq
a string vector for the protein, DNA, or RNA sequences.
class
a list for the class of biological properties. It can be produced by elements and aaClass.

Details

featureBinary returns a matrix with M*N columns. Each row represented features of one sequence coding by a M*N dimension 0-1 vector. Each base/amino acid is coded as a M dimension vetor. For example: amino acid "A" is coded by "00000000000000000001"; base "T" is coded by "0010". The input sequences must have equal length.

Examples

Run this code
if(interactive()){
  file = file.path(path.package("BioSeqClass"), "example", "acetylation_K.pos40.pep")
  seq = as.matrix(read.csv(file,header=F,sep="\t",row.names=1))[,1]
  
  BIN1 = featureBinary(seq,elements("aminoacid"))
  BIN2 = featureBinary(seq,aaClass("aaE"))
}

Run the code above in your browser using DataLab