HaojiaWu / plot1cell

A R package for advanced single cell data viz
MIT License
36 stars 22 forks source link

Error in the expression #10

Open apal6 opened 2 months ago

apal6 commented 2 months ago

Hi,

Thank you for the wonderful package. I was plotting the expression of genes using the fucntion: complex_dotplot_single(seu_obj =sobj, feature = "gene1", groups = "condition")

I get no expression of gene1 in the last column. However, when I looked at the feature plot, I get a very high expression of the gene1 in the clusters. What do you think could be happening here?

Screenshot 2024-03-05 at 2 25 39 PM Screenshot 2024-03-05 at 2 24 26 PM

Thank you

HaojiaWu commented 2 months ago

Thanks for your interest in using plot1cell. I have a few questions. When you look at the pct.exp and avg.exp in the figure legend, what are the minimal values? If you run this command in R DefaultAssay(sobj), what does it return? If you set do.scale=F, does it help? I will take a look after you provide this information.

apal6 commented 2 months ago

Thank you for prompt response.

Screenshot 2024-03-05 at 3 15 51 PM

I tried it with RNA and integrated assay. both look the same. complex_dotplot_single(seu_obj =sobj, feature = "gene1", groups = "conditon", do.scale=F)

doesn't help with do.scale too.

thank you

HaojiaWu commented 2 months ago

I see the issue now. The data shown on the plot is still accurate. The problem is that the dot size was automatically scaled based on the lowest and highest percentage of the gene expression. We set an argument do.scale to prevent this but it seems not working for Seurat V5. We are planning to update the package to make it compatible with Seurat V5. That may need some time but I will let you know once it is released. Stay tuned.

apal6 commented 2 months ago

@HaojiaWu Thank you. How do you think i could get it working for now? I used this for looking at the expression of other genes. Do you think it is reasonable to look at the expression of genes and how they change in different conditions with the current version if it is automatically scaling based on the lowest and highest percentage of the gene expression.?

HaojiaWu commented 2 months ago

For a quick fix, you can use the codes below to ensure the dot size starts at 0 and ends at 100.

library(plot1cell)
library(Seurat)
library(ggplot2)
complex_dotplot_single(seu_obj =sobj, feature = "gene1", groups = "condition") +   scale_size_continuous(range = c(0, 10), limits = c(0, 100))
apal6 commented 2 months ago

Thank you so much, Haojia. I was able to scale this and looking forward to the update.

Best regards, Aastha

From: Haojia Wu @.> Date: Tuesday, March 5, 2024 at 7:37 PM To: HaojiaWu/plot1cell @.> Cc: Aastha Pal @.>, Author @.> Subject: Re: [HaojiaWu/plot1cell] Error in the expression (Issue #10)

For a quick fix, you can use the codes below to ensure the dot size starts at 0 and ends at 100.

library(plot1cell)

library(Seurat)

library(ggplot2)

complex_dotplot_single(seu_obj =sobj, feature = "gene1", groups = "condition") + scale_size_continuous(range = c(0, 10), limits = c(0, 100))

— Reply to this email directly, view it on GitHubhttps://github.com/HaojiaWu/plot1cell/issues/10#issuecomment-1980022778, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6PEVUXS5GRFHOXC3A33T2TYW2FOVAVCNFSM6AAAAABEH6XR4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBQGAZDENZXHA. You are receiving this because you authored the thread.Message ID: @.***>

apal6 commented 2 weeks ago

Hi Haojia,

Thank you for the wonderful packages. I was plotting the complex_dotplot_multiple on the the timepoints and I get the below plot:

And later on, I removed the one of timepoint plotted on X axis, and I get a different expression plot.

Screenshot 2024-05-01 at 12 37 21 PM Screenshot 2024-05-01 at 12 37 29 PM

As you can see the expression values are very different after dropping cells from a timepoint. I wonder why is so? How can I account for this change?

Thank you, Aastha

From: Aastha Pal @.> Date: Wednesday, March 6, 2024 at 9:34 AM To: HaojiaWu/plot1cell @.>, HaojiaWu/plot1cell @.> Cc: Author @.> Subject: Re: [HaojiaWu/plot1cell] Error in the expression (Issue #10) Thank you so much, Haojia. I was able to scale this and looking forward to the update.

Best regards, Aastha

From: Haojia Wu @.> Date: Tuesday, March 5, 2024 at 7:37 PM To: HaojiaWu/plot1cell @.> Cc: Aastha Pal @.>, Author @.> Subject: Re: [HaojiaWu/plot1cell] Error in the expression (Issue #10)

For a quick fix, you can use the codes below to ensure the dot size starts at 0 and ends at 100.

library(plot1cell)

library(Seurat)

library(ggplot2)

complex_dotplot_single(seu_obj =sobj, feature = "gene1", groups = "condition") + scale_size_continuous(range = c(0, 10), limits = c(0, 100))

— Reply to this email directly, view it on GitHubhttps://github.com/HaojiaWu/plot1cell/issues/10#issuecomment-1980022778, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A6PEVUXS5GRFHOXC3A33T2TYW2FOVAVCNFSM6AAAAABEH6XR4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBQGAZDENZXHA. You are receiving this because you authored the thread.Message ID: @.***>

apal6 commented 2 weeks ago

Hi @HaojiaWu,

I am not able to do the do.scale =F for the complex_dotplot_multiple. How else can I make sure that the plot is not getting scaled removing a condition?