From abed44b6d0e8e620e7e5f68e2ad0ca10813457bd Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 11:31:39 +0200 Subject: [PATCH 01/11] add vignette data to R-package redo to pass devtools::check() --- .gitignore | 7 ------- R-package/inst/extdata/anno1.bed | 5 +++++ R-package/inst/extdata/anno2.bed | 3 +++ R-package/inst/extdata/genotype_1.bed | Bin 0 -> 8 bytes R-package/inst/extdata/genotype_1.bim | 5 +++++ R-package/inst/extdata/genotype_1.fam | 4 ++++ R-package/inst/extdata/genotype_X.bed | Bin 0 -> 6 bytes R-package/inst/extdata/genotype_X.bim | 3 +++ R-package/inst/extdata/genotype_X.fam | 4 ++++ R-package/inst/extdata/genotype_X.ploidy | 3 +++ R-package/inst/extdata/reference_chr1.bim | 5 +++++ R-package/inst/extdata/reference_chrX.bim | 3 +++ R-package/inst/extdata/traits.tsv.gz | Bin 0 -> 138 bytes 13 files changed, 35 insertions(+), 7 deletions(-) create mode 100644 R-package/inst/extdata/anno1.bed create mode 100644 R-package/inst/extdata/anno2.bed create mode 100644 R-package/inst/extdata/genotype_1.bed create mode 100644 R-package/inst/extdata/genotype_1.bim create mode 100644 R-package/inst/extdata/genotype_1.fam create mode 100644 R-package/inst/extdata/genotype_X.bed create mode 100644 R-package/inst/extdata/genotype_X.bim create mode 100644 R-package/inst/extdata/genotype_X.fam create mode 100644 R-package/inst/extdata/genotype_X.ploidy create mode 100644 R-package/inst/extdata/reference_chr1.bim create mode 100644 R-package/inst/extdata/reference_chrX.bim create mode 100644 R-package/inst/extdata/traits.tsv.gz diff --git a/.gitignore b/.gitignore index 2685784..6c9b191 100644 --- a/.gitignore +++ b/.gitignore @@ -26,13 +26,6 @@ venv/ *.asv octave-workspace -# Generated R package extdata copied from canonical tests/fixtures sources -/R-package/inst/extdata/*.bim -/R-package/inst/extdata/*.bed -/R-package/inst/extdata/*.fam -/R-package/inst/extdata/*.ploidy -/R-package/inst/extdata/*.tsv.gz - # Claude Code .claude/ diff --git a/R-package/inst/extdata/anno1.bed b/R-package/inst/extdata/anno1.bed new file mode 100644 index 0000000..2f65ef7 --- /dev/null +++ b/R-package/inst/extdata/anno1.bed @@ -0,0 +1,5 @@ +1 99 150 +1 120 200 +1 299 350 +1 350 400 +1 499 500 diff --git a/R-package/inst/extdata/anno2.bed b/R-package/inst/extdata/anno2.bed new file mode 100644 index 0000000..6f43168 --- /dev/null +++ b/R-package/inst/extdata/anno2.bed @@ -0,0 +1,3 @@ +X 99 100 +X 195 205 +X 198 302 diff --git a/R-package/inst/extdata/genotype_1.bed b/R-package/inst/extdata/genotype_1.bed new file mode 100644 index 0000000000000000000000000000000000000000..e45ce38f9350148a43a82337cc8c03bb01e07c15 GIT binary patch literal 8 Mcmd0iW@G>X00b)li2wiq literal 0 HcmV?d00001 diff --git a/R-package/inst/extdata/genotype_1.bim b/R-package/inst/extdata/genotype_1.bim new file mode 100644 index 0000000..d3bc14a --- /dev/null +++ b/R-package/inst/extdata/genotype_1.bim @@ -0,0 +1,5 @@ +1 rs1001 0 100 A G +1 rs1002 0 200 C T +1 rs1003 0 300 A C +1 rs1004 0 400 G A +1 rs1005 0 500 T C diff --git a/R-package/inst/extdata/genotype_1.fam b/R-package/inst/extdata/genotype_1.fam new file mode 100644 index 0000000..0404210 --- /dev/null +++ b/R-package/inst/extdata/genotype_1.fam @@ -0,0 +1,4 @@ +FAM1 IND1 0 0 1 -9 +FAM1 IND2 0 0 2 -9 +FAM2 IND3 0 0 1 -9 +FAM2 IND4 0 0 2 -9 diff --git a/R-package/inst/extdata/genotype_X.bed b/R-package/inst/extdata/genotype_X.bed new file mode 100644 index 0000000000000000000000000000000000000000..cca7f590e538874f49051ce56b692230588f7f1e GIT binary patch literal 6 Ncmd0iW@KPs0009S0Eqwq literal 0 HcmV?d00001 diff --git a/R-package/inst/extdata/genotype_X.bim b/R-package/inst/extdata/genotype_X.bim new file mode 100644 index 0000000..a90c087 --- /dev/null +++ b/R-package/inst/extdata/genotype_X.bim @@ -0,0 +1,3 @@ +X rsX001 0 100 A G +X rsX002 0 200 C T +X rsX003 0 300 A C diff --git a/R-package/inst/extdata/genotype_X.fam b/R-package/inst/extdata/genotype_X.fam new file mode 100644 index 0000000..0404210 --- /dev/null +++ b/R-package/inst/extdata/genotype_X.fam @@ -0,0 +1,4 @@ +FAM1 IND1 0 0 1 -9 +FAM1 IND2 0 0 2 -9 +FAM2 IND3 0 0 1 -9 +FAM2 IND4 0 0 2 -9 diff --git a/R-package/inst/extdata/genotype_X.ploidy b/R-package/inst/extdata/genotype_X.ploidy new file mode 100644 index 0000000..37e32ce --- /dev/null +++ b/R-package/inst/extdata/genotype_X.ploidy @@ -0,0 +1,3 @@ +1 2 +1 2 +1 2 diff --git a/R-package/inst/extdata/reference_chr1.bim b/R-package/inst/extdata/reference_chr1.bim new file mode 100644 index 0000000..d3bc14a --- /dev/null +++ b/R-package/inst/extdata/reference_chr1.bim @@ -0,0 +1,5 @@ +1 rs1001 0 100 A G +1 rs1002 0 200 C T +1 rs1003 0 300 A C +1 rs1004 0 400 G A +1 rs1005 0 500 T C diff --git a/R-package/inst/extdata/reference_chrX.bim b/R-package/inst/extdata/reference_chrX.bim new file mode 100644 index 0000000..a90c087 --- /dev/null +++ b/R-package/inst/extdata/reference_chrX.bim @@ -0,0 +1,3 @@ +X rsX001 0 100 A G +X rsX002 0 200 C T +X rsX003 0 300 A C diff --git a/R-package/inst/extdata/traits.tsv.gz b/R-package/inst/extdata/traits.tsv.gz new file mode 100644 index 0000000000000000000000000000000000000000..5ae582910f30858516d78d46b86576fecaebc4cf GIT binary patch literal 138 zcmV;50CoQ#iwFn+00002|8#O;X>@ZgbaQq9J&dsqgD?yQ=a+xMvK>;95iziJ>d-ZG z=~N*`zMcmpo&0n@-RHYuSy2qdvEzp|7)%u-X1JttD^%2+59gln!gFjqk;Y4(U@}xp s*z?ZBoryQu!~5TkqDXgIBY8_RS@|Pm Date: Fri, 15 May 2026 11:38:30 +0200 Subject: [PATCH 02/11] Clarify R package tarball naming --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ac5cb46..05332e4 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ R_PACKAGE_VERSION := $(shell awk '/^Version:/ {print $$2}' R-package/DESCRIPTION) -R_PACKAGE_TARBALL := /tmp/statgen_$(R_PACKAGE_VERSION).tar.gz +R_PACKAGE_TARBALL := /tmp/statgen-r_$(R_PACKAGE_VERSION).tar.gz R_DOCS_DIR := /tmp/statgen-docs R_DOCS_LIB := /tmp/statgen-r-lib From 2d1cab7fe78befb476d87f3c18e20eac7935c7df Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 14:16:19 +0200 Subject: [PATCH 03/11] add GHA check workflow --- .github/workflows/R-CMD-check.yaml | 61 ++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/R-CMD-check.yaml diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..d9500fd --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,61 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + paths: + - 'R-package/**' + - '.github/workflows/R-CMD-check.yaml' + pull_request: + branches: [main, master] + paths: + - 'R-package/**' + - '.github/workflows/R-CMD-check.yaml' + +name: R-CMD-check + +permissions: read-all + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + working-directory: R-package + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true + args: 'c("--as-cran", "--no-manual")' + build_args: 'c("--no-manual", "--compact-vignettes=gs+qpdf")' + working-directory: R-package From 6b937292f849230a7afaf309b2609f00bac24fb8 Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 14:18:22 +0200 Subject: [PATCH 04/11] update documentation necessary for CRAN submit --- R-package/DESCRIPTION | 4 +--- R-package/LICENSE | 20 ++++++++++++++++++-- R-package/NEWS.md | 3 +++ R-package/README.md | 31 +++++++++++++++++++++++++++++++ R-package/cran-comments.md | 5 +++++ 5 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 R-package/NEWS.md create mode 100644 R-package/README.md create mode 100644 R-package/cran-comments.md diff --git a/R-package/DESCRIPTION b/R-package/DESCRIPTION index 0d7eea0..0d3e7fb 100644 --- a/R-package/DESCRIPTION +++ b/R-package/DESCRIPTION @@ -2,10 +2,8 @@ Package: statgen Type: Package Title: Statistical Genetics Data Objects and Loaders Version: 0.3.0 -Authors@R: person("Oleksandr", "Frei", role = c("aut", "cre"), +Authors@R: person("Oleksandr", "Frei", role = c("aut", "cre", "cph"), email = "oleksandr.frei@gmail.com") -Author: Oleksandr Frei [aut, cre] -Maintainer: Oleksandr Frei Description: CRAN-compatible R runtime for statgen statistical genetics reference, genotype, LD, annotation, and summary-statistic objects. License: MIT + file LICENSE diff --git a/R-package/LICENSE b/R-package/LICENSE index 6c94dd1..863645d 100644 --- a/R-package/LICENSE +++ b/R-package/LICENSE @@ -1,2 +1,18 @@ -YEAR: 2026 -COPYRIGHT HOLDER: Oleksandr Frei and contributors +MIT License + +Copyright (c) 2026 Oleksandr Frei and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", "WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO +EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/R-package/NEWS.md b/R-package/NEWS.md new file mode 100644 index 0000000..ae9b787 --- /dev/null +++ b/R-package/NEWS.md @@ -0,0 +1,3 @@ +# statgen 0.3.0 + +* Initial CRAN submission. diff --git a/R-package/README.md b/R-package/README.md new file mode 100644 index 0000000..3bd6854 --- /dev/null +++ b/R-package/README.md @@ -0,0 +1,31 @@ +# statgen R Package + +Statistical genetics data objects and loaders for R. This package is part of the larger `statgen` repository, which also includes Python and MATLAB/Octave implementations. + +## Installation + +### From GitHub (development) + +```r +# Install devtools if needed +if (!require("devtools")) install.packages("devtools") + +# Install from the R-package directory +devtools::install() + +# Or from the repository root +devtools::install("R-package") +``` + +### From CRAN (release) + +```r +install.packages("statgen") +``` + +## Documentation + +- [Main statgen repository](https://github.com/precimed/statgen) +- [Specification documents](../spec/) +- Package vignette: `vignette("statgen")` + diff --git a/R-package/cran-comments.md b/R-package/cran-comments.md new file mode 100644 index 0000000..858617d --- /dev/null +++ b/R-package/cran-comments.md @@ -0,0 +1,5 @@ +## R CMD check results + +0 errors | 0 warnings | 1 note + +* This is a new release. From 7d3c0fa270d9b2b86bf9e0cf5ee07cb9c73d147e Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 14:19:14 +0200 Subject: [PATCH 05/11] ignore dev files for package building --- R-package/.Rbuildignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 R-package/.Rbuildignore diff --git a/R-package/.Rbuildignore b/R-package/.Rbuildignore new file mode 100644 index 0000000..d79f396 --- /dev/null +++ b/R-package/.Rbuildignore @@ -0,0 +1,2 @@ +^cran-comments\.md$ +^revdep$ From 6431d2311b4201c449b72ab0511ec39abab6b471 Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 14:32:10 +0200 Subject: [PATCH 06/11] update description --- R-package/DESCRIPTION | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R-package/DESCRIPTION b/R-package/DESCRIPTION index 0d3e7fb..f3bea8c 100644 --- a/R-package/DESCRIPTION +++ b/R-package/DESCRIPTION @@ -4,8 +4,9 @@ Title: Statistical Genetics Data Objects and Loaders Version: 0.3.0 Authors@R: person("Oleksandr", "Frei", role = c("aut", "cre", "cph"), email = "oleksandr.frei@gmail.com") -Description: CRAN-compatible R runtime for statgen statistical genetics - reference, genotype, LD, annotation, and summary-statistic objects. +Description: Loads and manages statistical genetics data objects including reference + panels, genotypes, LD matrices, annotations, and summary statistics. Implements the + language-agnostic statgen specifications for coordinated multi-runtime analysis. License: MIT + file LICENSE URL: https://github.com/precimed/statgen BugReports: https://github.com/precimed/statgen/issues From dda855a46d290b4adbf06489022703103c60c9ad Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 14:56:01 +0200 Subject: [PATCH 07/11] fix license note --- R-package/.Rbuildignore | 1 + R-package/LICENSE | 20 ++------------------ R-package/LICENSE.md | 9 +++++++++ 3 files changed, 12 insertions(+), 18 deletions(-) create mode 100644 R-package/LICENSE.md diff --git a/R-package/.Rbuildignore b/R-package/.Rbuildignore index d79f396..b292b85 100644 --- a/R-package/.Rbuildignore +++ b/R-package/.Rbuildignore @@ -1,2 +1,3 @@ ^cran-comments\.md$ ^revdep$ +^LICENSE\.md$ diff --git a/R-package/LICENSE b/R-package/LICENSE index 863645d..6c94dd1 100644 --- a/R-package/LICENSE +++ b/R-package/LICENSE @@ -1,18 +1,2 @@ -MIT License - -Copyright (c) 2026 Oleksandr Frei and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and -associated documentation files (the "Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", "WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT -LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO -EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. +YEAR: 2026 +COPYRIGHT HOLDER: Oleksandr Frei and contributors diff --git a/R-package/LICENSE.md b/R-package/LICENSE.md new file mode 100644 index 0000000..601b9cf --- /dev/null +++ b/R-package/LICENSE.md @@ -0,0 +1,9 @@ +# MIT License + +Copyright (c) 2026 Oleksandr Frei and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 38eb978e5d934bf0f8daaf583596e63925c9f2e7 Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 14:57:00 +0200 Subject: [PATCH 08/11] fix notes for invalid URI in README and misspelled words in DESCRIPTION --- R-package/README.md | 1 - R-package/cran-comments.md | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/R-package/README.md b/R-package/README.md index 3bd6854..1189212 100644 --- a/R-package/README.md +++ b/R-package/README.md @@ -26,6 +26,5 @@ install.packages("statgen") ## Documentation - [Main statgen repository](https://github.com/precimed/statgen) -- [Specification documents](../spec/) - Package vignette: `vignette("statgen")` diff --git a/R-package/cran-comments.md b/R-package/cran-comments.md index 858617d..7c5285b 100644 --- a/R-package/cran-comments.md +++ b/R-package/cran-comments.md @@ -3,3 +3,7 @@ 0 errors | 0 warnings | 1 note * This is a new release. + +* NOTE: "Possibly misspelled words in DESCRIPTION: LD, statgen" + Both are intentional: 'LD' is a standard abbreviation for Linkage Disequilibrium + in statistical genetics; 'statgen' is the name of this package and software suite. From 439d412501abebf898eb806cf583fadd7b52f318 Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 14:57:18 +0200 Subject: [PATCH 09/11] Remove seek() to fix Windows incompatibility --- R-package/R/annotations.R | 47 +++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/R-package/R/annotations.R b/R-package/R/annotations.R index 0783dc0..f654c83 100644 --- a/R-package/R/annotations.R +++ b/R-package/R/annotations.R @@ -334,39 +334,48 @@ print.AnnotationPanel <- function(x, ...) { } .parse_bed <- function(path) { + # First pass: scan line-by-line to validate structure and count header lines to + # skip. Avoids seek(), which R documents as unreliable on Windows text connections. con <- file(path, open = "rt") on.exit(close(con), add = TRUE) + + skip_count <- 0L first_data <- NULL - first_pos <- 0 + found_data <- FALSE + repeat { - pos <- seek(con, where = NA) line <- readLines(con, n = 1L, warn = FALSE) if (!length(line)) { - stop(sprintf("%s: BED file is empty", path), call. = FALSE) - } - if (!identical(line, "") && !startsWith(line, "#")) { - first_data <- line - first_pos <- pos + if (!found_data) { + stop(sprintf("%s: BED file is empty", path), call. = FALSE) + } break } + if (!found_data) { + if (identical(line, "") || startsWith(line, "#")) { + skip_count <- skip_count + 1L + } else { + first_data <- line + found_data <- TRUE + } + } else { + if (identical(line, "") || startsWith(line, "#")) { + stop(sprintf("%s: blank or comment line after BED data row", path), call. = FALSE) + } + } } + close(con) + on.exit(NULL) + if (length(strsplit(first_data, "\t", fixed = TRUE)[[1L]]) < 3L) { stop(sprintf("%s: BED must have at least 3 tab-separated columns", path), call. = FALSE) } - seek(con, where = first_pos) - repeat { - line <- readLines(con, n = 1L, warn = FALSE) - if (!length(line)) { - break - } - if (identical(line, "") || startsWith(line, "#")) { - stop(sprintf("%s: blank or comment line after BED data row", path), call. = FALSE) - } - } - seek(con, where = first_pos) + + # Second pass: read.table opens the file fresh, no seek() needed. df <- tryCatch( utils::read.table( - file = con, + file = path, + skip = skip_count, header = FALSE, sep = "\t", quote = "", From f3c674f272dcc49e5caa25b59d3453e51ec161e7 Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 15:03:51 +0200 Subject: [PATCH 10/11] Add the one missing example to docs --- R-package/man/ld.Rd | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/R-package/man/ld.Rd b/R-package/man/ld.Rd index f7dfed6..30a5969 100644 --- a/R-package/man/ld.Rd +++ b/R-package/man/ld.Rd @@ -68,4 +68,23 @@ a vector or matrix with the same shape as \code{M}, and \code{fast_prune()} returns a numeric vector or one-dimensional matrix with pruned entries set to \code{NaN}. } +\examples{ +ld_src <- system.file("extdata", "ld", "python", package = "statgen") +if (nzchar(ld_src)) { + ld_root <- tempfile("ld_npz_") + dir.create(ld_root) + file.copy(list.files(ld_src, full.names = TRUE), ld_root, recursive = TRUE) + + prepare_ld_npz_for_r(ld_root) + ld <- load_ld(ld_root) + + num_snp(ld) + head(a1freq(ld)) + + scores <- seq_len(num_snp(ld)) + multiply_r2(ld, scores) + + fast_prune(c(9, 9, 7, 1, 2, 6, 5, 4), ld, r2_threshold = 0.35) +} +} \keyword{datasets} From 346d60179116ee7cb640203e8b5afa5a31cbd605 Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 15 May 2026 15:36:01 +0200 Subject: [PATCH 11/11] Revert "Clarify R package tarball naming" This reverts commit 3f98cf7105520170e4d818a54ed3eb38b07555cf. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 05332e4..ac5cb46 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ R_PACKAGE_VERSION := $(shell awk '/^Version:/ {print $$2}' R-package/DESCRIPTION) -R_PACKAGE_TARBALL := /tmp/statgen-r_$(R_PACKAGE_VERSION).tar.gz +R_PACKAGE_TARBALL := /tmp/statgen_$(R_PACKAGE_VERSION).tar.gz R_DOCS_DIR := /tmp/statgen-docs R_DOCS_LIB := /tmp/statgen-r-lib