velocyto.py icon indicating copy to clipboard operation
velocyto.py copied to clipboard

index error list out of range

Open rekham1077 opened this issue 6 years ago • 7 comments
trafficstars

Hi this is a similar to issue to some of the GTF error issues other people have raised but I saw the solution was removing a field from the annotation file, however I don't think I have that field so I am confused what I should do.

This is my error below, and I am attaching a screenshot of my annotation file: velo.sh velo.sh.e4851593 velo.sh.o4851593 -bash-4.2$ cat velo.sh.e4851593 Traceback (most recent call last): File "/nfs/sw/velocyto/velocyto-0.17/bin/velocyto", line 10, in sys.exit(cli()) File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/click/core.py", line 764, in call return self.main(*args, **kwargs) File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/click/core.py", line 717, in main rv = self.invoke(ctx) File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/click/core.py", line 1137, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/click/core.py", line 956, in invoke return ctx.invoke(self.callback, **ctx.params) File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/click/core.py", line 555, in invoke return callback(*args, **kwargs) File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/velocyto/commands/run_smartseq2.py", line 74, in run_smartseq2 samtools_memory=1, dump=dump, loom_numeric_dtype=dtype, verbose=verbose, additional_ca=additional_ca) File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/velocyto/commands/_run.py", line 229, in _run results = exincounter.count(bamfile_cellsorted, multimap=multimap) # NOTE: we would avoid some millions of if statements evaluations if we write two function count and count_with output File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/velocyto/counter.py", line 761, in count dict_layer_columns, list_bcs = self.count_cell_batch() File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/velocyto/counter.py", line 1167, in _count_cell_batch_non_stranded self.logic.count(molitem, bcidx, dict_layers_columns, self.geneid2ix) File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/velocyto/logic.py", line 1091, in count upstream_exon = segment_match.feature.get_upstream_exon() File "/nfs/sw/velocyto/velocyto-0.17/lib/python3.7/site-packages/velocyto/feature.py", line 75, in get_upstream_exon return self.transcript_model.list_features[ix] IndexError: list index out of range Screen Shot 2019-03-13 at 6 19 18 PM

rekham1077 avatar Mar 13 '19 22:03 rekham1077

I also have this error with 10X data: File "/usr/local/bin/velocyto", line 11, in sys.exit(cli()) File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in call return self.main(*args, **kwargs) File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke return callback(args, **kwargs) File "/usr/local/lib/python3.6/site-packages/velocyto/commands/run10x.py", line 83, in run10x os.path.normcase("outs/filtered_gene_bc_matrices//barcodes.tsv")))[0] IndexError: list index out of range Unsing Cellranger v3 and Velocyto 0.17.11

kaizen89 avatar Mar 25 '19 13:03 kaizen89

Hi @kaizen89 and @rekham1077, I think we might be discussing a similar error on the Open Issue #135. Check it out and see if it is helpful. :]

RBBurl1227 avatar Mar 26 '19 15:03 RBBurl1227

Hi @kaizen89 I actually ended up getting it to run, but I had to re-do my alignment with a different annotation file. I had originally done it with the annotation from UCSC but I re-aligned with cellranger v3 reference and annotation so those should work you.

But I am using a different version of velocyto, 0.17.15.

rekham1077 avatar Mar 26 '19 20:03 rekham1077

@RBBurl1227 yes, and for me the run command solved the issue. thanks

kaizen89 avatar Apr 08 '19 09:04 kaizen89

Hello,

@rekham1077. I am also facing the same issue when running: velocyto run-smartseq2:

Traceback (most recent call last): File "/home/jihoonk/miniconda3/envs/py37/bin/velocyto", line 8, in <module> sys.exit(cli()) File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/velocyto/commands/run_smartseq2.py", line 74, in run_smartseq2 samtools_memory=1, dump=dump, loom_numeric_dtype=dtype, verbose=verbose, additional_ca=additional_ca) File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/velocyto/commands/_run.py", line 229, in _run results = exincounter.count(bamfile_cellsorted, multimap=multimap) # NOTE: we would avoid some millions of if statements evaluations if we write two function count and count_with output File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/velocyto/counter.py", line 761, in count dict_layer_columns, list_bcs = self.count_cell_batch() File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/velocyto/counter.py", line 1167, in _count_cell_batch_non_stranded self.logic.count(molitem, bcidx, dict_layers_columns, self.geneid2ix) File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/velocyto/logic.py", line 1091, in count upstream_exon = segment_match.feature.get_upstream_exon() File "/home/jihoonk/miniconda3/envs/py37/lib/python3.7/site-packages/velocyto/feature.py", line 75, in get_upstream_exon return self.transcript_model.list_features[ix] IndexError: list index out of range

I am using the mm10.refflat.gtf that was used for STAR alignment (to generate the bam files per cell), which looks like:

Screen Shot 2020-05-29 at 8 44 42 PM

To my knowledge, the gtf follows the requirements for velocyto (described here). I'm not sure what I should do.

jihoonk1495 avatar Jun 02 '20 00:06 jihoonk1495

Hi @RBBurl1227 and @rekham1077 -- When you said you redo the alignment with new annotation file, did you mean you rerun the cellranger count or you meant you just use a different genes/genes.gtf file in the run or run10x command? Which command, run or run10x, I should use?

What I have tried are described in #320, which mainly got me issue with out-of-memory, but now I got this issue of IndexError: list index out of range.

Screen Shot 2021-11-17 at 7 05 04 PM

Thank you so much.

denvercal1234GitHub avatar Nov 17 '21 19:11 denvercal1234GitHub