error with pbDS: how to set the correct parameters
Closed this issue · 1 comments
this is my data frame:
colData(pb)
DataFrame with 8 rows and 3 columns
group_id treatment timepoint
KO_d6_r1 KO_d6 KO d6
KO_d6_r2 KO_d6 KO d6
KO_d8_r1 KO_d8 KO d8
KO_d8_r2 KO_d8 KO d8
WT_d6_r1 WT_d6 WT d6
WT_d6_r2 WT_d6 WT d6
WT_d8_r1 WT_d8 WT d8
WT_d8_r2 WT_d8 WT d8
and I have a model matrix design like this
design <- model.matrix(~0+pb$group_id)
design
pb$group_idKO_d6 pb$group_idKO_d8 pb$group_idWT_d6 pb$group_idWT_d8
1 0 0 0
1 0 0 0
0 1 0 0
0 1 0 0
0 0 1 0
0 0 1 0
0 0 0 1
0 0 0 1
I am interested comparing pb$group_idKO_d6 vs pb$group_idKO_d8,
pb$group_idWT_d6 vs pb$group_idWT_d8,
pb$group_idKO_d6 vs pb$group_idWT_d6,
pb$group_idKO_d8 vs pb$group_idWT_d8.
I do colnames(design) <- c("KO_d6", "kO_d8", "WT_d6", "WT_d8")
If I run
res_ds <- pbDS(pb, method = "edgeR",
design = design,
coef = 1:2) #to compare ko_d6 vs ko_d8
the result is
res<-pbDS(pb, coef = 1:2, design = design)
|============= | 7%
Errore: BiocParallel errors
1 remote errors, element index: 1
13 unevaluated and other errors
first remote error:
Error in design[colnames(y <- pb[, !rmv]), , drop = FALSE]: subscript out of bounds.
can u explain to me a correct way to do this kind of comparisons?
Been a while since this was posted, but...
- Please use code-blocks (i.e,. 3 back ticks before and after) when posting code. This is difficult to comprehend.
- In the code above, there's one sample per
group_id
, which won't do. I thinktreatment
should be treated as thegroup_id
here, whereas yourgroup_id
should besample_id
(assuming_r1/2
are replicates). In any case, it's important to understand what these variables mean here, i.e., the treatment is the experimental condition you're interested in comparing. Sample identifiers simply make clear which cells belong to which sample.