Skip to content
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

monocle2 result is not reproducible! #516

Open
hieunguyen4193 opened this issue Aug 2, 2024 · 3 comments
Open

monocle2 result is not reproducible! #516

hieunguyen4193 opened this issue Aug 2, 2024 · 3 comments

Comments

@hieunguyen4193
Copy link

hieunguyen4193 commented Aug 2, 2024

Hello,

thank you for the great package. I'm curently using monocle 2.32.0 installed from bioconductor. During my analysis, I have observed that the DDRTree dimensional reduction, pseudotime assignment are not reproducible. With the same script and the same input (I'm also using docker to maintain all other packages, make sure they all have the same version and nothing out of control due to automatic update), I have got different result for each runs. Since the DDRTree dimensional reduction and the pseudotime were different, subsequent results were also different. I did set set.seed(42) at the beginning of the Rscript and any function I suspect it would affect, but the problem persists...

I'm looking forward to hearing from you.

Best regards
HN

@shihsama
Copy link

shihsama commented Sep 9, 2024

Hey!
I think you could set a seed right before the line of reduceDimension(). Just think about what you do in Seurat before RunUMAP() or RunTSNE(). In addtion, if you had performed downsampling before creating cds object, you'd better save an RDS/Rdata file so that you can start at the downsampled data next time and then adjust downstream parameters. You know, different cells sampled may well produced different result as well.
These are all the possibilities I can think of.

@hieunguyen4193
Copy link
Author

Hey :) thank you for your comment. I did what you mentioned: I placed "set.seed" at almost all step of the monocle2 pipeline, but it didn't work. And yes I did have saved data to .RDS files. However, the purpose of saving RDS file might be more on the "saving processing time" than "reproducibility".

To whoever might come up with this issue, here is my workaround: downgrading R packages. I install 3.6 and install monocle 2.12.0. With this version, a single "set.seed" at the beginning of the script maintain the reproducibility of all results. :)

@shihsama
Copy link

shihsama commented Sep 9, 2024

Hey :) thank you for your comment. I did what you mentioned: I placed "set.seed" at almost all step of the monocle2 pipeline, but it didn't work. And yes I did have saved data to .RDS files. However, the purpose of saving RDS file might be more on the "saving processing time" than "reproducibility".

To whoever might come up with this issue, here is my workaround: downgrading R packages. I install 3.6 and install monocle 2.12.0. With this version, a single "set.seed" at the beginning of the script maintain the reproducibility of all results. :)

I mean the purpose of saving data is to save the downsampled cells (corresponding barcodes actually) so that you can use thee same batch of cells to do downstream workflow, if you had done downsampling. If not, forget this job :) .

BTW, your work is brilliant!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants