question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sc.pl.stacked_violin: IndexError, list index out of range

See original GitHub issue

Scanpy vs. 1.3.6 installed using pip3 OSX 10.10.5 Jupyter lab

code: list_of_list_of_marker_genes = [mg1, mg2, mg3] for mg in list_of_list_of_marker_genes: sc.pl.stacked_violin(adata, mg, groupby = 'louvain’, rotation=90) print(mg)

This works for some mg’s but not for all; sc.pl.matrixplot works for all of them; the same for sc.pl.violin; it works also if I would combine all marker genes into one list and then run sc.pl.stacked_violin. When I say it does not work: it typically generates one stacked plot and then ‘hangs up’ with an error message for subsequent plots:

Error message:

IndexError: list index out of range

When I run sc.pl.stacked_violin for the individual mg’s, some work others don’t. It is a reproducible results.

I explicitly tested whether the genes in the respective marker gene lists are present in ’n_cells’. If not, I update the lists.

What am I missing here?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
brianpenghecommented, Mar 9, 2019

@fidelram Thank you for your suggestions! The example data in Scanpy worked without flaw. I will go over my code again!

Actually I solved this problem by adding more markers in the marker gene list. Alternatively The error will be gone if I swap_axes=True Interesting

0reactions
ivirshupcommented, Jan 27, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

sc.pl.stacked_violin: IndexError, list index out of range #405
Error message: IndexError: list index out of range. When I run sc.pl.stacked_violin for the individual mg's, some work others don't.
Read more >
Python IndexError: List Index Out of Range [Easy Fix]
To solve the “IndexError: list index out of range”, avoid do not access a non-existing list index. For example, my_list[5] causes an error...
Read more >
scanpy.pl.stacked_violin — Scanpy 1.9.1 documentation
Makes a compact image composed of individual violin plots (from violinplot() ) stacked on top of each other. Useful to visualize gene expression...
Read more >
How to fix "IndexError: list index out of range" on Python
The 'IndexError: list index out of range' means that your list indices are out of range. You are trying to refer to some...
Read more >
Untitled
Mindanao provinces and their capitals, Merkezi poct, Playnext pl, Navicat oracle lite, ... Indexerror index out of range python, Dukan diet reviews results, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found