reconstrue / single_cell

Single cell analysis tools built to run on Jupyter, especially Colab
http://reconstrue.com
Apache License 2.0
1 stars 0 forks source link

Pezzotti Focus&Context UX can be cast as UMAP custom distance function #76

Open JohnTigue opened 4 years ago

JohnTigue commented 4 years ago

The custom distance function in this case is one that changes during the development of the embedding, as the user sets the tree of focuses. Each newly set focus is another change in the distance function as some region gets fisheye zoomed.

JohnTigue commented 4 years ago

umap-js has custom distance functions since 2019-06.

[E.g. of asyn fitting]():

import { UMAP } from 'umap-js';

const umap = new UMAP();
const embedding = await umap.fitAsync(data, epochNumber => {
  // check progress and give user feedback, or return `false` to stop
});

Or step-by-step:

import { UMAP } from 'umap-js';

const umap = new UMAP();
const nEpochs = umap.initializeFit(data);
for (let i = 0; i < nEpochs; i++) {
  umap.step();
}
const embedding = umap.getEmbedding();