###################################################
### chunk number 1: load
###################################################
library(BCRANK) 


###################################################
### chunk number 2: loadFasta
###################################################
fastaFile <- system.file("Exfiles/USF1_small.fa", package="BCRANK")


###################################################
### chunk number 3: loadResult
###################################################
data(BCRANKout)


###################################################
### chunk number 4: viewBCRANKresult
###################################################
BCRANKout


###################################################
### chunk number 5: viewBCRANKsearch
###################################################
topMotif <- toptable(BCRANKout,1)
topMotif


###################################################
### chunk number 6: viewBCRANKsearch
###################################################
weightMatrix <- pwm(topMotif, normalize=FALSE)
weightMatrix


###################################################
### chunk number 7: fig1
###################################################
plot(topMotif)


###################################################
### chunk number 8: reportSites
###################################################
topConsensus <- as.character(toptable(BCRANKout)[1,"Consensus"])
print(topConsensus)
bindingSites <- matchingSites(fastaFile,topConsensus)
nrSites <- nrow(bindingSites)
cat("Number predicted binding sites:",nrSites,"\n")
print(bindingSites[1:15,])


