philippdre / omniCLIP

omniCLIP is a CLIP-Seq peak caller
GNU General Public License v3.0
15 stars 9 forks source link

Error reading IterSaveFile.dat #8

Closed timlai4 closed 4 years ago

timlai4 commented 4 years ago

I attempted to restart a previous run with the flags

 --restart-from-iter --use-precomp-CLIP-data --use-precomp-bg-data

However, omniCLIP.py could not load the IterSaveFile.dat file.

Traceback (most recent call last):
  File "omniCLIP.py", line 1004, in <module>
    run_omniCLIP(args)
  File "omniCLIP.py", line 317, in run_omniCLIP
    IterParameters, args_old = pickle.load(open(IterSaveFile,'r'))
  File "/home/timlai/anaconda3/envs/clip/lib/python3.7/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

I noticed you are opening the file in "read" mode without the binary flag. I believe adding in the binary flag fixes this. Indeed, I have gone through and added in the b flag to all read places that were previously missing them and my run seems to be working without read issues. However, before I am submitting this as an issue without a PR because I am not sure if all of the read commands are for binary files yet.