{"action":"closed","issue":{"url":"https://api.github.com/repos/theislab/scanpy/issues/210","repository_url":"https://api.github.com/repos/theislab/scanpy","labels_url":"https://api.github.com/repos/theislab/scanpy/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/theislab/scanpy/issues/210/comments","events_url":"https://api.github.com/repos/theislab/scanpy/issues/210/events","html_url":"https://github.com/theislab/scanpy/issues/210","id":343076864,"node_id":"MDU6SXNzdWUzNDMwNzY4NjQ=","number":210,"title":"normalize_per_cell does not remove zero-expression cells from adata.raw","user":{"login":"gokceneraslan","id":1140359,"node_id":"MDQ6VXNlcjExNDAzNTk=","avatar_url":"https://avatars2.githubusercontent.com/u/1140359?v=4","gravatar_id":"","url":"https://api.github.com/users/gokceneraslan","html_url":"https://github.com/gokceneraslan","followers_url":"https://api.github.com/users/gokceneraslan/followers","following_url":"https://api.github.com/users/gokceneraslan/following{/other_user}","gists_url":"https://api.github.com/users/gokceneraslan/gists{/gist_id}","starred_url":"https://api.github.com/users/gokceneraslan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gokceneraslan/subscriptions","organizations_url":"https://api.github.com/users/gokceneraslan/orgs","repos_url":"https://api.github.com/users/gokceneraslan/repos","events_url":"https://api.github.com/users/gokceneraslan/events{/privacy}","received_events_url":"https://api.github.com/users/gokceneraslan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-07-20T11:44:03Z","updated_at":"2018-10-14T09:55:15Z","closed_at":"2018-10-14T09:55:15Z","author_association":"CONTRIBUTOR","body":"When I run this snippet:\r\n\r\n```python\r\nimport scanpy.api as sc\r\n\r\nadata = sc.datasets.paul15()\r\nadata.X[0, :] = 0\r\nadata.raw = adata.copy()\r\n\r\nsc.pp.normalize_per_cell(adata)\r\n\r\nprint(adata.X.shape)\r\nprint(adata.raw.X.shape)\r\n\r\nsc.pp.pca(adata)\r\nsc.pl.pca_scatter(adata, color='Gata1')\r\n```\r\n\r\nI get:\r\n\r\n```\r\n(2729, 3451)\r\n(2730, 3451)\r\n```\r\n\r\nand an `IndexError: index 2729 is out of bounds for axis 0 with size 2729` exception. Actually `X` and `raw.X` size mismatch happens every time we filter observations. So what would be the ideal solution? \r\n\r\n- Don't remove zero-expression cells in `normalize_per_cell`\r\n- Remove zero cells also from `raw` in `normalize_per_cell`\r\n- Print a warning if some observations are removed in `normalize_per_cell`\r\n- Whenever some observations are subsetted in adata, also subset `raw.X` (solution from anndata side)\r\n\r\n"}}
{"actor":{"display_login":"falexwolf"}}