Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

small bug fixes in run and plot, update stamm packge

  • Loading branch information...
commit 0d8f29598f79543d692827a0e13d071d885750f5 1 parent c364543
@anasrana authored
View
5 README.org
@@ -1,7 +1,10 @@
* State Transitions using Aggregate Markov Models
** Installation
-Please download the *stamm_[version].tar.gz* and install package in R.
+Please download the *stamm_[version].tar.gz* and install package in R using:
+#+BEGIN_SRC R
+install.packages(file_name_and_path, repos = NULL, type="source")
+#+END_SRC
** Load Package anad Data
Once installed you can load the package with
View
16 example_code.r
@@ -5,12 +5,16 @@ data(tdat)
data(sim_data)
-fit.km <- StammKmeans(g.dat, m.v=2:30, iter.max=1000, nstart=500)
+fit.km <- StammKmeans(g.dat, m.v=2:30)
print(fit.km$kmeans.plot)
-StammMSEcv.K(g.dat, t.dat, k.states=1:5, hat.m=13, n.core=50, l.pen=0, return.all=FALSE)
-StammMSEcv.m(g.dat, t.dat, m.cl=12:20, k.states=1:5, n.core=50, l.pen=0)
+k.stt <- 1:5
+m.cl <- 12:20
-StammMSEcvK.plot(mse, k.states)
-StammStab.plot(fit.k, m.v, m.init=2)
-StammStabPen.plot(fit, fit.m, t.dat)
+fit.K <- StammMSEcv.K(g.dat, t.dat, k.states=k.stt, hat.m=13, n.core=50, l.pen=0, return.all=TRUE)
+fit.m <- StammMSEcv.m(g.dat, t.dat, m.cl=m.cl, k.states=k.stt, n.core=50, l.pen=0)
+
+StammMSEcvK.plot(fit.K$mse.cv, k.states=1:5)
+StammStab.plot(fit.m$fit, m.v=m.cl, m.init=2, k.states=k.stt)
+i.k <- which(k.stt==fit.K$hat.K)
+StammStabPen.plot(fit.K$fit, fit.K$fit.cv[[i.k]], t.dat)
View
6 stamm/R/auxfunc.r
@@ -89,10 +89,10 @@ mse.p <- ggplot(mse.df, aes(x=k, y=mse)) +
return(mse.p)
}
-StammStab.plot <- function(fit.k, m.v, m.init=2) {
+StammStab.plot <- function(fit.k, m.v, m.init=2, k.states=1:5) {
if (m.init > 1)
- m.v <- m.cl[-(1:(m.init -1))]
+ m.v <- m.v[-(1:(m.init -1))]
f.corr <- matrix(NA, length(fit.k), length(m.v))
for (i.k in 1:length(fit.k)) {
fit <- fit.k[[i.k]]
@@ -115,7 +115,7 @@ return(stab.m)
StammStabPen.plot <- function(fit, fit.m, t.dat) {
-beta=(as.vector(fit$fit.genes$beta))
+ beta=(as.vector(fit$fit.g$beta))
type <- rep(gsub('[^0-9]', "", names(fit.m$fit.genes), perl=TRUE), each=length(beta))
beta.vec <- NULL
for (i in 1:(length(t.dat) - 1)){
View
3  stamm/R/func_runStamm.r
@@ -48,9 +48,6 @@ StammMSEcv.K <- function(g.dat, t.dat, k.states=1:5, hat.m=13, n.core=50, l.pen=
names(fit.cv) <- paste("K=", k.states, sep="")
names(mse) <- paste("K=", k.states, sep="")
- fit <- FitClGns(g.dat, t.dat, l.pen=l.pen, k.stt=k.states[i.k],
- m=m.cl[i.m], pll=TRUE, n.core=n.core)
-
hat.K <- k.states[which(mse == min(mse))]
if (hat.K != max(k.states)){
View
BIN  stamm_0.8.tar.gz
Binary file not shown
Please sign in to comment.
Something went wrong with that request. Please try again.