Comments (3)
Dear @wangjiawen2013,
Great suggestions!
There have been several requests for scanpy support. I have not started this; I will look into what it would take.
For reproducibility, I'm working on this feature now. In the meantime, I've found that setting the random seed in R (e.g. set.seed(1)) before running Harmony gets you 90% of the way there. This is because Harmony now initializes clusters with base R kmeans. When these initial clusters are the same, the final Harmony answer is also often consistent.
Thanks for your patience!
Best,
Ilya
from harmony.
Thanks for you powerful tool. I integrated harmony into my scanpy pipeline in a customized manner now, however, I hope you can release a version that compatible well with scanpy.
from harmony.
Dear @wangjiawen2013,
In more recent tests, I've found that set.seed()
works both initialization and Harmony clustering. This code demonstrates that. When you change either one of the seeds in cluster initialization or cluster updates, the result will be slightly different.
library(harmony)
data(cell_lines_small)
with(cell_lines_small, {
## seed affects cluster initialization
set.seed(1)
res1 <<- HarmonyMatrix(
scaled_pcs, meta_data, 'dataset',
do_pca=FALSE, verbose=FALSE, return_object=TRUE, max.iter.harmony=0
)
## seed affects cluster initialization
set.seed(1)
res2 <<- HarmonyMatrix(
scaled_pcs, meta_data, 'dataset',
do_pca=FALSE, verbose=FALSE, return_object=TRUE, max.iter.harmony=0
)
})
max(abs(res1$Z_corr - res2$Z_corr))
## seed affects harmony updates in `update_R()`
set.seed(1)
.x <- harmony:::harmonize(res1, 10, FALSE)
## seed affects harmony updates in `update_R()`
set.seed(1)
.x <- harmony:::harmonize(res2, 10, FALSE)
max(abs(res1$Z_corr - res2$Z_corr))
Best,
Ilya
from harmony.
Related Issues (20)
- How do I download version 0.99.9 of harmony? HOT 20
- Differential expression and volcano HOT 4
- Error: matrix multiplication: incompatible matrix dimensions: 100x96490 and 96489x22 HOT 1
- feature.loadings of harmony is missing in SummarizedExperiment
- Plotting Function do_scatter Does Not Exist HOT 1
- No Instructions for Tissues and Cell Culture Merging HOT 6
- Convergence plot showing bizarre reading, data okay to use? HOT 2
- vars_use Definition Not Explicit
- Cannot reproduce Seurat.ipynb vignette; parameters not passed HOT 3
- Integration of scATACseq datasets HOT 1
- Reordering PCs? HOT 1
- Is it okay to paste two covariates into one when correcting for two covariates? HOT 4
- Can i obtain my original data shape? HOT 3
- Trying to load pbmc.RData from Zenodo HOT 2
- "Is It Feasible to Use Harmony Directly for Batch Correction in Seurat V5 Instead of “ IntegrateLayers“?" HOT 5
- Harmony using a predefined clustering vector HOT 5
- advice about parameters for integration
- Gene-level Correction
- argument 3 matches multiple formal arguments
- how to use harmony for Seurat Spatial Data?
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 harmony.