marius1311 / utility_functions Goto Github PK
View Code? Open in Web Editor NEWUtility functions for single cell analysis with scanpy.
Utility functions for single cell analysis with scanpy.
Often, I just want to have a quick look at some new data - therefore, it would be useful to have a template notebook which includes all the major steps.
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.
Please give some feedback when creating a Cache instance, whether it was sucessful (path found) or not
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?
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
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=''
Just to return the original cell numbers, so that one knows how much was filtered out.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.