xpore icon indicating copy to clipboard operation
xpore copied to clipboard

KeyError when running xpore diffmod

Open jainronit opened this issue 10 months ago • 1 comments
trafficstars

Hi,

I'm trying to run xpore diffmod on some RNA004 data and am specifically providing the RNA004 kmer model (https://github.com/GoekeLab/xpore/blob/RNA004_kmer_model/xpore/diffmod/RNA004_5mer_model.txt) in the xpore diffmod config.yml when running xpore diffmod. However, I am running into the following error when running diffmod. Would you be able to advise? Thanks so much!

Using the signal of unmodified RNA from /home/groups/nicolemm/ronitj/miniconda3/lib/python3.11/site-packages/xpore/diffmod/model_kmer.csv Process Consumer-1: Traceback (most recent call last): File "/home/groups/nicolemm/ronitj/miniconda3/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3805, in get_loc return self._engine.get_loc(casted_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "index.pyx", line 167, in pandas._libs.index.IndexEngine.get_loc File "index.pyx", line 196, in pandas._libs.index.IndexEngine.get_loc File "pandas/_libs/hashtable_class_helper.pxi", line 7081, in pandas._libs.hashtable.PyObjectHashTable.get_item File "pandas/_libs/hashtable_class_helper.pxi", line 7089, in pandas._libs.hashtable.PyObjectHashTable.get_item KeyError: 'ACGAGCTGT'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/groups/nicolemm/ronitj/miniconda3/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/home/groups/nicolemm/ronitj/miniconda3/lib/python3.11/site-packages/xpore/scripts/helper.py", line 113, in run result = self.task_function(*next_task_args,self.locks) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/groups/nicolemm/ronitj/miniconda3/lib/python3.11/site-packages/xpore/scripts/diffmod.py", line 23, in execute kmer_signal = {'mean':model_kmer.loc[kmer,'model_mean'],'std':model_kmer.loc[kmer,'model_stdv']} ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/home/groups/nicolemm/ronitj/miniconda3/lib/python3.11/site-packages/pandas/core/indexing.py", line 1183, in getitem return self.obj._get_value(*key, takeable=self._takeable) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/groups/nicolemm/ronitj/miniconda3/lib/python3.11/site-packages/pandas/core/frame.py", line 4221, in _get_value row = self.index.get_loc(index) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/groups/nicolemm/ronitj/miniconda3/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 3812, in get_loc raise KeyError(key) from err KeyError: 'ACGAGCTGT'

jainronit avatar Jan 20 '25 02:01 jainronit

Hi @jainronit,

This is likely due to f5c outputting a 9-mer instead of a 5-mer. You will have to rerun f5c with a 5-mer model instead. Here is f5c's 5-mer model: https://raw.githubusercontent.com/hasindu2008/f5c/v1.3/test/rna004-models/rna004.nucleotide.5mer.model

Thanks!

Best wishes, Yuk Kei

yuukiiwa avatar Jan 29 '25 11:01 yuukiiwa