Add some debug for rank plots
This commit is contained in:
@@ -585,13 +585,16 @@ adjust_missing_and_rank <- function(df, variables) {
|
|||||||
df[[z_lm_col]] <- if_else(is.na(df[[z_lm_col]]), 0.001, df[[z_lm_col]])
|
df[[z_lm_col]] <- if_else(is.na(df[[z_lm_col]]), 0.001, df[[z_lm_col]])
|
||||||
|
|
||||||
# Compute ranks and create new columns
|
# Compute ranks and create new columns
|
||||||
df[[rank_col]] <- rank(df[[avg_zscore_col]], na.last = "keep")
|
df[[rank_col]] <- rank(df[[avg_zscore_col]])
|
||||||
df[[rank_lm_col]] <- rank(df[[z_lm_col]], na.last = "keep")
|
df[[rank_lm_col]] <- rank(df[[z_lm_col]])
|
||||||
} else {
|
} else {
|
||||||
warning(paste("Columns", avg_zscore_col, "or", z_lm_col, "not found in data frame"))
|
warning(paste("Columns", avg_zscore_col, "or", z_lm_col, "not found in data frame"))
|
||||||
}
|
}
|
||||||
|
# Print some debugging output
|
||||||
|
print(df %>% select("OrfRep", "Gene", "conc_num", "conc_num_factor",
|
||||||
|
avg_zscore_col, z_lm_col, rank_col, rank_lm_col))
|
||||||
}
|
}
|
||||||
|
|
||||||
return(df)
|
return(df)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -771,8 +774,7 @@ generate_rank_plot_configs <- function(df, rank_var, zscore_var, var, is_lm = FA
|
|||||||
enhancer_label = NULL,
|
enhancer_label = NULL,
|
||||||
suppressor_label = NULL,
|
suppressor_label = NULL,
|
||||||
shape = 3,
|
shape = 3,
|
||||||
size = 0.1,
|
size = 0.1
|
||||||
position = "jitter"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return(configs)
|
return(configs)
|
||||||
@@ -1213,8 +1215,10 @@ main <- function() {
|
|||||||
file = file.path(out_dir, "ZScores_Interaction_Deletion_Suppressors_K_lm.csv"), row.names = FALSE)
|
file = file.path(out_dir, "ZScores_Interaction_Deletion_Suppressors_K_lm.csv"), row.names = FALSE)
|
||||||
|
|
||||||
# TODO needs explanation
|
# TODO needs explanation
|
||||||
|
message("Adjusting and ranking interactions scores")
|
||||||
zscores_interactions_adjusted <- adjust_missing_and_rank(zscores_interactions, variables = interaction_vars)
|
zscores_interactions_adjusted <- adjust_missing_and_rank(zscores_interactions, variables = interaction_vars)
|
||||||
|
|
||||||
|
message("Generating rank plots")
|
||||||
rank_plot_configs <- c(
|
rank_plot_configs <- c(
|
||||||
generate_rank_plot_configs(zscores_interactions_adjusted, "Rank_L", "Avg_Zscore_L", "L"),
|
generate_rank_plot_configs(zscores_interactions_adjusted, "Rank_L", "Avg_Zscore_L", "L"),
|
||||||
generate_rank_plot_configs(zscores_interactions_adjusted, "Rank_K", "Avg_Zscore_K", "K")
|
generate_rank_plot_configs(zscores_interactions_adjusted, "Rank_K", "Avg_Zscore_K", "K")
|
||||||
|
|||||||
Reference in New Issue
Block a user