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

sample_posterior_predictive functionnot found #1

Open
Harrison-Q-Ma opened this issue Jan 28, 2025 · 1 comment
Open

sample_posterior_predictive functionnot found #1

Harrison-Q-Ma opened this issue Jan 28, 2025 · 1 comment

Comments

@Harrison-Q-Ma
Copy link

Greetings! I read your manuscript on bioRxiv and am trying to reproduce some of the analysis, specifically on estimating transcript diffusion. I was following the code in https://github.com/YosefLab/resolvi-reproducibility/blob/main/training_scripts/run_model.py but I got an error when I tried to run (line 84)

samples = model.sample_posterior_predictive(
        model=model.module.model_residuals,
        return_sites=[
            'mixture_proportions', 'mean_poisson', 'per_gene_background', 
            'diffusion_mixture_proportion', 'per_neighbor_diffusion', 'px_r_inv'
            ],
        batch_size=1000) 
samples = pd.DataFrame(samples).T 

It seems that sample_posterior_predictive is not a valid method in RESOLVI and I was not able to find it in the main scvi-tools github repo. I installed scvi-tools directly from the github repo and all other scvi.external.RESOLVI methods ran without error. Could you let me know how I can fix this error? Thanks in advance!

@canergen
Copy link
Member

Thanks for reporting it. Indeed the reproducibility repository was run using the previous repository. The inference function was standardized with scVI-tools when merging the model (most other code remained the same, except changed between scVI-tools 1.0 and 1.2). The original model is at: https://github.com/canergen/resolVI. However, I would warn against using it except for strict reproducibility. The scVI-tools version is the maintained one. Please see our tutorial for the updated API called: model.sample_posterior (results are the same except for random seed differences).

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