Package: locStra 1.9

locStra: Fast Implementation of (Local) Population Stratification Methods

Fast implementations to compute the genetic covariance matrix, the Jaccard similarity matrix, the s-matrix (the weighted Jaccard similarity matrix), and the (classic or robust) genomic relationship matrix of a (dense or sparse) input matrix (see Hahn, Lutz, Hecker, Prokopenko, Cho, Silverman, Weiss, and Lange (2020) <doi:10.1002/gepi.22356>). Full support for sparse matrices from the R-package 'Matrix'. Additionally, an implementation of the power method (von Mises iteration) to compute the largest eigenvector of a matrix is included, a function to perform an automated full run of global and local correlations in population stratification data, a function to compute sliding windows, and a function to invert minor alleles and to select those variants/loci exceeding a minimal cutoff value. New functionality in locStra allows one to extract the k leading eigenvectors of the genetic covariance matrix, Jaccard similarity matrix, s-matrix, and genomic relationship matrix via fast PCA without actually computing the similarity matrices. The fast PCA to compute the k leading eigenvectors can now also be run directly from 'bed'+'bim'+'fam' files.

Authors:Georg Hahn [aut,cre], Sharon M. Lutz [ctb], Christoph Lange [ctb]

locStra_1.9.tar.gz
locStra_1.9.zip(r-4.7)locStra_1.9.zip(r-4.6)locStra_1.9.zip(r-4.5)
locStra_1.9.tgz(r-4.6-x86_64)locStra_1.9.tgz(r-4.6-arm64)locStra_1.9.tgz(r-4.5-x86_64)locStra_1.9.tgz(r-4.5-arm64)
locStra_1.9.tar.gz(r-4.6-arm64)locStra_1.9.tar.gz(r-4.6-x86_64)locStra_1.9.tar.gz(r-4.5-arm64)locStra_1.9.tar.gz(r-4.5-x86_64)
locStra_1.9.tgz(r-4.5-emscripten)
locStra.pdf |locStra.html
locStra/json (API)

# Install 'locStra' in R:
install.packages('locStra', repos = c('https://ghahn-hsph.r-universe.dev', 'https://cloud.r-project.org'))
Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

Conda:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

cpp

1.00 score 4 scripts 272 downloads 16 exports 61 dependencies

Last updated from:da62338e09. Checks:13 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK179
linux-devel-x86_64OK184
source / vignettesOK197
linux-release-arm64OK184
linux-release-x86_64OK186
macos-release-arm64OK171
macos-release-x86_64OK304
macos-oldrel-arm64OK172
macos-oldrel-x86_64OK493
windows-develOK174
windows-releaseOK156
windows-oldrelOK275
wasm-releaseOK140

Exports:bed_fastCovEVsbed_fastGrmEVsbed_fastJaccardEVsbed_fastSMatrixEVscovMatrixfastCovEVsfastGrmEVsfastJaccardEVsfastSMatrixEVsfullscangrMatrixjaccardMatrixmakeWindowspowerMethodselectVariantssMatrix

Dependencies:BHbigassertrbigparallelrbigreadrbigsnprbigsparserbigstatsrbigutilsrbitclicodetoolscowplotcpp11data.tableDEoptimRdigestdoParalleldoRNGfarverffflockforeachggplot2gluegtableisobanditeratorslabelinglatticelifecyclemagrittrMatrixnaborparallellypillarpkgconfigpsR6rbibutilsRColorBrewerRcppRcppArmadilloRcppEigenRdpackRhpcBLASctlrlangrmiorngtoolsrobustbaseroptimRSpectrarunonceS7scalestibbletriebeardurltoolsutf8vctrsviridisLitewithr

Readme and manuals

Help Manual

Help pageTopics
Computation of the k leading eigenvectors of the covariance matrix directly from a bed+bim+fam file.bed_fastCovEVs
Computation of the k leading eigenvectors of the genomic relationship matrix, defined in Yang et al. (2011), directly from a bed+bim+fam file.bed_fastGrmEVs
Computation of the k leading eigenvectors of the Jaccard similarity matrix directly from a bed+bim+fam file.. Note that this computation is only approximate and does not necessarily coincide with the result obtained by extracting the k leading eigenvectors of the Jaccard matrix computed with the function 'jaccardMatrix'.bed_fastJaccardEVs
Computation of the k leading eigenvectors of the s-matrix (the weighted Jaccard similarity matrix) directly from a bed+bim+fam file. Note that in contrast to the parameters of the function 'sMatrix', the choice 'phased=FALSE' cannot be modified for the fast eigenvector computation. Moreover, inverting the minor allele is not possible when reading directly from external files.bed_fastSMatrixEVs
C++ implementation to compute the covariance matrix for a (sparse) input matrix. The function is equivalent to the R command 'cov' applied to matrices.covMatrix
Computation of the k leading eigenvectors of the covariance matrix for a (sparse) input matrix.fastCovEVs
Computation of the k leading eigenvectors of the genomic relationship matrix, defined in Yang et al. (2011), for a (sparse) input matrix.fastGrmEVs
Computation of the k leading eigenvectors of the Jaccard similarity matrix for a (sparse) input matrix. Note that this computation is only approximate and does not necessarily coincide with the result obtained by extracting the k leading eigenvectors of the Jaccard matrix computed with the function 'jaccardMatrix'.fastJaccardEVs
Computation of the k leading eigenvectors of the s-matrix (the weighted Jaccard similarity matrix) for a (sparse) input matrix. Note that in contrast to the parameters of the function 'sMatrix', the choice 'phased=FALSE' cannot be modified for the fast eigenvector computation.fastSMatrixEVs
A full scan of the input data 'm' using a collection of windows given by the two-column matrix 'windows'. For each window, the data is processed using the function 'matrixFunction' (this could be, e.g., the 'covMatrix' function), then the processed data is summarized using the function 'summaryFunction' (e.g., the largest eigenvector computed with the function 'powerMethod'), and finally the global and local summaries are compared using the function 'comparisonFunction' (e.g., the vector correlation with R's function 'cor'). The function returns a two-column matrix which contains per row the global summary statistics (e.g., the correlation between the global and local eigenvectors) and the local summary statistics (e.g., the correlation between the local eigenvectors of the previous and current windows) for each window.fullscan
C++ implementation to compute the genomic relationship matrix (grm) for a (sparse) input matrix as defined in Yang et al. (2011).grMatrix
C++ implementation to compute the Jaccard similarity matrix for a (sparse) input matrix.jaccardMatrix
Auxiliary function to generate a two-column matrix of windows to be used in the function 'fullscan'.makeWindows
C++ implementation of the power method (von Mises iteration) to compute the largest eigenvector of a dense input matrix.powerMethod
Auxiliary function to invert minor alleles and to select those variants/loci exceeding a minimal cutoff value.selectVariants
C++ implementation to compute the s-matrix (the weighted Jaccard similarity matrix) for a (sparse) input matrix as in the 'Stego' package: https://github.com/dschlauch/stegosMatrix
Simulated test data.testdata