\HeaderA{maanova-internal}{Internal maanova functions}{maanova.Rdash.internal}
\aliasA{blkdiag}{maanova-internal}{blkdiag}
\aliasA{buildtree}{maanova-internal}{buildtree}
\aliasA{caldf}{maanova-internal}{caldf}
\aliasA{calPval}{maanova-internal}{calPval}
\aliasA{calVolcanoXval}{maanova-internal}{calVolcanoXval}
\aliasA{check.confounding}{maanova-internal}{check.confounding}
\aliasA{checkContrast}{maanova-internal}{checkContrast}
\aliasA{cluster2num}{maanova-internal}{cluster2num}
\aliasA{colmax}{maanova-internal}{colmax}
\aliasA{colmin}{maanova-internal}{colmin}
\aliasA{consensus.hc}{maanova-internal}{consensus.hc}
\aliasA{consensus.kmean}{maanova-internal}{consensus.kmean}
\aliasA{dist.cor}{maanova-internal}{dist.cor}
\aliasA{fdr}{maanova-internal}{fdr}
\aliasA{findgroup}{maanova-internal}{findgroup}
\aliasA{getPval.table}{maanova-internal}{getPval.table}
\aliasA{getPval.volcano}{maanova-internal}{getPval.volcano}
\aliasA{glowess}{maanova-internal}{glowess}
\aliasA{intprod}{maanova-internal}{intprod}
\aliasA{JS}{maanova-internal}{JS}
\aliasA{JSshrinker}{maanova-internal}{JSshrinker}
\aliasA{linlog}{maanova-internal}{linlog}
\methaliasA{linlog.engine}{maanova-internal}{linlog.engine}
\aliasA{linlogshift}{maanova-internal}{linlogshift}
\aliasA{locateTerm}{maanova-internal}{locateTerm}
\aliasA{ma.svd}{maanova-internal}{ma.svd}
\aliasA{make.ratio}{maanova-internal}{make.ratio}
\aliasA{makeAB}{maanova-internal}{makeAB}
\aliasA{makeCompMat}{maanova-internal}{makeCompMat}
\aliasA{makeContrast}{maanova-internal}{makeContrast}
\aliasA{makeD}{maanova-internal}{makeD}
\aliasA{makeDesign}{maanova-internal}{makeDesign}
\aliasA{makeHq}{maanova-internal}{makeHq}
\aliasA{makelevel}{maanova-internal}{makelevel}
\aliasA{makeModel}{maanova-internal}{makeModel}
\aliasA{makeShuffleGroup}{maanova-internal}{makeShuffleGroup}
\aliasA{makeZiZi}{maanova-internal}{makeZiZi}
\aliasA{matest.engine}{maanova-internal}{matest.engine}
\aliasA{matest.perm}{maanova-internal}{matest.perm}
\aliasA{matrank}{maanova-internal}{matrank}
\aliasA{matsort}{maanova-internal}{matsort}
\aliasA{meanvarlog}{maanova-internal}{meanvarlog}
\aliasA{meanvarlogold}{maanova-internal}{meanvarlogold}
\aliasA{mixed}{maanova-internal}{mixed}
\aliasA{mixture}{maanova-internal}{mixture}
\aliasA{norm}{maanova-internal}{norm}
\aliasA{num2yn}{maanova-internal}{num2yn}
\aliasA{ones}{maanova-internal}{ones}
\aliasA{parseformula}{maanova-internal}{parseformula}
\aliasA{pinv}{maanova-internal}{pinv}
\aliasA{plot.consensus.hc}{maanova-internal}{plot.consensus.hc}
\aliasA{plot.consensus.kmean}{maanova-internal}{plot.consensus.kmean}
\aliasA{print.madata}{maanova-internal}{print.madata}
\aliasA{print.summary.madata}{maanova-internal}{print.summary.madata}
\aliasA{print.summary.mamodel}{maanova-internal}{print.summary.mamodel}
\aliasA{ratioVarplot}{maanova-internal}{ratioVarplot}
\aliasA{repmat}{maanova-internal}{repmat}
\aliasA{rlowess}{maanova-internal}{rlowess}
\aliasA{rowmax}{maanova-internal}{rowmax}
\aliasA{rowmin}{maanova-internal}{rowmin}
\aliasA{shift}{maanova-internal}{shift}
\aliasA{shuffle.maanova}{maanova-internal}{shuffle.maanova}
\aliasA{solveMME}{maanova-internal}{solveMME}
\aliasA{summary.madata}{maanova-internal}{summary.madata}
\aliasA{summary.mamodel}{maanova-internal}{summary.mamodel}
\aliasA{summarytable.ftest}{maanova-internal}{summarytable.ftest}
\aliasA{summarytable.ttest}{maanova-internal}{summarytable.ttest}
\aliasA{sumrow}{maanova-internal}{sumrow}
\aliasA{transform.rawdata}{maanova-internal}{transform.rawdata}
\aliasA{volcano.ftest}{maanova-internal}{volcano.ftest}
\aliasA{volcano.ttest}{maanova-internal}{volcano.ttest}
\aliasA{zeros}{maanova-internal}{zeros}
\keyword{internal}{maanova-internal}
\begin{Description}\relax
Internal maanova functions. These are generally not to be called by
the user.
\end{Description}
\begin{Usage}
\begin{verbatim}
JS(X, var)
JSshrinker(X, df, meanlog, varlog)
buildtree(ct, binstr, depth, parent, idx.node, idx.leave)
calPval(fstar, fobs, pool)
calVolcanoXval(matestobj)
caldf(model, term)
check.confounding(model, term1, term2)
checkContrast(model, term, Contrast)
cluster2num(clust)
consensus.hc(macluster, level, draw)
consensus.kmean(macluster, level, draw)
dist.cor(x)
findgroup(varid, ndye)
getPval.volcano(matestobj, method, idx)
glowess(object, method, f, iter, degree, draw)
intprod(terms, intterm)
linlog(object, cg, cr, draw)
linlog.engine(data, cutoff)
linlogshift(object, lolim, uplim, cg, cr, n.bin, draw)
locateTerm(labels, term)
make.ratio(object, norm.std=TRUE)
makeAB(ct, coord, treeidx, startx, maxdepth)
makeCompMat(n)
makeD(s20, dimZ)
makeDesign(design)
makeHq(s20, y, X, Z, Zi, ZiZi, dim, b, method)
makeShuffleGroup(sample.mtx, ndye, narray)
makeZiZi(Z, dimZ)
makelevel(model, term)
matest.engine(anovaobj, term, mv, test.method, Contrast,
              is.ftest, partC, verbose=FALSE)
