Skip to content

Commit

Permalink
missing tiles fixed #106
Browse files Browse the repository at this point in the history
  • Loading branch information
werpuc committed May 19, 2022
1 parent 9afa1d2 commit e8bd0aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions R/calculate_p_value.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ calculate_p_value <- function(dat,
st_2 <- vol_dat[i, "masses_2"][[1]]

if(length(st_1) == 1 | all(st_1 == st_2)) {
p_value <- -1
p_value <- NA
} else if (length(st_2) == 1){
p_value <- -1
p_value <- NA
} else {
p_value <- t.test(x = st_1, y = st_2, paired = FALSE, alternative = "two.sided", conf.level = confidence_level)$p.value
}
Expand All @@ -88,8 +88,7 @@ calculate_p_value <- function(dat,
End = vol_dat[i, "End"],
P_value = p_value)

}) %>% bind_rows() %>%
filter(P_value > 0)
}) %>% bind_rows()

p_dat[["P_value"]] <- p.adjust(p_dat[["P_value"]], method = p_adjustment_method)

Expand Down
5 changes: 3 additions & 2 deletions R/plot_differential_chiclet.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ plot_differential_chiclet <- function(diff_uptake_dat = NULL,
x_threshold <- t_value * mean(plot_dat[["err_value"]], na.rm = TRUE)/sqrt(length(plot_dat))

chiclet_differential_plot <- chiclet_differential_plot +
geom_tile(data = subset(plot_dat, abs(value) < x_threshold), fill = "azure3")
geom_tile(data = subset(plot_dat, abs(value) < x_threshold), fill = "grey91")

}

Expand All @@ -148,7 +148,8 @@ plot_differential_chiclet <- function(diff_uptake_dat = NULL,
merge(plot_dat, by = c("Sequence", "Start", "End", "Exposure", "ID"))

chiclet_differential_plot <- chiclet_differential_plot +
geom_tile(data = subset(diff_uptake_dat, !valid), aes(x = ID, y = Exposure), fill = "grey77")
geom_tile(data = subset(diff_uptake_dat, !valid), aes(x = ID, y = Exposure), fill = "grey89") +
geom_tile(data = subset(diff_uptake_dat, is.na(valid)), aes(x = ID, y = Exposure), fill = "grey56")

}

Expand Down

0 comments on commit e8bd0aa

Please sign in to comment.