Skip to content

Commit

Permalink
r cmd check fix + cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
agouy committed Aug 26, 2022
1 parent ba1e62b commit 9d84e9b
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 1,236 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ book
^cran-comments\.md$
^\.github$
Dockerfile
y_hap_pred
tests/shiny*
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export(get_ld_gp)
export(pca_mds_Server)
export(pca_mds_UI)
export(plotPCA)
export(plot_hap_dist)
export(plot_hap_div)
export(plot_ld)
export(popgen_UI)
Expand Down Expand Up @@ -91,6 +92,7 @@ importFrom(stats,cov)
importFrom(stats,frequency)
importFrom(stats,hclust)
importFrom(stats,ks.test)
importFrom(stats,median)
importFrom(stats,p.adjust)
importFrom(stats,qqplot)
importFrom(stats,qunif)
Expand Down
2 changes: 1 addition & 1 deletion R/helpers.R
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ get_hw_gp <- function(fname, n_iter) {
#' @keywords internal
plot_hap_div <- function(df) {
hap_1 <- hap_2 <- value <- NULL
midpoint <- median(df$value)
midpoint <- stats::median(df$value)
plt <- ggplot2::ggplot(data = df, aes(hap_1, hap_2, fill = value)) +
ggplot2::geom_tile(color = "white") +
ggplot2::scale_fill_gradient2(low = "#ffffff", mid = "#fdae6b", high = "#e6550d",
Expand Down
4 changes: 2 additions & 2 deletions R/helpers_haplo_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ getHaploStatsFromGenind <- function(data) {
flag = "0"
)
)
hap_data <- tibble::tibble(
hap_data <- data.frame(
haplotype_id = hap_labels,
h_count = h_count,
h_freq = h_freq,
h_value = gsub("_", "|", names(h_count))
)

## population level table
hap_pop_data <- tibble::tibble(
hap_pop_data <- data.frame(
h_div = h_div
)

Expand Down
2 changes: 1 addition & 1 deletion R/straf.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#' @importFrom reshape2 acast
#' @importFrom shinycssloaders withSpinner
#' @importFrom shinyWidgets awesomeCheckbox pickerInput
#' @importFrom stats as.dist cmdscale cov frequency hclust ks.test qqplot qunif p.adjust
#' @importFrom stats as.dist cmdscale cov frequency hclust ks.test median qqplot qunif p.adjust
#' @importFrom tidyr gather
#' @importFrom utils read.table write.table count.fields
NULL
Expand Down
25 changes: 0 additions & 25 deletions data/nginx/conf/nginx.conf

This file was deleted.

10 changes: 0 additions & 10 deletions landing/test.Rmd

This file was deleted.

1,189 changes: 0 additions & 1,189 deletions landing/test.html

This file was deleted.

18 changes: 18 additions & 0 deletions man/plot_hap_dist.Rd

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

16 changes: 8 additions & 8 deletions scripts/generate_expectations.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
library(straf)

input_diploid <- list(datapath="./tests/input_files/exampleSTRAFdiplo.txt")
input_diploid <- list(datapath="./tests/testthat/exampleSTRAFdiplo.txt")
dat_diploid <- straf::createGenind(input_diploid, ploidy = 2)
freq_diploid <- straf::getFreqAllPop(dat_diploid)
indices_diploid <- straf::getIndicesAllPop(dat_diploid)


input_haploid <- list(datapath="./tests/input_files/exampleSTRAFhaplo.txt")
input_haploid <- list(datapath="./tests/testthat/exampleSTRAFhaplo.txt")
dat_haploid <- straf::createGenind(input_haploid, ploidy = 1)
freq_haploid <- straf::getFreqAllPop(dat_diploid)
indices_haploid <- straf::getIndicesAllPop(dat_diploid)
freq_haploid <- straf::getFreqAllPop(dat_haploid)
indices_haploid <- straf::getIndicesAllPop(dat_haploid)


input_haploid_point <- list(datapath="./tests/input_files/exampleSTRAFhaplo_point.txt")
input_haploid_point <- list(datapath="./tests/testthat/exampleSTRAFhaplo_point.txt")
dat_haploid_point <- straf::createGenind(input_haploid_point, ploidy = 1)
freq_haploid_point <- straf::getFreqAllPop(dat_diploid)
indices_haploid_point <- straf::getIndicesAllPop(dat_diploid)
freq_haploid_point <- straf::getFreqAllPop(dat_haploid_point)
indices_haploid_point <- straf::getIndicesAllPop(dat_haploid_point)

expectations <- list(
dat_diploid=dat_diploid,
Expand All @@ -29,4 +29,4 @@ expectations <- list(
indices_haploid_point=indices_haploid_point
)

saveRDS(expectations, file = "./tests/expectations.rds")
saveRDS(expectations, file = "./tests/testthat/expectations.rds")
Binary file modified tests/testthat/expectations.rds
Binary file not shown.

0 comments on commit 9d84e9b

Please sign in to comment.