Closed sommikim closed 5 years ago
Hmmmm, it looks like my previous fix didn't work out... curious why. Possibly your reads data is 1-indexed or the .gtf file is 0-indexed (or both)?
I actually don't have any reads data to reproduce this error this myself, so I'm going to ask that you share a couple of your .bam files with me? We can communicate privately - my email is on the DegNorm website. I can keep trying different one-off fixes, but it's hard for me to remedy without being able to replicate the bug on a DegNorm run and test my fixes.
Also, given that this is the same issue as #25 (as you noted) I'm going to close this issue (duplicate), and then we can follow up on #25? Thanks much.
Hi. Now I am trying to use DegNorm for my analysis and I had some problems. The error was:
DegNorm (05/09/2019 01:46:40) ---- SAMPLE CAPW7ANXX_3#51646_CAGCGT_Aligned.sortedByCoord.out, CHR 3 -- saving read counts. Traceback (most recent call last): File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/DegNorm-0.1.4-py3.6.egg/degnorm/reads.py", line 704, in chromosome_coverage_read_counts reads_df['gene'] = chrom_gene_df.loc[reads_df.pos].gene.values File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/pandas/core/indexing.py", line 1328, in getitem return self._getitem_axis(key, axis=0) File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/pandas/core/indexing.py", line 1541, in _getitem_axis return self._getitem_iterable(key, axis=axis) File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/pandas/core/indexing.py", line 1081, in _getitem_iterable self._has_valid_type(key, axis) File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/pandas/core/indexing.py", line 1418, in _has_valid_type (key, self.obj._get_axis_name(axis))) KeyError: 'None of [read_id\n53 52280\n54 52282\n55 52282\n56 52282\n57 52286\n60 52342\n68 52668\n69 52668\n76 52721\n77 52721\n78 52722\n79 52722\n80 52722\n81 52725\n82 52730\n83 52730\n84 52730\n85 52731\n86 52732\n87 52737\n88 52737\n89 52745\n90 52751\n91 52754\n92 52756\n93 52756\n94 52758\n95 52758\n96 52758\n97 52758\n ... \n192 58748\n193 58749\n194 58749\n195 58750\n196 58750\n197 58756\n198 58756\n199 58760\n200 58762\n201 58767\n202 58769\n203 58770\n204 58778\n205 58786\n206 58786\n207 58794\n208 58795\n209 58795\n210 58811\n211 58811\n212 58811\n213 58812\n214 58812\n215 58812\n216 58813\n217 58813\n218 58816\n219 58857\n220 59111\n221 59238\nName: pos, Length: 140, dtype: int64] are in the [index]'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/home2/ksomi47/anaconda3/envs/degnorm/bin/degnorm", line 11, in
load_entry_point('DegNorm==0.1.4', 'console_scripts', 'degnorm')()
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/DegNorm-0.1.4-py3.6.egg/degnorm/main.py", line 138, in main
, exon_df=exon_df)
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/DegNorm-0.1.4-py3.6.egg/degnorm/reads.py", line 829, in coverage_read_counts
for chrom in self.chroms)
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/joblib/parallel.py", line 994, in call
self.retrieve()
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/joblib/parallel.py", line 897, in retrieve
self._output.extend(job.get(timeout=self.timeout))
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, *kwds))
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 561, in call
return self.func(args, **kwargs)
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/joblib/parallel.py", line 261, in call
for func, args, kwargs in self.items]
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/joblib/parallel.py", line 261, in
for func, args, kwargs in self.items]
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/DegNorm-0.1.4-py3.6.egg/degnorm/reads.py", line 737, in chromosome_coverage_read_counts
reads_df['gene'] = chrom_gene_df.loc[reads_df.pos].gene.values
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/pandas/core/indexing.py", line 1328, in getitem
return self._getitem_axis(key, axis=0)
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/pandas/core/indexing.py", line 1541, in _getitem_axis
return self._getitem_iterable(key, axis=axis)
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/pandas/core/indexing.py", line 1081, in _getitem_iterable
self._has_valid_type(key, axis)
File "/home2/ksomi47/anaconda3/envs/degnorm/lib/python3.6/site-packages/pandas/core/indexing.py", line 1418, in _has_valid_type
(key, self.obj._get_axis_name(axis)))
KeyError: 'None of [read_id\n53 52280\n54 52282\n55 52282\n56 52282\n57 52286\n60 52342\n68 52668\n69 52668\n76 52721\n77 52721\n78 52722\n79 52722\n80 52722\n81 52725\n82 52730\n83 52730\n84 52730\n85 52731\n86 52732\n87 52737\n88 52737\n89 52745\n90 52751\n91 52754\n92 52756\n93 52756\n94 52758\n95 52758\n96 52758\n97 52758\n ... \n192 58748\n193 58749\n194 58749\n195 58750\n196 58750\n197 58756\n198 58756\n199 58760\n200 58762\n201 58767\n202 58769\n203 58770\n204 58778\n205 58786\n206 58786\n207 58794\n208 58795\n209 58795\n210 58811\n211 58811\n212 58811\n213 58812\n214 58812\n215 58812\n216 58813\n217 58813\n218 58816\n219 58857\n220 59111\n221 59238\nName: pos, Length: 140, dtype: int64] are in the [index]'
I have seen the previous issue and try to follow that but I still could not solve the problem. Could you help me?