March 18
	Set prior weights to be counts + prior count
		based on Poisson delta method


Nov 27,
	note that augmentPriorCount() can cause log CPM values to be different
	from standard methods for low counts 

Nov 14, 
	Get BIC for each fit for lmFit().  Alreaday works with lmer

Nov 12, 2023
	Push latest version to Bioc
	voomWithDreamWeights() should allow users to change pseudocount


Oct 6, 2023
	See ~/Downloads/RUSH.RDATA

	Since genes are dropped by voomWithDreamWeights(),  the out$weights and weightsMatrix are no longer the same size:

	https://github.com/GabrielHoffman/variancePartition/blob/3b7b52f14ffe47a28425e05da001fbd785874318/R/voomWithDreamWeights.R#L245C36-L245C47

	Need to match names instead



Upload to Bioconductor once remaCor 0.0.16 is accepted to CRAN

June 15, 2023
	Parallelize mvTest() with iterator


June 2, 2023
	DONE: Reproducable RNG

		# Use on.exit({})
		# withRandom <- function(expr, seed = 1) {
		#     old <- .Random.seed
		#     on.exit({.Random.seed <<- old})
		#     set.seed(seed)
		#     expr
		# }
		# use with options() and omp_set_threads

		# Use seed with LS.empirical




March 14, 2023
	in deviation() add pearson residuals
	need to pass in y= vobj


Feb 28
DONE: Zenith on mvTest results


April 19, 2021
	Add treat and topTreat

March 30, 2021
	check dream + eBayes with trend and robust


#Authors@R: c(person("Gabriel", "Hoffman", role = c("aut", "cre"), email = "gabriel.hoffman@mssm.edu"))


DONE!
March 18, 2021
	info must be casted to a data.frame since DataFrame is not handled correctly
		and gives error:
		Error in if (inherits(possibleError, "error") && grep("the fixed-effects model matrix is column rank deficient",  : 
	  missing value where TRUE/FALSE needed

	droplevels in dream


# November 2, 2020
- integrate voomWithQualityWeights() with voomWithDreamWeights
	o Need to convert lm.fit() calls to dream()
	o Need to dream() to return hatvalues



recommend placing a check to verify if the names in the info matrix, match with the names used in the formula and return an error if not




library(BiocParallel)

# globally specify that all multithreading using bpiterate from BiocParallel
# should use 8 cores
register(SnowParam(8))

# By default it is set to the max number of CPUs
# If you have a very long interactive session, this can crash and you get the error you see

Alternatively, you can specify and restart the parallel backend every function call


fitExtractVarPartModel(..., BPPARAM=SnowParam(8))

fitVarPartModel(..., BPPARAM=SnowParam(8))

dream(..., BPPARAM=SnowParam(8))



# July 18, 2018
Check if there is variation in each gene.  
	else throw error


# June 16, 2016
Improve warnings in fitVarPart and fitExtractVarPart to show which gene give a warning

# April 16, 2016
 Make correlation matrix and linear mixed model equantions in vignette
 the same as in supplement.  The vignette examples are wrong

Add canCorPairs to the vignette


# Feb 18, 2015
add e_{i,k} in ICC correlation equation


# December 14, 2015

# Add strong warning to fitVarPartModel() that estimates memory usage.  In vignette, users should be discoraged from using this interface.

# use refit() to fit the model for each gene:
#  cannot do this because refit() doesn't accept new weights

# DE test: show increased power when correlation is overestimated, and decrease false positive rate when correlation is underestimated.  (order is correct?)  





# adjust doesn't work with varying coefficient model, but it throwings an error now

# run simulations with varying coefficient model