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

Computing Metrics on Seurat Objects #411

Open
VishD17 opened this issue Jul 9, 2024 · 0 comments
Open

Computing Metrics on Seurat Objects #411

VishD17 opened this issue Jul 9, 2024 · 0 comments

Comments

@VishD17
Copy link

VishD17 commented Jul 9, 2024

Hello,

Thank you for this great tool! We had some questions on how the scib metrics are computed on seurat objects.

  1. We converted seurat objects to h5ad using sceasy in Jupyter through an R environment. Then, we opened these h5ad objects in a Python environment and directly ran the scib metrics wrapper function without any pre-processing. That's when we noticed abnormally low pcr comparison scores, which we believe to be a consequence of recomputing pca & not utilizing the 'X_pca' embedding. Our solution (shown below) was to change recompute_pca to True for both pcr_before & pcr_after and add "embed" = "X_pca" for pcr_before & pcr_after. Do you think we taking the correct approach?

  2. We also noticed that when scale is false, the score is calculated pcr_after - pcr_before instead of pcr_before - pcr_after like the scaled score. Is this a bug?

  3. For what other metrics are PCs being recomputed by default? Would this be an issue for other metrics e.g kbet as well?

Thank you for the help!

# if embed == "X_pca":
#       embed = None

#Individually Calculating PC_Reg Comparison Score
    pcr_before = scib.metrics.pcr(
        adata_unint,
        covariate="species",
        embed = "X_pca", 
        recompute_pca=False,
        n_comps=50,
        verbose=False
    )

    pcr_after = scib.metrics.pcr(
        exp_1a,
        covariate="species",
        embed="X_pca",
        recompute_pca=False,
        n_comps=50,
        verbose=False
    )

pcr_comp_score = (pcr_before - pcr_after)/pcr_before
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

1 participant