Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In ir.pl.repertoire_overlap() function the fraction param is not working #424

Open
llumdi opened this issue Jul 3, 2023 · 4 comments
Open
Labels
bug Something isn't working

Comments

@llumdi
Copy link

llumdi commented Jul 3, 2023

When using the ir.pl.repertoire_overlap( ) function I get the same result with or without fraction=True.

The output is the clonotype size (nr of cells) in each sample, whereas what I would like to plot is the relative abundance of the clone in the sample. I would also like to plot the log10 scale (so that smaller frequencies are more visible). How can I do that?

An example of the current plot I am getting:
download

Thanks a lot for your support.

@llumdi llumdi added the bug Something isn't working label Jul 3, 2023
@llumdi llumdi changed the title In ir.pl.repertoire_overlap() function the fraction param not working In ir.pl.repertoire_overlap() function the fraction param is not working Jul 3, 2023
@grst
Copy link
Collaborator

grst commented Jul 5, 2023

Hi @llumdi,

thanks for raising this issue! The repertoire overlap plotting function is a bit of a mess at the moment and I need to rewrite it at some point (see #156). I'm afraid neither normalization nor log scaling currently works out of the box, but you can easily retrieve the individual clonotype sizes for each of your sample using the corresponding tl function:

df, _, _ = ir.tl.repertoire_overlap(adata, "sample", inplace=False)

df will the be a sample x clonotype data frame that you can use for making a plot yourself.

@llumdi
Copy link
Author

llumdi commented Jul 6, 2023

Thanks a lot for the workaround. Indeed, retrieving the underlaying data already helps.
Another issue I faced is that I was not able to reproduce the heatmap grid coordinates as in the tutorial. To me, yticklabels=True, xticklabels=True don't do anything. How can I add them?
See:
download

@grst
Copy link
Collaborator

grst commented Jul 7, 2023

The grid in the tutorial is more a side-effect of calling sc.set_figure_params() at the beginning of the tutorial rather than there on purpose.

You can enable it by activating the scanpy default settings using

import scanpy as sc
sc.set_figure_params()

or by explicitly setting the grid option in matplotlib

import matplotlib.pyplot as plt
plt.rcParams.update({"axes.grid" : True})

@llumdi
Copy link
Author

llumdi commented Jul 24, 2023

thanks for the help @grst. Strange that none of the two worked for me.
For the scatterplots, I report that I could generate the normalized version, thanks.

I would also like to report that in ir.tl.repertoire_overlap() function, the fraction=True param is also not working. I could only retrieve the nr of cells per clone. But would be very useful to be able to rertrieve the table with percentages directly.

@grst grst added this to scirpy-dev May 28, 2024
@grst grst moved this to ToDo in scirpy-dev May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: ToDo
Development

No branches or pull requests

2 participants