Skip to content

Commit

Permalink
Merge pull request #11 from oliviaAB/main
Browse files Browse the repository at this point in the history
Fixed bug GWASpoly chromosome ordering with limits
  • Loading branch information
oliviaAB authored Aug 4, 2024
2 parents ef42717 + f14d30e commit 3f9af29
Show file tree
Hide file tree
Showing 4 changed files with 757 additions and 384 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ URL: https://plantandfoodresearch.github.io/hidecan/, https://github.com/Plantan
BugReports: https://github.com/PlantandFoodResearch/hidecan/issues
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
Depends:
R (>= 2.10)
Imports:
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

* Added the `manhattan_plot()` function to generate Manhattan plots from a table of GWAS results.

* Fixed bug where specifying chromosome limits for `hidecan_plot_from_gwaspoly()` would mess up the ordering of the chromosomes in the plot.

# hidecan 1.1.0

* Removed `get_gwaspoly_example_data()` function so that the package doesn't depend on GWASpoly (for CRAN submission)
Expand Down
7 changes: 4 additions & 3 deletions R/create_hidecan_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ create_hidecan_plot <- function(x,
## Now filter both toplot and chrom_lenght to only the desired chromosomes
toplot <- toplot |>
dplyr::filter(chromosome %in% chroms) |>
dplyr::mutate(chromosome = factor(chromosome, levels = chroms))
dplyr::mutate(chromosome = factor(chromosome, levels = chroms, ordered = FALSE))

chrom_length <- chrom_length |>
dplyr::filter(chromosome %in% chroms) |>
dplyr::mutate(chromosome = factor(chromosome, levels = chroms))
dplyr::mutate(chromosome = factor(chromosome, levels = chroms, ordered = FALSE))

toplot_chroms <- chrom_length |>
dplyr::mutate(position_mb = length / 1e6) |>
Expand Down Expand Up @@ -231,7 +231,8 @@ create_hidecan_plot <- function(x,
~ tibble::tibble(lower_limit_mb = .x[[1]],
upper_limit_mb = .x[[2]]),
.id = "chromosome"
),
) |>
dplyr::mutate(chromosome = factor(chromosome, levels = chroms)),
by = "chromosome"
) |>
tidyr::replace_na(list(lower_limit_mb = 0)) |>
Expand Down
Loading

0 comments on commit 3f9af29

Please sign in to comment.