scverse / scverse/scanpy

log1p warning when modifying several layers

Open Beginner friendly
#4,285 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.6k
Forks
779
Avg merge
1d 4h
Merged PRs (30d)
27

Description

Hi,

https://github.com/scverse/scanpy/blob/fabadb9412c0d1cd9df9d9c2e95ac266d564ee18/src/scanpy/preprocessing/_simple.py#L393

When running something like

sc.pp.log1p(adata)
sc.pp.log1p(adata, layer="spliced")
sc.pp.log1p(adata, layer="unspliced")

I'd get an output like

WARNING: adata.X seems to be already log-transformed.
WARNING: adata.X seems to be already log-transformed.

even though the last two lines supposedly don't touch X. It would be more useful if the check looked at the actual target layer.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/scanpy/preprocessing/_simple.py at the referenced log1p implementation and trace how the warning check selects its data target. Run the three-layer reproduction from the issue, then verify that each warning check uses the requested layer rather than adata.X.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
bioinformatics
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.