-
Notifications
You must be signed in to change notification settings - Fork 31
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
CITE-seq scatter plot of pairwise RNA-prot correlations #48
Comments
Hey @chris-rands, thanks a lot for your feedback! The reason was the lack of Moreover, for this there's now a more sophisticated function under the hood to parse variables so even the following things should work: mu.pl.scatter(mdata, x="X_umap:1", y="X_umap:2", color="CD8A")
# will produce a plot similar to mu.pl.umap(mdata, color="CD8A")
mu.pl.scatter(mdata, x="CD8A", y="CD8a_TotalSeqB", color="rna:X_umap:1")
# will set the colour to the first UMAP component in the RNA modality It also seems to me that scverse/scanpy#311 hasn't been actually fixed — is that your experience as well? Please let me know what you think! |
Hi @gtca, thank you very much, I didn't know this would require a new feature! I have tested it and it works. One comment, removing the "rna:" or "prot:" prefixes from the feature names isn't needed in my use case since I already ran I agree that the scanpy issue does not appear fixed in the sense that the Is it possible to add a regression line to the scatter plot? |
Hey @chris-rands, glad that it works! And thanks for your feedback. With regression, if this was implemented e.g. in # Calculate coefficients for the regression line
from numpy.polynomial.polynomial import polyfit
x = mdata["rna"][:,"CD3E"].X.squeeze()
y = mdata["prot"][:,"CD3_TotalSeqB"].X.squeeze()
a, b = polyfit(x, y, deg=1)
# Plot data
mu.pl.scatter(mdata, x="CD3E", y="CD3_TotalSeqB", show=False)
# Plot regression line and display the figure
plt.plot(x, a + b * x, "-")
plt.show() |
Thanks for muon. Following the CITE-seq tutorial, I'd like to do simple scatter plots and regression to show the RNA-prot correlation for particular markers, something like in the Seurat muli-modal tutorial.:

I tried
sc.pl.scatter(mdata, x="prot:CD3D", y="rna:CD3D")
This raises:KeyError: 'There is no key prot:CD3D in MuData .obs or in .obs of any modalities.'
Of course the gene/protein names are stored in.var
not.obs
.Suggestions appreciated, thank you
The text was updated successfully, but these errors were encountered: