Skip to content

Commit

Permalink
Merge pull request #9 from EmanuelSoda/fix2
Browse files Browse the repository at this point in the history
Fix2
  • Loading branch information
EmanuelSoda authored Sep 8, 2023
2 parents 6af9546 + 99b28c3 commit 98b8a11
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions R/filter_by.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,18 @@ filter_by_slope <- function(screenR_Object, genes, group_var_treatment,
data <- dplyr::distinct(data, .data$Gene,
.data$slope_control, .data$slope_treatment)
# The treatment has more effect than the control



data <- dplyr::mutate(data, keep = dplyr::case_when(

.data$slope_control <= 0 & .data$slope_treatmet <= 0 &
.data$slope_control <= 0 & .data$slope_treatment <= 0 &
.data$slope_treatment < .data$slope_control ~ TRUE,

.data$slope_control >= 0 & .data$slope_treatment >= 0 &
.data$slope_treatment >= .data$slope_control ~ FALSE,

.data$slope_control >= 0 & .data$slope_treatment <= 0 ~ TRUE))
.data$slope_control >= 0 & .data$slope_treatment <= 0 ~ TRUE)
)

data <- dplyr::filter(data, .data$keep)
data$keep <- NULL
Expand Down

0 comments on commit 98b8a11

Please sign in to comment.