theislab / scCODA

A Bayesian model for compositional single-cell data analysis
BSD 3-Clause "New" or "Revised" License
141 stars 23 forks source link

Allow set random seed for reproducibility in `CompositionalAnalysis` objects #49

Open yihming opened 2 years ago

yihming commented 2 years ago

Usage

In sccoda.util.comp_ana.CompositionalAnalysis, add seed optional parameter:

johannesostner commented 2 years ago

Hi, thanks for this pull request! I am unsure though, whether this change is necessary. As far as I know, it is also possible to get consistent results by running

tf.random.set_seed(0)
model_salm = mod.CompositionalAnalysis(data_salm, formula="Condition", reference_cell_type="Goblet")

Are you aware of any situations where this strategy could fail to produce reproducible results?