install.packages("ggthemes")
remotes::install_github("richelbilderbeek/ncbi_peregrine")
remotes::install_github("richelbilderbeek/ncbi")
remotes::install_github("richelbilderbeek/cobaltr")
remotes::install_github("richelbilderbeek/sprentrez")
remotes::install_github("richelbilderbeek/ncbi")
remotes::install_github("richelbilderbeek/ncbi_peregrine")
?ggplot2::ggsave
devtools::load_all(".")
install.packages("poisbinom")
lintr::lint_package()
devtools::load_all(".")
lintr::lint_package()
?get_n_variations_raw
??get_n_variations_raw
devtools::load_all(".")
??get_n_variations_raw
?get_n_variations_raw
?get_n_variations_raw
devtools::load_all(".")
library(ncbiresults)
lintr::lintr_package()
lintr::lint_package()
lintr::lint_package()
lintr::lint_package()
lintr::lint_package()
tex_lines <- readr::read_lines("bbbq_article.tex")
# Create the numbered figures as 'figure_1.tiff' etc,
# from the articles' better-described figure names
if (1 == 2) {
setwd("~/GitHubs/bbbq_article")
}
setwd("~/GitHubs/bbbq_article")
tex_lines <- readr::read_lines("bbbq_article.tex")
includegraphics_lines <- stringr::str_subset(tex_lines, "^  .*includegraphics")
png_filenames <- stringr::str_match(includegraphics_lines, "includegraphics.*\\{(.*)\\}")[, 2]
png_filenames
testthat::expect_true(all(file.exists(png_filenames)))
tiff_filenames <- stringr::str_replace(png_filenames, "png$", "tiff")
tiff_filenames[!file.exists(tiff_filenames)]
testthat::expect_true(all(file.exists(tiff_filenames)))
tiff_filenames
tiff_filenames[!file.exists(tiff_filenames)]
png_filenames <- stringr::str_match(includegraphics_lines, "includegraphics.*\\{(.*)\\}")[, 2]
png_filenames
t <- tibble::tibble(
from = tiff_filenames,
to = NA
)
t
figures <- tibble::tibble(
number = seq(1, 4),
n_sub = c(3, 1, 3, 4)
)
figures
figure_names <- rep(x = figures$number, times = figures$n_sub)
figure_names
test_that("use", {
folder_name <- "~/GitHubs/ncbi_peregrine/scripts"
if (!dir.exists(folder_name)) return()
p <- plot_conservation(folder_name = folder_name)
p
p ; ggplot2::ggsave(
file.path(folder_name, "fig_conservation.png"),
width = 180, units = "mm",
height = 180
)
p ; ggplot2::ggsave(
file.path(folder_name, "fig_conservation.tiff"),
width = 180, units = "mm",
height = 180
)
p ; ggplot2::ggsave(
file.path(folder_name, "fig_conservation.eps"),
width = 180, units = "mm",
height = 180
)
p ; ggplot2::ggsave(
file.path("~/fig_conservation.png"),
width = (6 / 7) * 180, units = "mm",
height = 180
)
p ; ggplot2::ggsave(
file.path("~/fig_conservation.tiff"),
width = (6 / 7) * 180, units = "mm",
height = 180
)
p ; ggplot2::ggsave(
file.path("~/fig_conservation.eps"),
width = (6 / 7) * 180, units = "mm",
height = 180
)
})
test_that("use", {
# Local only
folder_name <- "~/GitHubs/ncbi_peregrine/scripts"
if (!dir.exists(folder_name)) return()
# Color, transparency
p <- plot_f_snps_found_and_expected_per_spanner(folder_name = folder_name)
p
p ; ggplot2::ggsave(
file.path(folder_name, "fig_f_snps_found_and_expected_per_spanner.png"),
width = 180, unit = "mm",
height = 90
)
p ; ggplot2::ggsave(
file.path(folder_name, "fig_f_snps_found_and_expected_per_spanner.tiff"),
width = 180, unit = "mm",
height = 90
)
p ; ggplot2::ggsave(
file.path("~/fig_f_snps_found_and_expected_per_spanner.png"),
width = 180, unit = "mm",
height = 90
)
p ; ggplot2::ggsave(
file.path("~/fig_f_snps_found_and_expected_per_spanner.tiff"),
width = 180, unit = "mm",
height = 90
)
# Color, no transparency
p <- plot_f_snps_found_and_expected_per_spanner(
folder_name = folder_name,
use_transparency = FALSE
)
p ; ggplot2::ggsave(
file.path(folder_name, "fig_f_snps_found_and_expected_per_spanner.eps"),
width = 180, unit = "mm",
height = 90
)
p ; ggplot2::ggsave(
file.path("~/fig_f_snps_found_and_expected_per_spanner.eps"),
width = 180, unit = "mm",
height = 90
)
# Black and white, transparency
p <- plot_f_snps_found_and_expected_per_spanner(
folder_name = folder_name,
use_color = FALSE
)
p
p ; ggplot2::ggsave(
file.path(folder_name, "fig_f_snps_found_and_expected_per_spanner_bw.png"),
width = 180, unit = "mm",
height = 90
)
p ; ggplot2::ggsave(
file.path(folder_name, "fig_f_snps_found_and_expected_per_spanner_bw.tiff"),
width = 180, unit = "mm",
height = 90
)
p ; ggplot2::ggsave(
file.path("~/fig_f_snps_found_and_expected_per_spanner_bw.png"),
width = 180, unit = "mm",
height = 90
)
p ; ggplot2::ggsave(
file.path("~/fig_f_snps_found_and_expected_per_spanner_bw.tiff"),
width = 180, unit = "mm",
height = 90
)
# Black and white, no transparency
p <- plot_f_snps_found_and_expected_per_spanner(
folder_name = folder_name,
use_color = FALSE,
use_transparency = FALSE
)
p ; ggplot2::ggsave(
file.path(folder_name, "fig_f_snps_found_and_expected_per_spanner_bw.eps"),
width = 180, unit = "mm",
height = 90
)
p ; ggplot2::ggsave(
file.path("~/fig_f_snps_found_and_expected_per_spanner_bw.eps"),
width = 180, unit = "mm",
height = 90
)
})
folder_name <- "~/GitHubs/ncbi_peregrine/scripts"
