Learn R Programming

MotIV (version 1.28.0)

motifDistances: Clustering PWMs Computation

Description

Set of functions to perfom clustering of PWMs.

Usage

motifDistances(inputPWM, DBscores=jaspar.scores, cc="PCC", align="SWU", top=5, go=1, ge=0.5) motifHclust(x,...) motifCutree(tree,k=NULL, h=NULL)

Arguments

inputPWM, DBscores, cc, align, top, go, ge
Option for the PWMs distances computation. Refere to motifMatch.
x,...
Arguments to pass to the hclust function. See hclust.
tree, k, h
Arguments to pass to the cutree function. See cutree.

Details

This function are made to perform motifs clustering.

The ‘motifDistances’ function computes the distances between each pair of motifs using the specified alignment.

The ‘motifHclust’ and ‘motifCutree’ functions are simple redefinition of ‘hclust’ and ‘cutree’.

Examples

Run this code
#####Database and Scores#####
path <- system.file(package="MotIV")
jaspar <- readPWMfile(paste(path,"/extdata/jaspar2010.txt",sep=""))
jaspar.scores <- readDBScores(paste(path,"/extdata/jaspar2010_PCC_SWU.scores",sep=""))

#####Input#####
data(FOXA1_rGADEM)
motifs <- getPWM(gadem)
motifs.trimed <- lapply(motifs,trimPWMedge, threshold=1)

#####Analysis#####
foxa1.analysis.jaspar <- motifMatch(inputPWM=motifs,align="SWU",cc="PCC",database=jaspar,DBscores=jaspar.scores,top=5)

#####Clustering#####
d <- motifDistances(getPWM(foxa1.analysis.jaspar))
hc <- motifHclust(d)
plot(hc)
f <- motifCutree(hc, k=2)
foxa1.combine <- combineMotifs(foxa1.analysis.jaspar, f, exact=FALSE, name=c("Group1", "Group2"), verbose=TRUE)

Run the code above in your browser using DataLab