# NOT RUN {
dat <- rbind(matrix(c(rep(3, 16), rep(8, 24)), ncol=5),
matrix(c(rep(5, 16), rep(5, 24)), ncol=5),
matrix(c(rep(18, 16), rep(7, 24)), ncol=5)) +
matrix(runif(120,-1,1), ncol=5)
trainlabel <- c(1,1,2,2,2)
DNMF_result <- DNMF(dat, trainlabel, r=2)
# }
# NOT RUN {
# Gene ranking. dat is the raw read count maatrix with sample in column.
#normalising dat
Sizefactors <- DESeq::estimateSizeFactorsForMatrix(dat)
dat = sweep(dat, 2, Sizefactors, `/`)
res <- DNMF(dat, trainlabel, r=2)
rnk <- res$rnk
#The end of gene ranking exmaples
#Other exmaples
DNMF_result <- DNMF(dat, trainlabel, r=2, gamma=0.1, delta=0.0001, plotit=TRUE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab