-
Notifications
You must be signed in to change notification settings - Fork 0
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
Making this work for different experimental set ups #63
Conversation
Thus far normalization step is up to speed but I need to walk through the steps in crispr calculation and genetic interaction testing to make sure the changes here are carried all the way through. |
The NAs are just partial parts of columns rather than the whole columns. I also found that they're a subset of the type of pgRNAs. Looking into the building of
|
@@ -76,14 +57,7 @@ calc_crispr <- function(.data = NULL, | |||
# fact that single-targeting pgRNAs generate only two double-strand breaks | |||
# (1 per allele), whereas the double-targeting pgRNAs generate four DSBs. | |||
# To do this, we set the median (adjusted) LFC for unexpressed genes of each group to zero. | |||
crispr_score = lfc_adj - median, | |||
# TODO: I think this n_genes_expressed variable is never used so can we eliminate? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't end up using this so its deleted.
@@ -107,32 +81,37 @@ calc_crispr <- function(.data = NULL, | |||
target_type == "gene_ctrl" ~ gRNA1_seq, | |||
target_type == "ctrl_gene" ~ gRNA2_seq | |||
), | |||
control_gRNA_seq = case_when( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these steps had to be rearranged. @kweav and I went through this together to figure it out. Needed the double control crisprs to be aligned with the single gene targets they are related to.
R/06-calculate_gi.R
Outdated
mean_observed_crispr = mean(double_crispr_score, na.rm = TRUE) | ||
) %>% | ||
group_modify(~ broom::tidy(lm(mean_observed_crispr ~ mean_expected_crispr, data = .x))) | ||
mean_expected_double_crispr = mean(expected_crispr_double, na.rm = TRUE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of the stats needed adjusting because the single and double crispr scores are calculated differently in their own linear models. @kweav and I pair programmed on this together, referencing the original code.
|
||
if (rm_ids_wo_annot){ | ||
lfc_df <- lfc_df %>% | ||
filter(!pg_ids %in% missing_ids$missing_ids) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The missing_ids weren't fully being dropped because it was a vector inside a data.frame so that is fixed here.
Okay. Vignettes are updated and tests are passing. Going to merge this and we can continue to polish in a new PR. |
Description
Started by making fake data (added that script here)
Now running through the steps and adjusting how folks can specify the different treatment groups.
This needs more work. @kweav and I will pair program on this Wednesday