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

Add Scvelo/Dynamo conversion function #551

Merged
merged 3 commits into from
Oct 9, 2023
Merged

Conversation

Sichao25
Copy link
Collaborator

The function can convert anndata objects between the Scvelo one and Dynamo one.

@Sichao25 Sichao25 marked this pull request as ready for review July 6, 2023 15:15
dynamo/tools/velocyto_scvelo.py Outdated Show resolved Hide resolved
Comment on lines +286 to +297
adata.layers["velocity_S"] = adata.layers.pop("velocity")
if "fit_alpha" in adata.var.columns:
adata.var["alpha"] = adata.var.pop("fit_alpha")
if "fit_beta" in adata.var.columns:
adata.var["beta"] = adata.var.pop("fit_beta")
if "fit_gamma" in adata.var.columns:
adata.var["gamma"] = adata.var.pop("fit_gamma")
if "fit_r2" in adata.var.columns:
adata.var["gamma_r2"] = adata.var.pop("fit_r2")
if "fit_u0" in adata.var.columns:
adata.var["u0"] = adata.var.pop("fit_u0")
if "fit_s0" in adata.var.columns:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add these to varm?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do that after we merge the "Save velocity parameters to .varm instead .var" branch. Then we can utilize the helper function like get_vel_params() or update_vel_params().

if "fit_u0" in adata.var.columns:
adata.var["u0"] = adata.var.pop("fit_u0")
if "fit_s0" in adata.var.columns:
adata.var["s0"] = adata.var.pop("fit_s0")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also this one

dynamo/tools/velocyto_scvelo.py Outdated Show resolved Hide resolved
dynamo/tools/velocyto_scvelo.py Show resolved Hide resolved
dynamo/tools/velocyto_scvelo.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Oct 9, 2023

Codecov Report

❗ No coverage uploaded for pull request base (master@d9c87cb). Click here to learn what that means.
The diff coverage is n/a.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

@@            Coverage Diff            @@
##             master     #551   +/-   ##
=========================================
  Coverage          ?   22.67%           
=========================================
  Files             ?      160           
  Lines             ?    26488           
  Branches          ?        0           
=========================================
  Hits              ?     6006           
  Misses            ?    20482           
  Partials          ?        0           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Xiaojieqiu Xiaojieqiu merged commit 583d2f1 into aristoteleo:master Oct 9, 2023
5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants