Skip to content

Providing init to the phateR implementation only saves up time if only the parameter t is changing but not other parameters? #143

@erzakiev

Description

@erzakiev

I was hoping on saving some time on computation as each time phateR::phate runs, ~75% of time goes to PCA and KNN graph calculation:

Calculating PHATE...
  Running PHATE on 52398 observations and 32344 variables.
  Calculating graph and diffusion operator...
    Calculating PCA...
    Calculated PCA in 143.55 seconds.
    Calculating KNN search...
    Calculated KNN search in 53.70 seconds.
    Calculating affinities...
    Calculated affinities in 75.59 seconds.
  Calculated graph and diffusion operator in 273.90 seconds.
  Calculating landmark operator...
    Calculating SVD...
    Calculated SVD in 48.39 seconds.
    Calculating KMeans...
    Calculated KMeans in 13.31 seconds.
  Calculated landmark operator in 65.04 seconds.
  Calculating optimal t...
    Automatically selected t = 23
  Calculated optimal t in 4.87 seconds.
  Calculating diffusion potential...
  Calculated diffusion potential in 0.93 seconds.
  Calculating metric MDS...
  Calculated metric MDS in 4.46 seconds.
Calculated PHATE in 349.23 seconds.

In case of a fixed knn and re-calculation of the map with different parameters of e.g. decay or gamma, this is a purely redundant overhead that could be avoided. I thought passing to init a previous phate object with at least the same knn parameters would help the issue, but apparently the only place where it speeds up the things is when we recompute using a different t.

If i want to avoid to recalculate PCA and KNN graph each time, should i pass a pre-computed affinity matrix to the data variable, as instructed in the man page of phateR::phate? If so, can I use knn graph, generated by Seurat's FindNeighbors function for that purpose?

Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions