Giter Club home page Giter Club logo

utility_functions's People

Contributors

jlrestrepol avatar marius1311 avatar michalk8 avatar

Watchers

 avatar

Forkers

jlrestrepol

utility_functions's Issues

Option to group histogram representation by key

Often, we want to compare distributions of key quality metrics (like counts dept) accross various batches. For example, the scanpy funciton sc.pl.violin has an option groupby= for this. It would be fantastic to have a similar option in the interactive_histograms functions, so that we get one histogram per batch per quality metric, or two or more histograms with different colors in the same plot.

Change colors in histogram function

These current shades of blue are really hard to tell apart, can we use a different colormap here, or even let the user chose the colormap?

Caching the velocity graph fails

I try to run cache.velocity_graph(adata, force=False)
and I get the error:

Computing values.
computing velocity graph
    finished (0:00:19) --> added 
    'velocity_graph', sparse matrix with cosine correlations (adata.uns)
Traceback (most recent call last):
  File "/projects/utility_functions/utils.py", line 227, in helper
    _get_val(getattr(adata, attr), key)) for attr, key in map(lambda a_k: (a_k[0], _convert_key(*a_k)), zip(attrs, keys))]
  File "/projects/utility_functions/utils.py", line 227, in <listcomp>
    _get_val(getattr(adata, attr), key)) for attr, key in map(lambda a_k: (a_k[0], _convert_key(*a_k)), zip(attrs, keys))]
  File "/projects/utility_functions/utils.py", line 199, in _get_val
    obj = obj[k]
KeyError: '.+_graph$'

---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-67-d60a68fc16e1> in <module>
----> 1 cache.velocity_graph(adata, force=False)

/projects/utility_functions/utils.py in _run(*args, **kwargs)
    360                 res = callback(*args, **kwargs)
    361                 ret = cache_fn(res if copy else adata, fname, True, verbose=False)
--> 362                 assert ret, 'Caching failed.'
    363 
    364                 return res

AssertionError: Caching failed.

I don't get this error with any other caching functions, all the others work fine

Add labels to plot_cell_indices

To the right of the plot, just like in the interactive histograms, would be nice to see the labels corresponding to the annotations from key=''

Add a function that automatically quantifies the batch effect

When experimenting with various batch effect removal strategies, it is quite annoying to every time have re-filter for hv genes, compute PCA and KNN and then to look at the UMAP and the PCA. Would be great to have a funciton which takes in an adata object which has somehow been batch corrected and computes how large the batch effect in the given embedding is, using for example the function quant_batch from the utils.py script. Also this function should tell me how much the count depth and n_genes correlated with the first two PC dimensions, using e.g. the function corr_ann from the same script.

Plotting continious annotations plot_cell_indices

I have a time series dataset where each cell is labelled with a time point. Now, when I chose the root cell, I would of course like to chose it from among the cells from the earliest time point. The time information is not categorical, therefore, I get an error:

AttributeError: Can only use .cat accessor with a 'category' dtype

It would be nice if one could also plot continious annotations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.