- Fixed lots of minor things that caused
check
errors- Vignette: minor edits to fix recent build errors
- Moved external package imports from R code to
DESCRIPTION
, adding missing packages, and fixed namespaces. - Corrected function arguments and usage discrepancies.
- Added this
NEWS.md
file to track changes to the package.
Overview:
- Added unit tests to almost all functions
- Basic uses are covered (default optional parameters), and some but not all advanced uses
- Minor user-facing changes:
- Moved mandatory arguments to the front (no backward-incompatible problems since these arguments had to be called by name unless the earlier optional arguments were also present and were passed unnamed (rare))
- Added more informative error messages for missing mandatory arguments, objects with wrong classes, and covariate dimension disagreements
- Minor bug fixes (some
s = 1
edge cases) - Eliminated all non-error/warning verbosity when
verbose = FALSE
.
Additional details:
- Function
jackstraw_cluster
- Added option
pool
(defaultTRUE
) to calculate p-values by pooling null statistics (to matchjackstraw_kmeans
option and default). Previously the hardcoded behavior matchedpool = FALSE
.
- Added option
- Functions
jackstraw_lfa
,jackstraw_alstructure
,jackstraw_pca
,jackstraw_rpca
,jackstraw_irlba
,jackstraw_subspace
:- Argument
r
is now second argument.lfa
,alstructure
,subspace
versions:r
does not have a default value and it is mandatory.
- Argument
- Functions
jackstraw_kmeans
,jackstraw_kmeanspp
,jackstraw_MiniBatchKmeans
,jackstraw_pam
,jackstraw_cluster
:- Debugged
s = 1
edge case: null data used to be centered incorrectly. Bug only occurred in combination withcenter = TRUE
(default).
- Debugged
- Internal (unexported) function
RSS
now returns actual residual sum of squares. This change does not affect any exported functions that use it. PreviouslyRSS
calculated a normalized version (equal to1 - R^2
), but this normalization canceled out inFSTAT
(its only downstream use), so the normalization had no user-facing effect.
Exclusive list of functions without unit tests (all are redundant with other packages, so they are candidates for removal in the near future):
- Exported:
lfa.corpcor
(redundant withlfa::lfa
)pi0est_bootstrap
(redundant withqvalue::pi0est
)
- Internal, no exported backward dependencies:
getp
(redundant withqvalue::empPvals
)devdiff_parallel
(redundant withgcatest::gcat.stat
)
- Functions
jackstraw_pca
,jackstraw_rpca
,jackstraw_irlba
: Corrected documentation (parameterr1
was incorrectly described asPC
in parts of the documentation. Thanks to Djordje Bajić (GitHub usernamedjbajic
) for reporting this error! - Removed option
seed
from all functions that had it. For the same behavior, callset.seed(seed)
before calling the function. - Functions
jackstraw_lfa
andjackstraw_alstructure
: removeddevR
option. - Removed redundant functions
lfa.corpcor
: same aslfa::lfa
with optionoverride = TRUE
pi0est_bootstrap
: redundant withqvalue::pi0est
with optionpi0.method = 'bootstrap'
dev.R
(internal; functionality implemented in packagegcatest
)devdiff_parallel
(internal; redundant withgcatest::gcat.stat
)getp
(internal; redundant withqvalue::empPvals
)
- Function
jackstraw_lfa
now accepts genotypes input asBEDMatrix
objects. In this case, the function operates on a low-memory mode, keeping data on disk rather than memory as much as possible, and writes permuted data into temporary files as well. To enable this mode, theBEDMatrix
andgenio
packages are now dependencies. Note onlyjackstraw_lfa
supportsBEDMatrix
becauselfa
supports it too (most recent fork; see below). - Removed function
devdiff
, which is redundant (and replaced internally) withgcatest::delta_deviance_lf
, a function that supports more special cases, including genotypes accessed through aBEDMatrix
object. The only internal dependencies werejackstraw_lfa
andjackstraw_alstructure
. - Updated
README.md
to instruct users to install the most updated forks oflfa
andgcatest
on GitHub (under usernamealexviiia
), rather than the Bioconductor versions that are lacking critical updates.
- Version was not bumped accidentally
- Removed old vignette
- Fixed a small error in
jackstraw_lfa
example
- All
jackstraw_*
functions now returnNA
p-values forNA
statistics.- Before
NA
statistics resulted in p-values of 1 instead, which is whatqvalue::empPvals
returns. Now an internal wrapper function ensures the desired behavior.
- Before
- Removed two
jackstraw_pam
toy example unit tests that failed often due to colinearity. - Reformatted this
NEWS.md
slightly to improve its automatic parsing.
- Heavy updates to
README.md
- Updated summary in
DESCRIPTION
- Updated paper citations and URLs across function documentation
- Bumped version to exceed CRAN versions (which are currently on a separate branch due to temporary issues with dependencies
lfa
andgcatest
)
- Function
jackstraw_MiniBatchKmeans
: internally addedsuppressWarnings
wrapper aroundClusterR::predict_MBatchKMeans
to silence a misleading deprecation warning. The function as a whole is not deprecated, but its output for a case we don't use (fuzzy=TRUE) is changing in the future. Warning message now being suppressed:predict_MBatchKMeans()
was deprecated inClusterR
1.3.0.- Beginning from version 1.4.0, if the fuzzy parameter is TRUE the function
predict_MBatchKMeans
will return only the probabilities, whereas currently it also returns the hard clusters
- Removed strict dependence of the
alstructure
R package (on GitHub only), user now has to provide the function to apply to data forjackstraw_alstructure
to work. - Documentation
- Corrected citation links for two similar papers
- Function documentation (.Rd files) was actually updated as described in the last version (last commit had source .R files edited but not their .Rd counterparts).
- Added a recent missing
NEWS.md
entry - Replaced two links that gave errors in
README.md
Changes manually ported from latest CRAN branch:
- Minor non-code edits
- Spell checked documentation
- Changed to single maintainer (Neo)
- Removed
VignetteBuilder: knitr
since there's no vignette anymore - Fixed broken or outdated URLs
- Removed package dependency
parallel
which is not being used. - Removed many package suggested dependencies (
knitr
,rmarkdown
,ggplot2
,mutoss
,Matrix
,gridExtra
,cowplot
,scales
,formatR
) that were only used in a vignette currently not being built. - Reduced example dimensions for
jackstraw_irlba
andjackstraw_rpca
by 5 to keep their runtime low.
- Function
jackstraw_lfa
added optionpermute_alleles
, to change default genotype permutation to an allele-level permutation algorithm that results in much more Binomial data, particularly when input data is highly structured.
README
edited installation instructions to reflect that dependencieslfa
andgcatest
are now updated on Bioconductor (no need to install GitHub versions) andalstructure
is now optional.- Function
jackstraw_lfa
changed optionpermute_alleles
to default toTRUE
, which performs much better, and documentation now recommends against changing that option except for research purposes. - Corrected typos throughout, and marked code as such to prevent false positives.
- CRAN submission
- DESCRIPTION replaced
Author
andMaintainer
withAuthors@R
field - Function
jackstraw_lfa
silenced warnings that occurs only if input isBEDMatrix
object and OS is Windows, in which case some temporary files cannot be deleted during the R session. - Created
cran-comments.md
README
edited. Use cases as a separate subsection.- Description in
DESCRIPTION
edited.
- Use DOIs instead of publication URLs, as required by CRAN.
- Moved Bioconductor dependencies (
qvalue
,lfa
, andgcatest
) from Imports to Suggests, as required by CRAN. Dependent functions will now only work if those packages are installed:- Package
qvalue
is required for functionpip
. - Package
lfa
is required for functionspseudo_Rsq
andefron_Rsq
, and in practice forjackstraw_lfa
too. - Package
gcatest
is required for functionsjackstraw_alstructure
andjackstraw_lfa
. - Function
jackstraw_lfa
now requires optionFUN
to be defined and provided by the user (it used to default to thelfa
function) - Internal function
empPvals
is now a copy of the function of the same name in theqvalue
package, with minor adaptations. This is to ensure mostjackstraw
functions, which depend onempPvals
, work withoutqvalue
.
- Package
m
increased in unit tests to pass building in CRANr-devel-windows-x86_64
README
edited
- Added two functions for calculating high precision p-values from the data output by
jackstraw_lfa
andjackstraw_alstructure
:ncp_est
: estimates parameter of non-central chi squared distribution from samples.pvals_nc_chisq
: usesncp_est
to fit a non-central chi squared model to the Jackstraw null statistics, then calculates p-values from this model for the observed statistics.
- New package dependency
stats4
added to calculate maximum likelihood estimates of the non-centrality parameter. - Internally, documentation now uses Markdown shortcuts.
- Minor documentation updates to functions
jackstraw_lfa
andpvals_nc_chisq
- P-values of 0 from a non-central chi squared model are set to
.Machine$double.xmin
inpvals_nc_chisq