bxlab / hifive

Tools for handling HiC and 5C data
MIT License
22 stars 8 forks source link

issue KeyError: "Unable to open object (object 'cis_indices' doesn't exist)" #21

Closed nponts closed 1 year ago

nponts commented 1 year ago

Hi,

I'm trying to run your tool (thank you for it by the way) and i'm running into this error: 0 validly-mapped read pairs loaded.
No valid data was loaded. Traceback (most recent call last): File "/opt/miniconda3/envs/hiqc/bin/hifive", line 849, in main() File "/opt/miniconda3/envs/hiqc/bin/hifive", line 93, in main run(args) File "/opt/miniconda3/envs/hiqc/lib/python2.7/site-packages/hifive/commands/find_quasar_scores.py", line 114, in run coverages=args.coverages, seed=args.seed) File "/opt/miniconda3/envs/hiqc/lib/python2.7/site-packages/hifive/quasar.py", line 190, in find_transformation elif hic.data['cis_indices'][chr_indices[i + 1]] - hic.data['cis_indices'][chr_indices[i]] == 0: File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "/opt/miniconda3/envs/hiqc/lib/python2.7/site-packages/h5py/_hl/group.py", line 264, in getitem oid = h5o.open(self.id, self._e(name), lapl=self._lapl) File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper File "h5py/h5o.pyx", line 190, in h5py.h5o.open KeyError: "Unable to open object (object 'cis_indices' doesn't exist)"

I checked and rechecked my input, and it's very much looking good... Any idea?

N.

msauria commented 1 year ago

Sorry for the delay in response. This is usually a case in a mismatch between the chromosome names in the fragment-end (fend) file and the names from the alignment.

To run quasar, you first need to have created the fragment file, create the data file loading reads and assigning to fragments, and finally create a project file linking the two and storing analysis-specific information.

To check where problems may have arisen when loading your data, you can run the command python -c "import h5py; data=h5py.File('YOUR_DATA_FILE','r'); print(data['stats']);"

This should give you a list of how many reads were filtered out and for what reason. Check that, and I can help you from there.

nponts commented 1 year ago

You are right, I created my own glitch when I prepared my input files. I think the fact my chromosomes have lettered numbers mixed things up for me. Happy me, QuASAR ran fine after all :) Thank you so much for your time, and for the so useful tool! N.