Different outputs between heatmap plot and matrix expression values
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 779
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 27
Description
Please make sure these conditions are met
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of scanpy.
- (optional) I have confirmed this bug exists on the master branch of scanpy.
What happened?
Hi,
I was trying to extract gene expression mean values per Subject, so I have a dataframe with genes in columns, subjects in rows, and the mean values of the expression.
To obtain the mean values for each Subject for the selected genes, I ran the following command:
adata[(adata.obs['Subject'] == 'Subject_x')][:,['genes_of_interest']].X.mean(axis=0))
Having a look at the expression of genes in a specific Subject, it looks like this:
However, the mean expression value for NTM is 0. and for CRYAB is 1.56, what it doesn't make sense with the heatmap plot.
Am I doing wrong in the extraction of mean values?
Thanks!
Minimal code sample
adata[(adata.obs['Subject'] == 'Subject_x')][:,['genes_of_interest']].X.mean(axis=0))
Error output
No response
Versions
anndata 0.9.1
scanpy 1.8.1
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the minimal code sample with a small AnnData object and compare its .X mean values with the heatmap output for the same Subject and genes. Determine whether the discrepancy is expected from differing transformations or represents a bug; done means the cause is established and the behavior is corrected or clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- bioinformatics, data-visualization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100