NanoPlot and NaoStat Errors: site-packages/Bio/File.py", line 72, in as_handle with open(handleish, mode, **kwargs) as fp: TypeError: expected str, bytes or os.PathLike object, not TextIOWrapper
Closed this issue · 1 comments
I have NanoPlot v1.43, NanoStat 1.6.0, and Python 3.10.14
Previously, these two packages (either NanoPlot or NanoStat) worked well in Linux Ubuntu or MacIOS to count the quality of nanopore reads with just simple e.g. using NanoPlot --fastq read.fastq.gz --outdir QA_read --only-report or using NanoStat --fastq read.fastq.gz --outdir QA_read --name Report_read.
However, today I run the same things using NanoPlot or NanoStat but come out with the same errors (using Linux or Mac) with this following messages:
If you read this then NanoPlot 1.43.0 has crashed :-(
Please try updating NanoPlot and see if that helps...
If not, please report this issue at https://github.com/wdecoster/NanoPlot/issues
If you could include the log file that would be really helpful.
Thanks!
concurrent.futures.process._RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/Bio/File.py", line 72, in as_handle
with open(handleish, mode, **kwargs) as fp:
TypeError: expected str, bytes or os.PathLike object, not TextIOWrapper
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/hendra/miniforge3/lib/python3.10/concurrent/futures/process.py", line 246, in _process_worker
r = call_item.fn(*call_item.args, **call_item.kwargs)
File "/Users/hendra/miniforge3/lib/python3.10/concurrent/futures/process.py", line 205, in _process_chunk
return [fn(*args) for args in chunk]
File "/Users/hendra/miniforge3/lib/python3.10/concurrent/futures/process.py", line 205, in
return [fn(*args) for args in chunk]
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/nanoget/extraction_functions.py", line 396, in process_fastq_plain
data=[res for res in extract_from_fastq(inputfastq) if res],
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/nanoget/extraction_functions.py", line 396, in
data=[res for res in extract_from_fastq(inputfastq) if res],
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/nanoget/extraction_functions.py", line 407, in extract_from_fastq
for rec in SeqIO.parse(fq, "fastq"):
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/Bio/SeqIO/Interfaces.py", line 85, in next
return next(self.records)
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/Bio/SeqIO/QualityIO.py", line 1105, in iterate
for title_line, seq_string, quality_string in FastqGeneralIterator(handle):
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/Bio/SeqIO/QualityIO.py", line 935, in FastqGeneralIterator
line = next(handle)
File "/Users/hendra/miniforge3/lib/python3.10/gzip.py", line 314, in read1
return self._buffer.read1(size)
File "/Users/hendra/miniforge3/lib/python3.10/_compression.py", line 68, in readinto
data = self.read(len(byte_view))
File "/Users/hendra/miniforge3/lib/python3.10/gzip.py", line 488, in read
if not self._read_gzip_header():
File "/Users/hendra/miniforge3/lib/python3.10/gzip.py", line 436, in _read_gzip_header
raise BadGzipFile('Not a gzipped file (%r)' % magic)
gzip.BadGzipFile: Not a gzipped file (b'https://github.com/3')
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/hendra/miniforge3/bin/NanoPlot", line 8, in
sys.exit(main())
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/nanoplot/NanoPlot.py", line 62, in main
datadf = get_input(
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/nanoget/nanoget.py", line 110, in get_input
dfs=[out for out in executor.map(extraction_function, files)],
File "/Users/hendra/miniforge3/lib/python3.10/site-packages/nanoget/nanoget.py", line 110, in
dfs=[out for out in executor.map(extraction_function, files)],
File "/Users/hendra/miniforge3/lib/python3.10/concurrent/futures/process.py", line 575, in _chain_from_iterable_of_lists
for element in iterable:
File "/Users/hendra/miniforge3/lib/python3.10/concurrent/futures/_base.py", line 621, in result_iterator
yield _result_or_cancel(fs.pop())
File "/Users/hendra/miniforge3/lib/python3.10/concurrent/futures/_base.py", line 319, in _result_or_cancel
return fut.result(timeout)
File "/Users/hendra/miniforge3/lib/python3.10/concurrent/futures/_base.py", line 458, in result
return self.__get_result()
File "/Users/hendra/miniforge3/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
gzip.BadGzipFile: Not a gzipped file (b'https://github.com/3')
Could you please help?
Following up on this in wdecoster/NanoPlot#375