print(paste("Installing RSAT package", package, "in folder", dir.rsat.rlib))
print("Installing RSAT-specific packages")
for (package in required.packages.rsat) {
print(paste("Installing RSAT package", package, "in folder", dir.rsat.rlib))
install.packages(pkgs=file.path(dir.rsat.rscripts, "TFBMclust"), repos=NULL,  lib=dir.rsat.rlib, type="source")
}
print(required.packages.rsat)
print("Installing RSAT-specific packages")
print(required.packages.rsat)
print("Installing R packages from CRAN repository", rcran.repos)
################################################################
## Install R packages required for different RSAT applications.
##
## This script requires the write access to the folder RSAT/R-scripts,
## and should thus be executed only by the administator of the RSAT suite.
## Define the preferred CRAN repository.
## If not defined in an environment variable, take rstudio by default.
if (Sys.getenv("CRAN_REPOS") == "") {
rcran.repos <- "http://cran.rstudio.com/"
} else {
rcran.repos <- Sys.getenv("CRAN_REPOS")
}
## List of packages to install
required.packages = c("RJSONIO",
"dendextend",
"Rcpp",
"Rclusterpp",
"gplots",
"devtools")
## List of required packages from Bioconductor
required.packages.bioconductor <- c("ctc")
## List of RSAT-specific packages to be compiled on the server
required.packages.rsat <- c("TFBMclust")
## Define the local directory for R librairies
dir.rsat <- Sys.getenv("RSAT")
if (dir.rsat == "") {
stop("The environment variable RSAT is not defined.")
}
dir.rsat.rscripts <- file.path(dir.rsat, "R-scripts")
dir.rsat.rlib <- file.path(dir.rsat.rscripts, "Rpackages")
}
dir.rsat.rscripts <- file.path(dir.rsat, "R-scripts")
dir.rsat.rlib <- file.path(dir.rsat.rscripts, "Rpackages")
dir.create(dir.rsat.rlib, showWarnings = FALSE, recursive = FALSE)
## Install R packages from the CRAN
print("Installing R packages from CRAN repository", rcran.repos)
print(paste("Installing R packages from CRAN repository", rcran.repos))
print(required.packages.rsat)
print(required.packages)
print(paste("Installing R packages from CRAN repository", rcran.repos))
print(required.packages)
print(verbose(pkg, "package installed in dir", dir.rsat.rlib))
print(paste(pkg, "package installed in dir", dir.rsat.rlib))
print(paste("Installing BioConductor packages))
print(paste("Installing BioConductor packages"))
print(paste("Installing BioConductor packages"))
print(required.packages)
print(required.packages.bioconductor)
print(required.packages.bioconductor)
n <- seq(from = 1, to = 100)
n <- seq(from = 1, to = 100)
r <- ln(n)
plot(n,r)
r <- log(n)
plot(n,r)
plot(n,r, panel.first = grid())
n <- seq(from = 1, to = 1000)
r <- log(n)
plot(n,r, panel.first = grid())
```
diff <- log(n+1) - log(n)
lines(n,diff, color="red", type="p")
lines(n,diff, col="red", type="p")
lines(n+1,diff, col="red", type="p")
r <- log(n)
plot(n,r, panel.first = grid())
## Compute the difference between successive terms
diff <- log(n+1) - log(n)
lines(n+1,diff, col="red", type="p", pch="-")
n <- seq(from = 1, to = 100)
r <- log(n)
plot(n,r, panel.first = grid())
## Compute the difference between successive terms
diff <- log(n+1) - log(n)
lines(n+1,diff, col="red", type="p", pch="-")
legend(col=c("black","red"), legend=c("ln(n)", "ln(n)-ln(n-1)"))
legend("topleft",col=c("black","red"), legend=c("ln(n)", "ln(n)-ln(n-1)"))
legend("topleft",col=c("black","red"), legend=c("ln(n)", "ln(n)-ln(n-1)"), type="p", pch=c(1,"-"))
legend("topleft",col=c("black","red"), legend=c("ln(n)", "ln(n)-ln(n-1)"), pch=c(1,"-"))
legend("topleft",col=c("black","red"), legend=c("ln(n)", "ln(n)-ln(n-1)"), pch=c("o","-"))
diff <- log(n+1) - log(n)
lines(n+1,diff, col="red", type="p", pch="-")
legend("topleft",col=c("black","red"), legend=c("ln(n)", "ln(n)-ln(n-1)"), pch=c("o","-"))
diff2 <- log(2*n) - log(n)
lines(n+1,diff2, col="red", type="p", pch="-")
diff2 <- log(3*n) - log(n)
lines(n+1,diff2, col="red", type="p", pch="-")
diff2 <- log(2*n) - log(n)
lines(n+1,diff2, col="red", type="p", pch="-")
plot(n,r, panel.first = grid())
## Compute the difference between successive terms
diff <- log(n+1) - log(n)
lines(n+1,diff, col="darkgreen", type="p", pch="-")
## Compute the difference between distant terms
diff2 <- log(2*n) - log(n)
lines(n+1,diff2, col="red", type="p", pch="-")
n <- seq(from = 1, to = 100)
r <- log(n)
plot(n,r, panel.first = grid())
## Compute the difference between successive terms
diff <- log(n+1) - log(n)
lines(n+1,diff, col="darkgreen", type="p", pch="-")
## Compute the difference between distant terms
diff2 <- log(2*n) - log(n)
lines(n+1,diff2, col="red", type="p", pch="-")
legend("topleft",col=c("black","red"), legend=c("ln(n)", "ln(n)-ln(n-1)"), pch=c("o","-"))
n <- seq(from = 1, to = 100)
r <- log(n)
plot(n,r, panel.first = grid())
## Compute the difference between successive terms
diff <- log(n+1) - log(n)
lines(n,diff, col="darkgreen", type="p", pch="-")
## Compute the difference between distant terms
diff2 <- log(2*n) - log(n)
lines(n,diff2, col="red", type="p", pch="x")
legend("topleft",col=c("black","darkgreen", "red"),
legend=c("ln(n)", "ln(n+1)-ln(n)", "ln(2n)-ln(n)"),
pch=c("o","-", "x"))
par(mfrow=c(3,2))
par(mai=c(0.7,0.7,0.1,0.1))
alpha <- 1
for (alpha in c(0.3, 0.7,1,1.5,2,4, 3,5)) {
max.n <- 100
n <- 1:max.n
riemann <- cumsum(1/n^alpha)
if (alpha==2) {
limit <- pi^2/6
} else if (alpha ==4) {
limit <- pi^4/90
} else if (alpha > 1) {
## Estimate the limit by taking a very large number
limit <- sum (1/(1:(max.n*10))^alpha)
} else {
limit <- NA
}
if (is.na(limit)) {
ymax <- max(riemann)
} else {
ymax <- limit
}
plot(n, riemann, type="l", panel.first=grid(), col="darkviolet", ylim=c(0,ymax))
if (!is.na(limit)) {
abline(h=limit, col="red", lty="dotted", lwd=2)
}
legend("bottomright", paste("alpha=", alpha), lwd=2, col="darkviolet")
}
par(mfrow=c(1,1))
x <- seq(from=-5, to=5, by=0.01)
y <- 1/sqrt(2*pi)*exp(-x^2/2)
plot(x,y,type="l",lwd=3, col="red")
lines (x, dnorm(x), lwd=3, col="green", lty="dashed")
x <- seq(-2,2, by=0.1)
theta <- exp(-1/(1-t^2))
t <- seq(-2,2, by=0.1)
theta <- exp(-1/(1-t^2))
plot(t,theta, type="p")
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
plot(t,theta, type="p")
plot(t,theta, type="p", ylim=c(0,5))
plot(t,theta, type="p", ylim=c(0,3))
plot(t,theta, type="p", ylim=c(0,3), col="grey")
plot(t,theta, type="p", ylim=c(0,3), col="darkgrey")
t <- seq(-2,2, by=0.1)
theta <- exp(-1/(1-t^2))
plot(t,theta, type="p", ylim=c(0,3), col="darkgrey")
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
plot(t,theta, type="p", ylim=c(0,3), col="darkgrey")
abline(v=c(-1,1), col="red")
col <- rep("darkgrey", n=length(t))
col[abs(t)<1]="darkgreen"
col <- rep("darkgrey", n=length(t))
col[abs(t)<1]="darkgreen"
plot(t,theta, type="p", ylim=c(0,3), col=col)
col <- rep("darkgrey", n=length(t))
plot(t,theta, type="p", ylim=c(0,3), col=col)
col[abs(t)<1] <- "darkgreen"
plot(t,theta, type="p", ylim=c(0,3), col=col)
col <- rep("darkgrey", n=length(t))
abs(t)<1
col[abs(t)<1] <- "darkgreen"
col
colors <- rep("darkgrey", n=length(t))
colors[abs(t)<1] <- "darkgreen"
colors
colors[abs(t)>=1] <- "grey"
colors
colors <- vector()
colors[abs(t)<1] <- "darkgreen"
colors[abs(t)>=1] <- "grey"
colors <- vector()
colors[abs(t)<1] <- "darkgreen"
colors[abs(t)>=1] <- "grey"
colors
plot(t,theta, type="p", ylim=c(0,3), col=col)
colors[abs(t)>=1] <- "grey"
colors
len(colors)
length(colors)
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors)
abline(v=c(-1,1), col="red")
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function")
ablines=c(1,1,1,1)
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function")
par(mai=c(1,1,1,1))
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function")
abline(v=c(-1,1), col="red")
par(mar=c(1,1,1,1))
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function")
abline(v=c(-1,1), col="red")
par(mai=c(1.2,1.2,1.2,0.3))
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function")
abline(v=c(-1,1), col="red")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function")
abline(v=c(-1,1), col="red")
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function",
panel.first=grid())
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function",
panel.first=grid())
abline(v=c(-1,1), col="red")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz $\theta$ function",
panel.first=grid())
abline(v=c(-1,1), col="red")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta <- exp(-1/(1-t^2))
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function",
panel.first=grid())
abline(v=c(-1,1), col="red")
alpha <- exp(-1/t)
alpha[t<=0] = 0
alpha
plot(t,alpha)
plot(t,alpha, col=grey)
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
my.colors <- vector()
my.colors[abs(t)<1] <- "darkgreen"
my.colors[abs(t)>=1] <- "grey"
plot(t,theta, type="p", ylim=c(0,3), col=my.colors,
main="Shwartz theta function",
panel.first=grid())
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
theta <- theta1
theta[abs(t)>=1] <- 0
plot(t,theta, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz theta function",
panel.first=grid())
abline(v=c(-1,1), col="red")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
theta <- theta1
theta[abs(t)>=1] <- 0
plot(t,theta1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz theta function",
panel.first=grid())
abline(v=c(-1,1), col="red")
lines(t,theta,type="p",col="darkgreen")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
theta <- theta1
theta[abs(t)>=1] <- 0
plot(t,theta1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz theta function",
panel.first=grid())
lines(t,theta,type="p",col="darkgreen")
abline(v=c(-1,1), col="red")
alpha1 <- exp(-1/t)
alpha1 <- exp(-1/t)
alpha <- alpha1
alpha[t<=0] = 0
plot(t,alpha1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz alpha function",
panel.first=grid())
lines(t,alpha,type="p",col="darkgreen")
abline(v=0, col="red")
t <- seq(-2,10, by=0.01)
alpha1 <- exp(-1/t)
alpha <- alpha1
alpha[t<=0] = 0
plot(t,alpha1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz alpha function",
panel.first=grid())
lines(t,alpha,type="p",col="darkgreen")
abline(v=0, col="red")
abline(h=1, col="darkviolet")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
theta <- theta1
theta[abs(t)>=1] <- 0
plot(t,theta1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz theta function",
panel.first=grid())
lines(t,theta,type="p",col="darkgreen")
abline(v=c(-1,1), col="red")
abline(h=c(-exp(-1), exp(-1)), col="red")
abline(h=c(-exp(-1), exp(-1)), col="darkviolet")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
theta <- theta1
theta[abs(t)>=1] <- 0
plot(t,theta1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz theta function",
panel.first=grid())
lines(t,theta,type="p",col="darkgreen", pch=20)
abline(v=c(-1,1), col="red")
abline(h=c(-exp(-1), exp(-1)), col="darkviolet")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
theta <- theta1
theta[abs(t)>=1] <- 0
plot(t,theta1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz theta function",
panel.first=grid())
lines(t,theta,type="p",col="darkgreen", pch=19)
abline(v=c(-1,1), col="red")
abline(h=c(-exp(-1), exp(-1)), col="darkviolet")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
theta <- theta1
theta[abs(t)>=1] <- 0
plot(t,theta1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz theta function",
panel.first=grid())
lines(t,theta,type="p",col="darkgreen", pch=16)
abline(v=c(-1,1), col="red")
abline(h=c(-exp(-1), exp(-1)), col="darkviolet")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
theta <- theta1
theta[abs(t)>=1] <- 0
plot(t,theta1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz theta function",
panel.first=grid())
lines(t,theta,type="p",col="darkgreen", pch=20)
abline(v=c(-1,1), col="red")
abline(h=c(-exp(-1), exp(-1)), col="darkviolet")
t <- seq(-2,10, by=0.01)
alpha1 <- exp(-1/t)
alpha <- alpha1
alpha[t<=0] = 0
plot(t,alpha1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz alpha function",
panel.first=grid())
lines(t,alpha,type="p",col="darkgreen")
abline(v=0, col="red")
abline(h=1, col="darkviolet")
par(mai=c(1.2,1.2,1,0.3))
t <- seq(-2,2, by=0.01)
theta1 <- exp(-1/(1-t^2))
theta <- theta1
theta[abs(t)>=1] <- 0
plot(t,theta1, type="p", ylim=c(0,3), col="darkgrey",
main="Shwartz theta function",
panel.first=grid())
lines(t,theta,type="p",col="darkgreen", pch=20)
abline(v=c(-1,1), col="red")
abline(h=c(-exp(-1), exp(-1)), col="darkviolet")
x <- rep(-2*pi, 2*pi, by=0.1)
x <- rep(-2*pi, 2*pi, by=0.1)
a <- 12
y <-cos(a*x)^2
plot(x,y)
x <- rep(-2*pi, 2*pi, by=0.1)
a <- 12
x
x <- seq(from=-2*pi, to=2*pi, by=0.01)
a <- 12
y <-cos(a*x)^2
plot(x,y)
x <- seq(from=-2*pi, to=2*pi, by=0.01)
a <- 1
y <-cos(a*x)^2
plot(x,y)
a <- 2
y <-cos(a*x)^2
plot(x,y)
a <- 3
y <-cos(a*x)^2
plot(x,y)
a <- 12
y <-cos(a*x)^2
plot(x,y)
plot(x,y, type="l")
plot(x,y, type="lb")
plot(x,y, type="b")
a <- 13
y <-cos(a*x)^2
plot(x,y, type="b")
plot(x,y)
a <- 4
y <-cos(a*x)^2
plot(x,y)
a <- 5
y <-cos(a*x)^2
plot(x,y)
a <- 6
y <-cos(a*x)^2
plot(x,y)
a <- 7
y <-cos(a*x)^2
plot(x,y)
a <- 6
y <-cos(a*x)^2
plot(x,y)
x <- seq(from=-2*pi, to=2*pi, by=0.01)
a <- 2
y <-cos(a*x)^2
plot(x,y)
library(TFBMclust)
browseVignettes
browseVignettes()
?oct4.tfbm.compa
help.start()
denboer2009 <- list()
denboer2009$expr <- expr.matrix
denboer2009$pheno <- pheno
denboer2009$group.labels <- group.labels
denboer2009$group.colors <- group.colors
library(TFBMclust)
library(TFBMclust)
data(oct4chipseq)
## The dataset contains 2 data frames
## (1) Matrix-to-matrix comparison table,
## with various scores to compare each pair of
View(oct4.tfbm.compa)  matrices
library(TFBMclust)
## (1) Matrix-to-matrix comparison table, with
## various scores to compare each pair of matrices
View(oct4.tfbm.compa)
## (2) Description table for the input PSSM
## (ID,name,consensus in both orientations, ...)
View(oct4.tfbm.desc)
library(TFBMclust)
