Comments (12)
Hi @cnk113,
Thanks for the interest and the feedback! Happy to hear that you like the package.
This is indeed a very interesting addition. I guess you mean using it as scoring method in SCpubr::do_EnrichmentHeatmap()
no?
I will have a look at it and put in the To-Do list!
Best,
Enrique
from scpubr.
Hey Enrique,
Yes that's the function I was thinking of.
Best,
Chang
from scpubr.
Hi @cnk113,
I have implemented the method in the last commit. Could you please check it out and tell me if it works for you as intended?
devtools::install_github("enblacar/SCpubr", ref = "d6e7617a9c4e7817da8bf9bfde73eb7634991625")
For this, use the following code:
SCpubr::do_EnrichmentHeatmap(sample = sample,
input_gene_list = genes,
ncores = 1,
flavor = "UCell",
storeRanks = TRUE)
With it, I got the following plot:
While with Seurat's AddModuleScore
:
If it also works as intended for you, then I will do some more aesthetic tweaks and I will add it to the next CRAN update!
A couple of notes though:
- You need to have R version higher or equal to 4.2.0.
- You need UCell installed.
Looking forward to your feedback!
Enrique
from scpubr.
Hey Enrique,
I'm getting this error when I run it without the UCell parameter:
SCpubr::do_EnrichmentHeatmap(sample = first, group.by = 'clusters', input_gene_list = sigs)
Error in `[.data.frame`([email protected], , col_name) :
undefined columns selected
Do you know why this occurs?
Best,
Chang
from scpubr.
Hi @cnk113,
Hmm, interesting. Does this happen, under the same parameters, when flavor = "UCell"
? Can you maybe double-check if group.by
is a metadata variable without NAs and sigs
is a named vector?
I will have a look also to the code, but so far it works for me in any combination I provide.
Best,
Enrique
from scpubr.
Ah my named lists had characters that would change in the UCell names due to naming issues. It works!
from scpubr.
So something to note, I was wondering if we could get max enrichment percentile cutoff over the group.by
metadata? This way we can see the most enriched sig per cluster?
As you can see here the other clusters don't look as enriched due to an outlier and I think the module scores are relative values so I don't see an issue with doing the cutoffs per cluster?
from scpubr.
Hi @cnk113,
Glad to hear it worked for you!
I do not fully understand what you are trying to suggest here, but it gave me another idea that might work as well as what you say. In the last commit, I implemented a min.cutoff
and max.cutoff
parameter, which will let you subset the color scale to set the min or max values to a given one. The values have to be comprised in the absolute max or min values in the enrichment matrix.
This is a change affecting all the clusters at the same time, not a single one. But this is basically the aim of the visualization, to put the enrichment in a heatmap and compare between clusters.
Here you have some examples:
# Original heatmap.
SCpubr::do_EnrichmentHeatmap(sample = sample,
input_gene_list = genes,
ncores = 1,
flavor = "UCell",
storeRanks = TRUE)
# Set a max value for the scale.
SCpubr::do_EnrichmentHeatmap(sample = sample,
input_gene_list = genes,
ncores = 1,
flavor = "UCell",
storeRanks = TRUE,
max.cutoff = 0.5)
# Set a min value for the scale.
SCpubr::do_EnrichmentHeatmap(sample = sample,
input_gene_list = genes,
ncores = 1,
flavor = "UCell",
storeRanks = TRUE,
min.cutoff = 0.5)
# Set a min and a max value for the scale
SCpubr::do_EnrichmentHeatmap(sample = sample,
input_gene_list = genes,
ncores = 1,
flavor = "UCell",
storeRanks = TRUE,
min.cutoff = 0.2,
max.cutoff = 0.5)
Please install the commit using:
devtools::install_github("enblacar/SCpubr", ref = "52429ab0e0dc1d99450f6807bb840f392a577e08")
And be aware this is a dev version so the code might break. Let me know if this works for you! The changes will appear in the next CRAN update.
Best,
Enrique
from scpubr.
Ok this works for me! Thanks for the quick turnaround.
Best,
Chang
from scpubr.
Ah one more thing, could you perhaps have cutoffs also applicable to your other heatmaps like pathways/TF?
from scpubr.
Hi @cnk113,
Happy to hear it worked for you! I have added min.cutoff
and max.cutoff
behaviour to all the rest of heatmap functions.
You can access this by:
devtools::install_github("enblacar/SCpubr", ref = "c6e4f7bbc635d49ec349c7b2c4832a5e144745e1")
All the changes will become part of the next CRAN update.
Closing this Issue for now. Thanks for your feedback!
Enrique
from scpubr.
All the changes have been implemented in SCpubr v1.0.3, currently available on CRAN.
Best,
Enrique
from scpubr.
Related Issues (20)
- check_suggests does not print missing package names | check_suggests HOT 1
- BUG | `.GetAssayData` | Incorrect assumptions about SeuratObject versions HOT 1
- How to manually edit the complexHeatmap parameters after generating the heatmap? HOT 1
- BUG | do_EnrichmentHeatmap | features.order not working? HOT 1
- Prepare for upcoming Seurat v5 release HOT 1
- [do_DimPlot] add an option to hide the "combined" view HOT 2
- SCpubr suugests rgdal, but rgdal will be archived, as announced months ago, on 16 October HOT 1
- REQUEST | do_DimPlot | using "split.by" I do not want to see a "combined" plot HOT 4
- REQUEST | do_ViolinPlot | I want order to be added HOT 2
- Where is the function do_AzimuthAnalysisPlot HOT 1
- do_GroupwiseDEPlot with output of FindConservedMarkers HOT 1
- do_DotPlot Sequential palette, diverging, white on extreme low end HOT 1
- do_AzimuthAnalysisPlot is not an exported object from 'namespace:SCpubr' HOT 3
- Output of Featureplot and Dimplot are of different size HOT 1
- BUG | do_EnrichmentHeatmap | Undefined columns selected when providing named lists with dashes on the names. HOT 2
- BUG | Do_FeaturePlot | Plotting multiple FeaturePlots with idents.highlight prints them in a line rather than a grid HOT 1
- Do_FeaturePlot | Set custom scales/limits OR copy Seurat::FeaturePlot keep.scale parameter HOT 2
- REQUEST | do_featureplot | shared espression of One or more genes HOT 1
- do_DiffusionMapPlot returns empty plots HOT 1
- Extract coordinated from do_CellularStatesPlot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scpubr.