r3fang / SnapATAC

Analysis Pipeline for Single Cell ATAC-seq
GNU General Public License v3.0
296 stars 124 forks source link

Error in snaptools snap-pre #178

Open tlsteph opened 4 years ago

tlsteph commented 4 years ago

Hi, I`ve been trying to create a .snap file from a fragments.bed file and running:

snaptools snap-pre 
--input-file=fragments.bed \
--output-snap=fragments.snap \
--genome-name=hg19 \
--genome-size=hg19.chrom.sizes \
--min-mapq=30 \
--min-flen=50 \
--max-flen=1000 \
 --keep-chrm=TRUE \
--keep-single=FALSE \
--keep-secondary=False \
--overwrite=True \
--max-num=20000 \
--min-cov=500 \
--verbose=True

I get the following error:

Traceback (most recent call last):
  File "h5py/_proxy.pyx", line 316, in h5py._proxy.needs_bkg_buffer
KeyError: 'Conversion function not found (no appropriate function for conversion path)'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/T/opt/anaconda3/bin/snaptools", line 4, in <module>
    __import__('pkg_resources').run_script('snaptools==1.4.8', 'snaptools')
  File "/Users/T/opt/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 666, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/Users/T/opt/anaconda3/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1462, in run_script
    exec(code, namespace, namespace)
  File "/Users/T/opt/anaconda3/lib/python3.7/site-packages/snaptools-1.4.8-py3.7.egg/EGG-INFO/scripts/snaptools", line 38, in <module>
    parse_args()    
  File "/Users/T/opt/anaconda3/lib/python3.7/site-packages/snaptools-1.4.8-py3.7.egg/snaptools/parser.py", line 144, in parse_args
    verbose=args.verbose)
  File "/Users/T/opt/anaconda3/lib/python3.7/site-packages/snaptools-1.4.8-py3.7.egg/snaptools/snap_pre.py", line 402, in snap_pre
    f.create_dataset("BD/name",data=[np.string_(item) for item in list(barcode_dict.keys())], dtype=h5py.special_dtype(vlen=bytes), compression="gzip", compression_opts=9);
  File "/Users/T/opt/anaconda3/lib/python3.7/site-packages/h5py/_hl/group.py", line 136, in create_dataset
    dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds)
  File "/Users/T/opt/anaconda3/lib/python3.7/site-packages/h5py/_hl/dataset.py", line 170, in make_new_dset
    dset_id.write(h5s.ALL, h5s.ALL, data)
  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/h5d.pyx", line 221, in h5py.h5d.DatasetID.write
  File "h5py/_proxy.pyx", line 152, in h5py._proxy.dset_rw
  File "h5py/_proxy.pyx", line 318, in h5py._proxy.needs_bkg_buffer
TypeError: Operation not defined for data type class (operation not defined for data type class)

Is it an issue of a dependency not being properly installed? Or something else? Any help would be really appreciated! Thanks!

Maarten-vd-Sande commented 4 years ago

I have the same issue. In an earlier reply @r3fang replied that it is a Python issue (https://github.com/r3fang/SnapATAC/issues/80), but I have tried in both python 3 and 2.7, but it does not help. Before it crashes it does outputs:

100000  tags, 0.834897994995 seconds 
200000  tags, 1.64896893501 seconds 
300000  tags, 2.46505284309 seconds 
400000  tags, 3.28171300888 seconds 
500000  tags, 4.09783291817 seconds 
600000  tags, 4.91421294212 seconds 
700000  tags, 5.72919988632 seconds 
800000  tags, 6.54903578758 seconds 
Traceback (most recent call last):
.... (same error)

Did you find a solution?

wenhuihuang1979 commented 3 years ago

same error 406700000 tags, 4080.93846822 seconds 406800000 tags, 4081.93570709 seconds 406900000 tags, 4082.930547 seconds 407000000 tags, 4083.92685223 seconds 407100000 tags, 4084.92249608 seconds 407200000 tags, 4085.91857719 seconds 407300000 tags, 4086.91163301 seconds 407400000 tags, 4087.90384507 seconds Traceback (most recent call last): File "/usr/local/bin/snaptools", line 38, in parse_args() File "/usr/local/lib/python2.7/dist-packages/snaptools/parser.py", line 144, in parse_args verbose=args.verbose) File "/usr/local/lib/python2.7/dist-packages/snaptools/snap_pre.py", line 402, in snap_pre f.createdataset("BD/name",data=[np.string(item) for item in list(barcode_dict.keys())], dtype=h5py.special_dtype(vlen=bytes), compression="gzip", compression_opts=9); File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/group.py", line 136, in create_dataset dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds) File "/usr/local/lib/python2.7/dist-packages/h5py/_hl/dataset.py", line 170, in make_new_dset dset_id.write(h5s.ALL, h5s.ALL, data) 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/h5d.pyx", line 222, in h5py.h5d.DatasetID.write File "h5py/_proxy.pyx", line 152, in h5py._proxy.dset_rw File "h5py/_proxy.pyx", line 318, in h5py._proxy.needs_bkg_buffer TypeError: Operation not defined for data type class (operation not defined for data type class)