immunomind/immunarch

Adding a new proportions scale or consistent scale for multiple samples

apal6 opened this issue · 2 comments

apal6 commented

Hi,

Thank you for the wonderful package.

I have four samples and I want to have two y-axis scales for two conditions. I was trying to edit the function vis.immunr_dynamics
but there are multiple errors. Is there a better way to add two proportions axis on the alluvial plot?

Thank you in advance.

Hi @apal6

Thank you for using the package! Could you share an example of a plot with two y-axes? I'm not totally sure that I understood your idea. Something like this?

image

If so, I'm not sure how to do it. I'm not sure if ggalluvial allows this at all. Is there a reason for two plots side-by-side not working for you?

apal6 commented

Thank you for prompt response @vadimnazarov . Yes, this is essentially what I want:
Sample data:

tc1
       CDR3.aa     conditionA-1           conditionA-2           conditionB-1              conditionB-2
 1:     X               0.0003776435     0.0000000000        0.0000000000          0.0000000000
 2:     Y               0.0004855416     0.0012249898         0.0006634379         0.0005046682

Since the range of proportions in condition A and B varies alot, I thought of plotting them with two seperate axes to see the stacks of clonotypes regardless of how small the proportion is.

Like in the plot below, the scale helps in visualizing the MS1 sample only, if I could have a smaller scale on the right side to also accommodate lower proportion values to visualize other samples as well.

Screenshot 2023-11-02 at 11 10 59 AM

Thank you so much!