DNMF | R Documentation |
Discriminant Non-Negative Matrix Factorization, DNMF, is to extend the Non-negative Matrix Factorization algorithm in order to extract features that enforce not only the spatial locality, but also the separability between classes in a discriminant manner.
DNMF( data, trainlabel, r = 2, gamma = 0.1, delta = 1e-04, maxIter = 1000, tol = 1e-07, log = TRUE, plotit = FALSE, checkH = TRUE, ... )
data |
a matrix, like expression profilings of some samples. the columns are samples and the rows are gene's expression. |
trainlabel |
a numeric vector of sample type of all the samples, this vector should ONLY contain 1 and 2 so far and length of it should equal the column (sample) size of data. |
r |
the dimension of expected reduction dimension, with the default value 2. |
gamma |
the tradeoff value for the within scatter matrix, with the default value 0.1. |
delta |
the tradeoff value for the between scatter matrix, with the default value 1e-4. |
maxIter |
the maximum iteration of update rules, with the default value 1000. |
tol |
the toleration of coverange, with the default value 1e-7. |
log |
log2 data. Default is TRUE. |
plotit |
whether plot H (V=WH). Default: FALSE. |
checkH |
whether or not check H. Default: TRUE. This parameter aims to check whether or not the H safisfy the discriminant metagenes. Usually, this should be TRUE. |
... |
to gplots::heatmap.2 |
The main algorithm is based on Zafeiriou, S., et al. (2006) Exploiting discriminant information in nonnegative matrix factorization with application to frontal face verification, IEEE transactions on neural networks, 17, 683-695, with some CORRECTIONs.
Zhilong Jia and Xiang Zhang
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) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.