Learn R Programming

peplib (version 1.03)

MotifModel-class: Class "MotifModel"

Description

This is a simple implementation of the MEME motif finding algorithm. The MEME algorithm uses an Expectation-Maximization search for motifs on sequences (Sequences). It requires a choice of the motif length. For multiple motifs see MotifModelSet

Arguments

Objects from the Class

Objects can be created by calls of the form motifModel(seqs, type="fixed", width=4)

References

Bailey, T. L. Ph.D. thesis, University of California at San Diego, 1995.

See Also

Sequences

Examples

Run this code
#get sequence data
data(TULASequences)


#Create a fixed and optional type model
TULAFixed <- motifModel(TULASequences)
print(TULAFixed)
plotPositions(TULAFixed)

TULAOpt <- motifModel(TULASequences, type="optional")
print(TULAOpt)
plotPositions(TULAOpt)


#Something more interesting, cluster the data, fit two motif models, and
# then calculate the residuals

clusters <- aclust(dist(TULASequences), 2)

TULA.M1 <- motifModel(TULASequences[clusters[[1]],], type="fixed")
TULA.M2 <- motifModel(TULASequences[clusters[[2]],], type="fixed")

#Goodness of fit for model 1 and then using model 1 on the sequences in
# model 2, which is obviously a bad fit

#get threshold by including all sequences, no matter how bad the fit is.

threshold <- min(predict(TULA.M1))
print(threshold)

print(residuals(TULA.M1), threshold=threshold)
print(residuals(TULA.M1, seqs=TULA.M2@seqs, threshold=threshold))

Run the code above in your browser using DataLab