Skip to content

Commit

Permalink
easier select_haplo
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristianetaniguti committed Dec 26, 2023
1 parent 07a3ef2 commit 6826135
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 70 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import(purrr)
import(shiny)
import(shinyWidgets)
import(shinydashboard)
import(tidyr)
import(vroom)
importFrom(JBrowseR,JBrowseR)
importFrom(JBrowseR,JBrowseROutput)
Expand All @@ -33,6 +34,7 @@ importFrom(grDevices,col2rgb)
importFrom(grDevices,hcl)
importFrom(grDevices,hsv)
importFrom(grDevices,rgb2hsv)
importFrom(graphics,legend)
importFrom(hidecan,CAN_data)
importFrom(hidecan,DE_data)
importFrom(hidecan,GWAS_data)
Expand Down
1 change: 1 addition & 0 deletions R/functions_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' @param software character defined from each software it comes from
#'
#' @return graphic representing selected section of a linkage group
#' @importFrom graphics legend
#'
#' @keywords internal
draw_map_shiny<-function(left.lim = 0, right.lim = 5, ch = 1,
Expand Down
3 changes: 2 additions & 1 deletion R/functions_qtl.R
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ plot.mappoly.homoprob <- function(x, stack = FALSE, lg = NULL,
#'
#' @return ggplot graphic
#'
#' @import dplyr tidyr
#'
#' @keywords internal
select_haplo <- function(input.haplo,probs, selected_mks, effects.data, exclude.haplo = NULL){
Expand All @@ -788,7 +789,7 @@ select_haplo <- function(input.haplo,probs, selected_mks, effects.data, exclude.
subset <- homo.dat$homoprob[which(data_match %in% include),]
subset <- subset[which(subset$probability > 0.5),]

counts <- subset %>% group_by(marker, individual, LG) %>% summarise(n = n())
counts <- subset %>% group_by(individual) %>% summarise(n = n())
selected <- counts$individual[counts$n == length(input.haplo)]

if(length(selected) == 0) stop("None of the inviduals have these combination of haplotypes")
Expand Down
132 changes: 66 additions & 66 deletions tests/testthat/_snaps/tetra_example/effects-bar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6826135

Please sign in to comment.