Skip to content

Commit

Permalink
Merge pull request #53 from FredHutch/gi_calc_rev_ki
Browse files Browse the repository at this point in the history
add beginning of GI review
  • Loading branch information
cansavvy authored Aug 12, 2024
2 parents 18901b2 + bb3c608 commit b6dc451
Show file tree
Hide file tree
Showing 6 changed files with 598 additions and 4 deletions.
4 changes: 1 addition & 3 deletions R/05-crispr-calc.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ calc_crispr <- function(.data = NULL,
pgRNA2_seq = gRNA2_seq,
mean_double_control_crispr_1 = mean_double_control_crispr,
mean_double_control_crispr_2
) %>%
# TODO: What we dropping here? This needs investigation
dplyr::distinct()
)

# Save at the target level
gimap_dataset$crispr_score <- crispr_df
Expand Down
3 changes: 2 additions & 1 deletion R/06-calculate_gi.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ calc_gi <- function(.data = NULL,
rep,
double_target_gi_score,
single_target_gi_score_1,
single_target_gi_score_2
single_target_gi_score_2,
expected_crispr
)

# Store this
Expand Down
Binary file added inst/rmd/d.HeLa_GI_scores_target
Binary file not shown.
Binary file added inst/rmd/gimap_dataset_calculated.RDS
Binary file not shown.
87 changes: 87 additions & 0 deletions inst/rmd/scratch_gimap_GI_review.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: "scratch gimap Genetic Interaction Review"
output: html_document
date: "`r Sys.Date()`"
---

```{r warning=FALSE, message=FALSE}
library(tidyverse)
library(devtools)
devtools::load_all()
```

## Get the gimap GI results

```{r}
gimap_dataset <- get_example_data("gimap") %>%
gimap_filter() %>%
gimap_annotate() %>%
gimap_normalize(
timepoints = "day",
replicates = "rep") %>%
calc_crispr() %>%
calc_gi()
```

```{r}
saveRDS(gimap_dataset, "gimap_dataset_calculated.RDS")
```

## Load the GI Mapping GI results

```{r}
old_gi_results <- readRDS("d.HeLa_GI_scores_target")
```

## Compare results

### Columns

```{r}
colnames(gimap_dataset$gi_scores)
```

```{r}
colnames(old_gi_results)
```

Looks like we want to compare the pgRNA targets which should be the `pgRNA_target_double` column for the gimap results and the `pgRNA_target` column for the GI Mapping results

Columns in the GI Mapping results not in the gimap results seem to include model results (`intercept`, `slope`) as well as some significance values (`p_val`, `fdr`), observed and expected CRISPR score (`mean_observed_CS` and `mean_expected_CS` (which I think I need for plotting)). And how does `mean_GI_score` relate to the three GI score columns in the gimap results?

### Target overlap

```{r}
length(unique(gimap_dataset$normalized_log_fc$pgRNA_target))
length(unique(old_gi_results$pgRNA_target))
length(unique(gimap_dataset$gi_scores$pgRNA_target_double))
length(intersect(unique(old_gi_results$pgRNA_target), unique(gimap_dataset$gi_scores$pgRNA_target_double)))
```

Only 1/3 of the GI Mapping targets are represented in the gimap results

### Number of observations/rows total and rep column overlap

```{r}
nrow(old_gi_results)
nrow(gimap_dataset$gi_scores)
```

The gimap results has far more rows

```{r}
table(old_gi_results$rep)
table(gimap_dataset$gi_scores$rep)
```

While the replicate values themselves can be synced like we've done in other reviews, this further shows the far greater number of observations (even if there are fewer represented pgRNA targets) in the gimap results

```{r}
head(old_gi_results)
```

508 changes: 508 additions & 0 deletions inst/rmd/scratch_gimap_GI_review.html

Large diffs are not rendered by default.

0 comments on commit b6dc451

Please sign in to comment.