Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug GWASpoly chromosome ordering with limits #11

Merged
merged 1 commit into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading