Skip to content

Commit 0788cf1

Browse files
authored
Merge pull request #4 from oliviaAB/main
CRAN submission
2 parents 4326e2f + d910944 commit 0788cf1

29 files changed

+241
-121
lines changed

.Rbuildignore

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
^\.github$
1111
^README\.Rmd$
1212
^README.html$
13+
^cran-comments\.md$
14+
^CRAN-SUBMISSION$

.github/workflows/pkgdown.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ jobs:
3030

3131
- uses: r-lib/actions/setup-r-dependencies@v2
3232
with:
33-
extra-packages: any::pkgdown, local::.
33+
extra-packages: any::pkgdown, local::., github::jendelman/GWASpoly
34+
3435
needs: website
3536

3637
- name: Build site

CRAN-SUBMISSION

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Version: 1.1.0
2+
Date: 2023-02-09 02:07:37 UTC
3+
SHA: f009eb969d5eba81478b12f374e1547f7fd98bc4

DESCRIPTION

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
Package: hidecan
2-
Title: Hidecan plots generator
3-
Version: 1.0.0
2+
Title: Create HIDECAN Plots for Visualising Genome-Wide Association Studies and Differential Expression Results
3+
Version: 1.1.0
44
Authors@R:
55
person("Olivia", "Angelin-Bonnet", , "[email protected]", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0002-7708-2919"))
7-
Description: A package for generating hidecan plots that summarise and combine
8-
the results of GWAS and transcriptomics differential expression analyses,
9-
along candidate genes of interest.
7+
Description: Generates HIDECAN plots that summarise and combine
8+
the results of genome-wide association studies (GWAS) and transcriptomics
9+
differential expression analyses (DE), along with manually curated candidate genes of interest. The HIDECAN plot
10+
is presented in Angelin-Bonnet et al. (2023) (currently in review).
1011
License: MIT + file LICENSE
11-
URL: https://shiny-adventure-acfe02d1.pages.github.io/, https://github.com/PlantandFoodResearch/hidecan
12+
URL: https://plantandfoodresearch.github.io/hidecan/, https://github.com/PlantandFoodResearch/hidecan
1213
BugReports: https://github.com/PlantandFoodResearch/hidecan/issues
1314
Encoding: UTF-8
1415
Roxygen: list(markdown = TRUE)
15-
RoxygenNote: 7.2.2
16+
RoxygenNote: 7.2.3
1617
Depends:
1718
R (>= 2.10)
1819
Imports:
@@ -26,12 +27,11 @@ Imports:
2627
tidyr,
2728
viridis,
2829
vroom
29-
Suggests:
30-
GWASpoly,
30+
Suggests:
3131
knitr,
3232
rmarkdown,
3333
stringr,
3434
testthat (>= 3.0.0)
35-
Remotes: jendelman/GWASpoly
3635
Config/testthat/edition: 3
3736
VignetteBuilder: knitr
37+
Language: en-GB

NAMESPACE

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export(combine_chrom_length)
1717
export(compute_chrom_length)
1818
export(create_hidecan_plot)
1919
export(get_example_data)
20-
export(get_gwaspoly_example_data)
2120
export(hidecan_plot)
2221
export(hidecan_plot_from_gwaspoly)
2322
export(run_hidecan_shiny)

NEWS.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# hidecan 1.1.0
2+
3+
* Removed `get_gwaspoly_example_data()` function so that the package doesn't depend on GWASpoly (for CRAN submission)
4+
5+
* Saved the example object previously returned by `get_gwaspoly_example_data()` in as an `rda` file in the `extdata` folder

R/create_hidecan_plot.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
#' @param label_padding Numeric, amount of padding around gene labels in the plot,
3939
#' as unit or number. Default value is 0.15
4040
#' (for \link[ggrepel]{geom_label_repel}).
41-
#' @returns A ggplot.
41+
#' @returns A `ggplot`.
4242
#' @examples
43-
#' \dontrun{
43+
#' if (interactive()) {
4444
#' x <- get_example_data()
4545
#' y <- list("GWAS" = GWAS_data(x[["GWAS"]]),
4646
#' "DE" = DE_data(x[["DE"]]),
@@ -387,9 +387,9 @@ create_hidecan_plot <- function(x,
387387
#' giving for each chromosome its length in bp. If `NULL` (the default), will
388388
#' be inferred from the GWAS, DE and candidate gene data.
389389
#' @inheritParams create_hidecan_plot
390-
#' @returns a ggplot.
390+
#' @returns a `ggplot`.
391391
#' @examples
392-
#' \dontrun{
392+
#' if (interactive()) {
393393
#' x <- get_example_data()
394394
#'
395395
#' ## Typical example with one GWAs result table, one DE result table and

R/gwaspoly_helper_functions.R

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#' Extracts information from GWASpoly output
22
#'
3-
#' Extracts GWAS results and chomosome length from GWASpoly output.
3+
#' Extracts GWAS results and chromosome length from GWASpoly output.
44
#'
55
#' @param gwaspoly_output A `GWASpoly.fitted` or `GWASpoly.thresh` object
66
#' (returned by `GWASpoly::GWASpoly()` or `GWASpoly::set.threshold()` functions).
@@ -127,13 +127,7 @@ GWAS_data_from_gwaspoly <- function(gwaspoly_output,
127127
#' @inheritParams GWAS_data_from_gwaspoly
128128
#' @param ... Further arguments passed to the \code{\link{create_hidecan_plot}()}
129129
#' function.
130-
#' @returns A ggplot.
131-
#' @examples
132-
#' \dontrun{
133-
#' x <- get_gwaspoly_example_data(with_thresholds = TRUE)
134-
#'
135-
#' hidecan_plot_from_gwaspoly(x)
136-
#' }
130+
#' @returns A `ggplot`.
137131
#' @export
138132
hidecan_plot_from_gwaspoly <- function(gwaspoly_output,
139133
traits = NULL,

R/shiny_app.R

+7
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,16 @@
33
#' Starts the HIDECAN shiny app. The app reads in csv data to produce
44
#' a HIDECAN plot.
55
#'
6+
#' @returns No return value, called for side effects (launching the shiny app).
7+
#'
68
#' @export
79
run_hidecan_shiny <- function(){
810
app_dir <- system.file("shiny_apps/hidecan_shiny.R", package = "hidecan")
911

1012
shiny::runApp(app_dir, display.mode = "normal")
1113
}
14+
15+
## To get rid of the check NOTE
16+
ignore_unused_imports <- function(){
17+
vroom::vroom
18+
}

R/sysdata.rda

-2.49 MB
Binary file not shown.

R/utils.R

+23-19
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,26 @@ get_example_data <- function(){
3535
)
3636
}
3737

38-
#' GWASpoly example dataset
39-
#'
40-
#' Returns a list of GWASpoly example datasets.
41-
#'
42-
#' @param with_thresholds Logical, should the GWASpoly object returned
43-
#' contain significance threshold? Default value is `TRUE`.
44-
#' @returns
45-
#' * if `with_thresholds` is `TRUE`: a `GWASpoly.thresh` object
46-
#' (returned by the `GWASpoly::set.threshold()` function).
47-
#' if `with_thresholds` is `FALSE`: a `GWASpoly.fitted` object
48-
#' (returned by the `GWASpoly::GWASpoly()` function).
49-
#' @export
50-
get_gwaspoly_example_data <- function(with_thresholds = TRUE){
51-
if(with_thresholds){
52-
return(gwaspoly_res_thr)
53-
} else {
54-
return(gwaspoly_res)
55-
}
56-
}
38+
# #' GWASpoly example dataset
39+
# #'
40+
# #' Returns a list of GWASpoly example datasets. Not exported because otherwise
41+
# #' would load the GWASpoly package which is not on CRAN.
42+
# #'
43+
# #' Install the GWASpoly package with `devtools::install_github('jendelman/GWASpoly', build_vignettes=FALSE)`.
44+
# #'
45+
# #' @param with_thresholds Logical, should the GWASpoly object returned
46+
# #' contain significance threshold? Default value is `TRUE`.
47+
# #' @returns
48+
# #' * if `with_thresholds` is `TRUE`: a `GWASpoly.thresh` object
49+
# #' (returned by the `GWASpoly::set.threshold()` function).
50+
# #' if `with_thresholds` is `FALSE`: a `GWASpoly.fitted` object
51+
# #' (returned by the `GWASpoly::GWASpoly()` function).
52+
# #' @export
53+
# get_gwaspoly_example_data <- function(with_thresholds = TRUE){
54+
#
55+
# if(with_thresholds){
56+
# return(gwaspoly_res_thr)
57+
# } else {
58+
# return(gwaspoly_res)
59+
# }
60+
# }

_pkgdown.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ navbar:
1313
- text: Step-by-step
1414
href: articles/hidecan-step-by-step.html
1515
- text: GWASpoly output
16-
href: articles/gwaspoly_output.html
16+
href: articles/web_only/gwaspoly_output.html
1717
- text: Shiny app
18-
href: articles/shiny-app.html
18+
href: articles/web_only/shiny-app.html
1919

2020
home:
2121
sidebar:
@@ -58,7 +58,6 @@ reference:
5858
- title: "Example datasets"
5959
contents:
6060
- get_example_data
61-
- get_gwaspoly_example_data
6261

6362
- title: "Utils"
6463
contents:

cran-comments.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Resubmission
2+
3+
This is a resubmission. In this version I have:
4+
5+
* Explained acronyms in the description of the package.
6+
7+
* Added the missing \value tag in the run_hidecan_shiny.Rd documentation.s
8+
9+
# Test environments
10+
11+
- local Windows 10, R 4.2.2
12+
- Winbuilder: x86_64-w64-mingw32 (64-bit) R version 4.2.2 (2022-10-31 ucrt)
13+
- Winbuilder: x86_64-w64-mingw32 (64-bit) R Under development (unstable) (2023-01-25 r83685 ucrt)
14+
- Rhub:
15+
- Windows Server 2022, R-devel, 64 bit
16+
- Fedora Linux, R-devel, clang gfortran
17+
- Ubuntu Linux 20.04 LTS, R-release, GCC
18+
- macOS 10.13.6 High Sierra, R-release, brew
19+
- debian-gcc-release: Debian Linux, R-release, GCC
20+
21+
# R CMD check results
22+
23+
There were no ERRORs, WARNINGs.
24+
25+
There was 1 NOTE:
26+
27+
```
28+
* checking CRAN incoming feasibility ... NOTE
29+
Maintainer: 'Olivia Angelin-Bonnet <[email protected]>'
30+
31+
New submission
32+
33+
Possibly misspelled words in DESCRIPTION:
34+
Angelin (11:19)
35+
GWAS (9:51)
36+
HIDECAN (2:15, 8:24, 10:103)
37+
al (11:37)
38+
et (11:34)
39+
transcriptomics (9:61)
40+
```
41+
42+
This is a new submission. Angelin is a family name; GWAS stands for Genome-Wide Association Study (precised in the description); HIDECAN is the name of the package; transcriptomics is correctly spelled; et al. was used for a reference.
43+
44+
45+
# Downstream dependencies
46+
47+
There are currently no downstream dependencies for this package.

data-raw/datasets_for_tests.R

+37
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,40 @@ can_res <- hidecan::CAN_data(candidate_data)
1010

1111
save(gwas_res, de_res, can_res, file = "tests/testthat/data-test/test_input.rda")
1212

13+
14+
library(GWASpoly)
15+
library(readr)
16+
library(dplyr)
17+
18+
genofile <- system.file("extdata", "TableS1.csv", package = "GWASpoly")
19+
phenofile <- system.file("extdata", "TableS2.csv", package = "GWASpoly")
20+
21+
set.seed(10)
22+
geno_data <- read_csv(genofile) |>
23+
slice_sample(n = 500)
24+
25+
temp_file <- tempfile()
26+
write_csv(geno_data, temp_file)
27+
28+
data <- read.GWASpoly(ploidy = 4,
29+
pheno.file = phenofile,
30+
geno.file = temp_file,
31+
format = "ACGT",
32+
n.traits = 13,
33+
delim = ",")
34+
35+
data.original <- set.K(data,
36+
LOCO = FALSE,
37+
n.core = 2)
38+
39+
40+
gwaspoly_res <- GWASpoly(data.original,
41+
models = c("general", "additive"),
42+
traits = c("tuber_eye_depth", "tuber_shape"),
43+
n.core = 2)
44+
45+
gwaspoly_res_thr <- set.threshold(gwaspoly_res, method = "M.eff", level = 0.05)
46+
47+
## For users to access the example GWASpoly dataset without having it loaded
48+
saveRDS(gwaspoly_res, file = "tests/testthat/data-test/test_gwaspoly_res.rda")
49+
saveRDS(gwaspoly_res_thr, file = "tests/testthat/data-test/test_gwaspoly_res_thr.rda")

data-raw/making_example_data.R

+47-1
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,57 @@ gwaspoly_res <- GWASpoly(data.original,
8686

8787
gwaspoly_res_thr <- set.threshold(gwaspoly_res, method = "M.eff", level = 0.05)
8888

89+
## For users to access the example GWASpoly dataset without having it loaded
90+
saveRDS(gwaspoly_res_thr, file = "inst/extdata/gwaspoly_res_thr.rda")
91+
8992
#manhattan.plot(gwaspoly_res_thr)
9093

9194

9295
## ----------------- ##
9396
## Saving everything ##
9497
## ----------------- ##
9598

96-
usethis::use_data(gwas_data, de_data, candidate_data, gwaspoly_res, gwaspoly_res_thr, internal = TRUE, overwrite = TRUE)
99+
## To reduce the size of the dataset, removing at random some of the non-significant
100+
## markers and genes
101+
102+
## Preserving the end of each chromosome
103+
gwas_data_ends <- gwas_data |>
104+
group_by(chromosome) |>
105+
slice_max(position, n = 1) |>
106+
ungroup()
107+
108+
de_data_ends <- de_data |>
109+
group_by(chromosome) |>
110+
slice_max(end, n = 1) |>
111+
ungroup()
112+
113+
## Keeping the significant markers/genes
114+
gwas_data_sign <- gwas_data |>
115+
filter(score >= 3.5)
116+
117+
de_data_sign <- de_data |>
118+
filter(padj <= 0.05)
119+
120+
## Randomly subsetting non-significant markers/genes
121+
gwas_data_subset <- gwas_data |>
122+
filter(score < 3.5) |>
123+
slice_sample(prop = 0.5)
124+
125+
de_data_subset <- de_data |>
126+
filter(padj > 0.05) |>
127+
slice_sample(prop = 0.5)
128+
129+
## Combining retained markers/genes
130+
gwas_data <- bind_rows(
131+
gwas_data_ends,
132+
gwas_data_sign,
133+
gwas_data_subset
134+
)
135+
136+
de_data <- bind_rows(
137+
de_data_ends,
138+
de_data_sign,
139+
de_data_subset
140+
)
141+
142+
usethis::use_data(gwas_data, de_data, candidate_data, internal = TRUE, overwrite = TRUE)

inst/extdata/gwaspoly_res_thr.rda

1.01 MB
Binary file not shown.

man/GWAS_data_from_gwaspoly.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/create_hidecan_plot.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)