matest.perm(n.perm, FobsObj, data, model, term, Contrast, 
            mv, is.ftest, partC, MME.method, test.method,
            shuffle.method, pool.pval, ngenes)
meanvarlog(df)
## S3 method for class 'consensus.hc':
plot(x, title, ...)
## S3 method for class 'consensus.kmean':
plot(x, ...)
## S3 method for class 'madata':
print(x, ...)
## S3 method for class 'summary.mamodel':
print(x, ...)
ratioVarplot(logsum, logdiff, n)
rlowess(object, method, grow, gcol, f, iter, degree, draw)
shift(object, lolim, uplim, draw)
shuffle.maanova(data, model, term)
solveMME(s20, dim, XX, XZ, ZZ, a)
## S3 method for class 'madata':
summary(object, ...)
## S3 method for class 'mamodel':
summary(object, ...)
volcano.ftest(matestobj, threshold, method, title,highlight.flag)
volcano.ttest(matestobj, threshold, method, title,highlight.flag,
   onScreen)
matsort(mat, index=1)
repmat(mat, n.row, n.col, ...)
zeros(dim)
ones(dim)
blkdiag(...)
rowmax(x)
rowmin(x)
colmax(x)
colmin(x)
sumrow(x)
matrank(X)
norm(X)
mixed(y, X, Z, XX, XZ, ZZ, Zi, ZiZi, dimZ, s20, method =
      c("noest", "MINQE-I", "MINQE-UI", "ML", "REML"),
      maxiter = 100)
parseformula(formula, random, covariate)
makeContrast(model, term)
pinv(X, tol)
ma.svd(x, nu=min(n,p), nv=min(n,p), method=c("dgesvd","dgesdd"))
fdr(p, method = c("stepup", "adaptive", "stepdown", 'jsFDR'))
\end{verbatim}
\end{Usage}
\begin{Details}\relax
Some funtion descriptions are:
\Itemize{
\item matsort: Sort matrix in ascending order along specified dimension
\item repmat: Replicate and tile an array
\item zeros: Create an array with all zeros
\item ones: Create an array with all ones
\item blkdiag: Block diagonal concatenation of input arguments
\item num2yn: convert a logical value to string "Yes" or "No"
\item rowmax, rowmin, colmax, colmin: find the maximum/minimum value
for row/columns
\item sumrow: calculate the sum of rows for a given matrix
\item matrank: calculate the rank of a matrix
\item norm: calculate matrix or vector norm, working only for vector
now
\item mixed: engine function to solve Mixed Model Equations using EM
algorithm
\item parseformula: parse input formula. This is used for mixed
effect model
\item makeDesign: function to make a integer list from input design object
\item intpord: function to make the design matrix for interaction terms
it's working for two way interaction only
\item makeContrast: function to make the contrast matrix given model
and the term to be tested
number of levels
\item pinv: calculate the pseudo inverse for a singular matrix.
Note that I was using ginv function in MASS but it is not
robust, e.g., sometimes have no result. That's because
the engine function dsvdc set the maximum number of iteration
to be 30, which is not enough in some case.
I use La.svd instead of svd in my function.
I don't want to spend time on it so it doesn't support complex
number
\item ma.svd: function to compute the sigular-value decomposition 
of a rectangular matrix by using LAPACK routines DEGSVD AND ZGESVD.
\item fdr: function to calculate the adjusted P values for FDR control.
}
\end{Details}
\begin{Author}\relax
Hao Wu;  Hyuna Yang, \email{hyuna.yang@jax.org}
\end{Author}
\begin{Examples}
\begin{ExampleCode}
# for matsort
a<-matrix(c(1,6,4,3,5,2),2,3)
matsort(a,1)
matsort(a,2)

# for ones and zeros
ones(c(2,2))
zeros(c(2,3,2))

# for repmat
a<-c(1,2)
repmat(a,2,1)
a<-matrix(1:4,2,2)
repmat(a,1,2)

# for blkdiag
a<-matrix(1:4,2,2)
b<-matrix(3:6,2,2)
blkdiag(a,b)
blkdiag(a,b,c(1,2))

# others examples are omitted

\end{ExampleCode}
\end{Examples}

