Comments (4)
Hi @Peevin , there is no standard way to define the appropriate maxit
value for different samples.
The convergence is defined numerically by the other argument tol
. Even with the same tol
value, the convergence speed is also dependent on the properties of input expression matrix (e.g. for one matrix you might reach numerical convergence within 20 iterations, but for another one you might need 50 iterations).
In practice you can keep using the same default value across your samples - it's the first few iterations that make the most significant changes to the gene expression. When the number of iterations grows bigger, the changes will become smaller, as you can see from the changes in likelihood value and max difference.
Let me know if that explains it or if you have additional questions.
from spotclean.
Hi @Peevin , there is no standard way to define the appropriate
maxit
value for different samples.The convergence is defined numerically by the other argument
tol
. Even with the sametol
value, the convergence speed is also dependent on the properties of input expression matrix (e.g. for one matrix you might reach numerical convergence within 20 iterations, but for another one you might need 50 iterations).In practice you can keep using the same default value across your samples - it's the first few iterations that make the most significant changes to the gene expression. When the number of iterations grows bigger, the changes will become smaller, as you can see from the changes in likelihood value and max difference.
Let me know if that explains it or if you have additional questions.
Thanks very much for your reply.
Based on your response, I checked the output of spotclean
in the RStudio console. As you mentioned, with increasing iterations, the change in max difference starts to become very small. In my previous runs, when it reached around 30 iterations, the change in max difference was already very small. Does this mean it has converged, or should I increase the number of iterations to ensure it stops when the max difference is below 1? Another question is, if I increase the number of iterations excessively to ensure it stops when the max difference is below 1, would it result in excessive data correction?
from spotclean.
Again, the definition of convergence is numerical and depends on tol
. If you increase tol
you could have a numerical convergence within 30 iterations.
For your second question, No - What the algorithm does is to find the parameter value that maximizes the likelihood (locally, to be rigorous). The iteration process is to move the current estimation closer and closer to the maximizer, but won't move beyond it.
In practice, 30 iterations should be sufficient, as any future iterations are making smaller and smaller changes to the estimation, but they still take the same amount of time to compute, which is not fast, to be honest.
from spotclean.
@zijianni Thank you very much! After careful consideration, we have made the decision to set a bigger maxit
parameter and utilize the default tol
setting for running spotclean
. This will help us obtain "cleaner" spatial transcriptome data, which is crucial for our downstream analysis.
from spotclean.
Related Issues (20)
- install for R <= 4.1.3 HOT 3
- Adapt to Spaceranger 2.0 output HOT 1
- Error in optim(x_init, .fn_optim, .gr_optim, method = "L-BFGS-B", obs_exp = obs_exp, : non-finite value supplied by optim HOT 15
- SpatialExperiment::spatialData now deprecated HOT 1
- Questions about tissue regions HOT 2
- Questions about the output HOT 1
- How to modify strength of SpotClean? HOT 5
- Issue due to missing spot barcodes in raw matrix HOT 10
- could spotclean work under situation that all spot 's tissue==1? that my ST data 's tissue position csv 's tissue is all 1,no o,that no backgroud spot HOT 3
- How to run with large datasets in limited memory? HOT 2
- Error in createSlide(), 'barcodes in count matrix do not match barcodes in slide info' HOT 9
- The tissue photographs were presented in the wrong horizontal and vertical ratio HOT 2
- Error in convertToSeurat function, "Error in FUN(left, right) : non-numeric argument to binary operator" HOT 2
- Prepare for upcoming Seurat v5 release HOT 1
- SpotClean performance on 11x11mm slides and questions regarding to output HOT 1
- Error: non-finite value supplied by optim HOT 7
- Ensembl IDs to Gene Names
- Error in keepHighGene(raw_ts_data, verbose = verbose) : no slot of name "meta.data" for this object of class "Assay" HOT 5
- Spotclean() stalls on testdata HOT 2
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 spotclean.