topTable function: show_logFC argument doesn't work
Hello,
Could you help me with the show_logFC argument in the topTable function? When I set it equal to TRUE, I receive an error:
Error: subscript contains invalid names
I did a little digging, and it doesn't look like there are any arguments in the diffcyt function that outputs a logFC value associated with the object, unless I'm doing something wrong. I recreated the steps seen here, but no matter what I do, there is never a logFC column in the result object, so the matrix subsetting that happens in line 186 or 188 (depending on whether DA or DE) always fails.
For reproducibility, see code snippet below.
rslt <- diffcyt(daf, # daf is a SingleCellExperiment
formula=fmla, # fmla was created using createFormula
contrast=ctst, # ctst is a basic contrast matrix
analysis_type='DA',
method_DA='diffcyt-DA-GLMM',
clustering_to_use='meta20',
verbose=F)
tt <- topTable(rslt, all=T, show_props=T, format_vals=F, show_logFC=T)
Let me know if there is any further info you need from me. I am running the latest version of this package (and others, like CATALYST) on R 4.0.2. Thanks for any and all help!
J.D.
Hello,
Just following up to see if anyone has seen or fixed this bug. Looking forward to figuring out a solution.
J.D.
Hi J.D.,
Sorry for the delay in responding. I tried out some examples today, and you are right, the show_logFC argument doesn't work when using method diffcyt-DA-GLMM.
I traced this back to my implementation of the method. For the other methods (diffcyt-DA-edgeR and diffcyt-DA-voom), the logFC values are calculated automatically by the underlying method, so we pass these along in the output. However, for diffcyt-DA-GLMM, the logFC values are never calculated in the first place.
I will think about how best to add this - maybe simply calculating them manually inside the method.
I will let you know again when I have found a solution and updated it.
Hi I am checking if there is a solution for this, as I encoutered the same problem