Comments (8)
Hi! Thanks for reporting this bug!
From what I can tell from your description, the issue arises due to the indices of data_scanpy_1.X
and data_scanpy_1.obs
being misaligned. This could happen in dat.from_scanpy
because anndata does not check automatically if indices align. I just pushed a fix for this in the branch update_0.1.6
. I hope that this solves the problem!
from sccoda.
Thanks. I'm working in Terra with scCODA installed via pip. How do I go about pulling the fix?
from sccoda.
You can install an exact branch from github with pip: pip install git+https://github.com/theislab/scCODA.git@update_0.1.6
.
The version number of your scCODA installation should then be 0.1.6
. If not, you can try uninstalling scCODA (pip uninstall sccoda
) before installing with the same command as above.
from sccoda.
I was able to download it and I can see version 0.1.6 in my packages folder, but I am still getting the same mismatched output. Could something else be causing the problem?
from sccoda.
Hmm, then there seems to be another issue that causes this problem. Could you please help me pinning down the cause of it by checking whether the rows in your data_scanpy_1.X
(cell counts) and in data_scanpy_1.obs
(covariates) are correctly matched (e.g. does row 10 in data_scanpy_1.X
contain lots of cell type 5 or is it row 20)?
Also, you could plot viz.stacked_barplot(data_scanpy_1, feature_name="samples",cmap=umap_cmap)
to plot the data with the index of data_scanpy_1.obs
as the x-axis labels, if you are more familiar with these labels than with the numbers 1-20.
Thanks in advance!
from sccoda.
viz.stacked_barplot(data_scanpy_1, feature_name="samples",cmap=umap_cmap)
Now it seems like the samples are lined up correctly. Sample WR_4396_AS4 is the correct sample containing cell type 5. But now it looks like I can't put the data in the order I assign in cov_df. If I assign the samples numbers 1-20 based on the treatment, it mixes them up as such:
viz.stacked_barplot(data_scanpy_1, feature_name="Cond",cmap=umap_cmap)
from sccoda.
I'm glad that the samples and metadata are aligned now. This is the bug that I tried to fix with the new version.
The plotting function uses per default the same order as the data, which is the order in data_scanpy_1.X
(the cov_df was shuffled in order to match the order of samples there). To order the x-axis in the plot, you can set the desired order in the level_order
argument, in your case: viz.stacked_barplot(data_scanpy_1, feature_name="Cond",cmap=umap_cmap, level_order=['1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20'])
.
I hope that this gives you the desired plot!
from sccoda.
Awesome. Thank you. Everything is looking good now.
from sccoda.
Related Issues (20)
- Error when num_burnins > num_results HOT 4
- Exporting Summary Results HOT 1
- additive effects and interaction terms HOT 3
- model comparison using LOO/WAIC HOT 2
- Tutorial for R/reticulate HOT 3
- Final Parameter and log2-fold change have different signs HOT 6
- Additive model with batch HOT 2
- Different results for same comparison, based on which group is selected as reference HOT 2
- mixed effect model HOT 1
- Use the model with multiple covariants including numeric ones? HOT 1
- Covariate has non-unique values HOT 2
- Usage without replicates ? HOT 2
- Influence of number of cells in parameterization HOT 6
- module 'pertpy.plot' has no attribute 'coda' HOT 1
- interpreting the output with the issue of compositionality. HOT 6
- How to compare multiple groups with sccoda HOT 7
- Bug in viz.boxplots function (and possibly others) HOT 3
- Using continuous variables yield weird results. HOT 3
- Multiple comparisons HOT 2
- How to plot the final result? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sccoda.