Open Biomiha opened 3 years ago
@Biomiha, looks like cyto_plot()
is getting confused as to which layer it is labelling. If you look closely you will see that the statistic is in a separate label to "Monocytes" - so for some reason it has skipped the displaying the Monocytes statistics in favour of a different layer. I have probably fixed this already on the coming version of CytoExploreR but maybe I can push a temporary fix for you.
Do you get the same issue when plotting with cyto_plot()
directly?
cyto_plot(gs[[1]],
parent = "Live",
alias = c("Lymphocytes", "Monocytes", "Granulocytes"),
overlay = c("Lymphocytes", "Monocytes", "Granulocytes"),
channels = c("FSC-H", "SSC-H"))
@DillonHammill Yes, the second plot (at the bottom) was made using cyto_plot and it looks like the population percentages are as expected. If you compare the gate percentages in the plot at the top, there are 2 differences - the lymphocyte gate should be ~41% (instead of ~4%) and the monocyte gate should be roughly 2% instead of 1793%. Thanks for the feedback. Looking forward to the new version.
Are you able to include the image generated by cyto_plot()
with all the overlays? It will help to track down where things have gone wrong. Sorry just realised I omitted this from my previous comment, I just updated the code in my above comment.
Similarly, an image generated by cyto_plot_gating_scheme()
with back_gate = FALSE
would be equally useful.
Using cyto_plot_gating_scheme(x = gs[[1]], back_gate = FALSE, gate_track = TRUE, axes_trans = trans_obj, legend = FALSE)
gives me:
Whereas if I try
cyto_plot
with overlays, I get the following warning message and the plot below:
Warning message:
In split.default(TNP, rep(seq_len(SMP), each = NP)) :
data length is not a multiple of split variable
Thanks @Biomiha, this is very helpful. Unfortunately it looks like I was right and cyto_plot()
is getting the layers mixed up when overlays are present. I will take a closer look and get back to you.
@Biomiha, I managed to track down the bug. I have just pushed the fix to the master branch for you:
devtools::install_github("DillonHammill/CytoExploreR")
Note to self: This bug is not present in coming version as this code has already been re-written.
Hi @DillonHammill,
I keep getting the following error if I specify: back_gate = TRUE
Error in if (channels[1] == channels[2] | (!.empty(channels[1]) & .empty(channels[2]))) { :
missing value where TRUE/FALSE needed
I'm not sure if it is to do with my GatingSet or something else but it seems to work when back_gate = FALSE
.
@Biomiha, looks like you have added a boolean
gate to your gating scheme, the plotting of which is not currently supported by cyto_plot_gating_scheme()
.
Closing as I believe the original issue has been resolved.
Hi @DillonHammill,
There's no boolean gate but unfortunately I haven't been able to figure out what is causing the issue. I think it's best if you close the issue for now and I'll do some troubleshooting to hopefully find out what the source of the problem is.
Thanks.
@Biomiha, if you send through your gatingTemplate I can take a closer look. There must be an entry in there without defined channels.
@DillonHammill - apologies for the delay. I've sent it to your email address.
Thanks @Biomiha, looks like your gates are OK. Are you able to send through the output of:
gt <- openCyto::gh_generate_template(gs[[1]])
write.csv(gt, "gatingTemplate.csv", row.names = FALSE)
Thanks @DillonHammill. I've sent it across to your email.
Thanks @Biomiha, not sure what is going on here - back gating shouldn't influence the channels in any way. This is very old code and I will be re-writing cyto_plot_gating_scheme()
soon.
Hi @DillonHammill,
I'm seeing some unusual behavior with the population percentages when I plot a sample with![Gating_scheme](https://user-images.githubusercontent.com/29175188/114249772-70676a80-9993-11eb-9f33-141e1ad1c7b0.png)
cyto_plot_gating_scheme
(e.g. 1793%)Whereas
Is this because of the back gating or could it be because there are multiple gates on the same plot?
cyto_plot
plots accurate percentages for the same sample:Many thanks in advance.