read.pwm: Read PWM object

Description Usage Arguments Value Examples

View source: R/tfbs.R

Description

Read and log transform Position Weight Matrices (PWMs) from file. Each position weight matrix represents a Transcription Factor motif that is being searched for. Files may contain one or more motifs. Only MEME Text formated files are supported. Look in the examples below to find an example PWM file.

Usage

1
read.pwm(filename)

Arguments

filename

Full Path to file of MEME Text format

Value

Matrix object containing the Position Weight Matrix read from the file. If the file contains more than one PWM, a list of Matrix objects are returned, one for each PWM. The returned PWMs are log transformed, so that entry [i,j] of the matrix represents the log probability of observing the base from column j in the i'th position of a transcription factor binding site.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
require("rtfbs")
exampleArchive <- system.file("extdata", "NRSF.zip", package="rtfbs")
pwmFile <- "pwm.meme"
unzip(exampleArchive, pwmFile)
# Read in Position Weight Matrix (PWM) from MEME file from
#  the examples into a Matrix object
pwm <- read.pwm(pwmFile)
# Print PWM as an R matrix
print(pwm)
unlink("pwm.meme")

rtfbs documentation built on Jan. 22, 2020, 1:07 a.m.