Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
dramanica committed Oct 18, 2024
1 parent d5947da commit b760efb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
20 changes: 0 additions & 20 deletions R/gt_helper_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,3 @@
.gt_get_bigsnp<-function(.x){
attr(.x$genotypes,"bigsnp")
}


# a developer function to create various count summaries of a population, used to
# compute more complex statistics (e.g. pairwise fst, etc.).
.gt_pop_freqs <- function(.x){
counts <- bigstatsr::big_counts( .gt_get_bigsnp(.x)$genotypes,
ind.row =.gt_bigsnp_rows(.x),
ind.col = .gt_bigsnp_cols(.x))
sums_alt <- apply(counts,2,function(x) x[2]+2*x[3])
n <- apply(counts,2,function(x) sum(x[1:3])*2)
sums_ref <- n - sums_alt
freq_alt <- sums_alt/n
freq_ref <- 1- freq_alt
het_obs <- apply(counts,2,function(x) x[2]/sum(x[1:3]))
return (list(
freq_alt = freq_alt,
freq_ref = freq_ref,
n = n,
het_obs = het_obs))
}
4 changes: 2 additions & 2 deletions R/gt_roh_window.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
#' @export
#'
#' @examples
#' # don't run the example
#' if (FALSE) {
#' # run the example only if we have the package installed
#' if (requireNamespace("detectRUNS", quietly = TRUE)) {
#' sheep_ped <- system.file("extdata", "Kijas2016_Sheep_subset.ped",
#' package="detectRUNS")
#' sheep_gt <- tidypopgen::gen_tibble(sheep_ped, backingfile = tempfile(),
Expand Down
4 changes: 2 additions & 2 deletions man/gt_roh_window.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b760efb

Please sign in to comment.