Learn R Programming

DiffLogo (version 1.2.1)

getPwmFromAlignment: Create PWM from alignment

Description

Creates a matrix-representation of a PWM from a set of sequences

Usage

getPwmFromAlignment(alignment, alphabet, pseudoCount)

Arguments

alignment
a vector or list of sequences each with equal length
alphabet
of type Alphabet
pseudoCount
the number of pseudo-observations for each character in the alphabet

Value

PWM as matrix

Examples

Run this code
motif_folder= "extdata/alignments"
motif_name = "calamodulin_1"
fileName = paste(motif_folder,"/",motif_name,".txt",sep="")
file = system.file(fileName, package = "DiffLogo")
motif = getPwmFromAlignment(readLines(file), ASN, 1)
seqLogo(pwm = motif, alphabet=ASN)

Run the code above in your browser using DataLab