You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A <- data.frame(predict(dmy, newdata = perturb))[,-1] # cell-by-trt matrix
31
+
A <- data.frame(
32
+
model.matrix(~ trt_ - 1, data = perturb)[, -1, drop = FALSE],
33
+
check.names = FALSE
34
+
) # cell-by-trt matrix; remove the first (GFP control) column
34
35
```
35
36
36
37
For running causarray, we require the following inputs:
@@ -68,11 +69,12 @@ res_gate <- causarray$fit_gcate(Y, X, A, r, verbose=TRUE) # a list of results fr
68
69
U <- res_gate[[2]]$U
69
70
```
70
71
71
-
Next, we apply causarray to estimate the causal effects of perturbations on gene expression.
72
+
Next, we apply causarray to estimate the causal effects of perturbations on gene expression. We use unequal (Welch) variance because treatment and control cells can have different pseudo-outcome variability; pooling those variances can be anti-conservative in a perturbation screen.
72
73
73
74
```{r}
74
75
offsets <- log(res_gate[[2]][['kwargs_glm']][['size_factor']]) # use the precomputed size factors
75
-
res <- causarray$LFC(Y, cbind(X, U), A, cbind(X_A, U), offset=offsets, verbose=TRUE)
76
+
res <- causarray$LFC(Y, cbind(X, U), A, cbind(X_A, U), offset=offsets,
0 commit comments