wdecoster/nanostat

Numpy issue

Closed this issue · 2 comments

Hi - trying to use Nanostat but running into difficulties as below - installed via bioconda.

`
NanoStat --fastq reads.fastq.gz --outdir statrep
WARNING: -o/--outdir is only possible with -n/--name, ignoring...
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/concurrent/futures/process.py", line 232, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/concurrent/futures/process.py", line 191, in _process_chunk
return [fn(*args) for args in chunk]
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/concurrent/futures/process.py", line 191, in
return [fn(*args) for args in chunk]
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/site-packages/nanoget/extraction_functions.py", line 328, in process_fastq_plain
columns=["quals", "lengths"]
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/site-packages/nanoget/utils.py", line 14, in reduce_memory_usage
usage_pre = df.memory_usage(deep=True).sum()
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/site-packages/pandas/core/frame.py", line 2670, in memory_usage
result = Series(self.index.memory_usage(deep=deep), index=["Index"]).append(
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/site-packages/pandas/core/series.py", line 314, in init
data = sanitize_array(data, index, dtype, copy, raise_cast_failure=True)
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/site-packages/pandas/core/internals/construction.py", line 712, in sanitize_array
subarr = construct_1d_arraylike_from_scalar(value, len(index), dtype)
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/site-packages/pandas/core/dtypes/cast.py", line 1233, in construct_1d_arraylike_from_scalar
subarr = np.empty(length, dtype=dtype)
TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type
"""

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

Traceback (most recent call last):
File "/well/bag/users/lipworth/miniconda3/bin/NanoStat", line 10, in
sys.exit(main())
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/site-packages/nanostat/NanoStat.py", line 86, in main
keep_supp=not(args.no_supplementary))
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/site-packages/nanoget/nanoget.py", line 94, in get_input
dfs=[out for out in executor.map(extraction_function, files)],
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/site-packages/nanoget/nanoget.py", line 94, in
dfs=[out for out in executor.map(extraction_function, files)],
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/concurrent/futures/process.py", line 476, in _chain_from_iterable_of_lists
for element in iterable:
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/concurrent/futures/_base.py", line 586, in result_iterator
yield fs.pop().result()
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/concurrent/futures/_base.py", line 432, in result
return self.__get_result()
File "/well/bag/users/lipworth/miniconda3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
TypeError: Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type
`

Hi,

Could you try upgrading pandas?

Thanks,
Wouter

This indeed sorted the problem, thanks for your quick response!

Sam