Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add Relative Log Expression (RLE) Plots #348
base: main
Are you sure you want to change the base?
Add Relative Log Expression (RLE) Plots #348
Changes from 2 commits
8d9dfef
7012b83
9c60aee
5141dea
6e797e2
d563a3e
6c93fed
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is recomputing median-of-ratios size factors, right? (up to the +1 in the log)
In that case, it might be better to add a
size_factors
argument tomake_rle_plot
.From there, in
dds.plot_rle
, ifnormalize=True
, we would first check whether size factors (self.obsm["size_factors"]
) were already computed. If so, we pass them directly. If not, we callself.fit_size_factors
first.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @BorisMuzellec ,
For some reason when I use the size factors computed in dds.fit_size_factors() I do not get an RLE plot with the sample medians centered around 0.
But when I compute the sizefactors internally I do get an RLE plot with the sample medians centered around 0
Do you know what could be causing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why we would expect the sample medians to be zero given that RLE plot subtracts the gene medians. Also, I would be wary of making any conclusion from the test data.
That being said what you wrote is what is implemented in R's
plotRLE
method (https://rdrr.io/github/davismcc/scater/src/R/plotRLE.R). If it's standard, I'm happy to keep it as is.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jonathjd I think we may still have some consistency issues though: if we're using
log(counts + 1)
for size factors, shouldn't we also do the same everywhere (gene medians, and plotting)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BorisMuzellec Happy holidays! Sorry for the delay, I was on vacation.
It's probably a good idea to add the psuedocount to thegene_median
calculations so we don't divide by a gene with 0 counts across all samples. I can add that now.I added the psuedocount and ran some tests and the psuedocount alters the gene medians distance from the sample medians and skews the plot significantly.