oa index fails with bytes vs string problem
Using 0.1.0b2 (compiled from source with Python 3.4.3 on Linux), specifically this commit:
Attempting to follow the example but with local data:
http://pythonhosted.org/ORG.asm/mitochondrion.html
The first command fails on uncompressed FASTQ files:
$ oa index --estimate-length=0.9 example_index example_R1.fastq example_R2.fastq
2015-08-21 12:14:43,042 [INFO ] Computing read length statistics for the forward file
Traceback (most recent call last):
File "/home/pc40583/bin/oa", line 206, in <module>
config['orgasm']['module'].run(config)
File "/home/pc40583/lib/python3.4/site-packages/orgasm/command/index.py", line 448, in run
stats,cforward = lengthStats(acgtCut(cforward))
File "/home/pc40583/lib/python3.4/site-packages/orgasm/command/index.py", line 282, in lengthStats
stats = Counter(reader())
File "/home/pc40583/lib/python3.4/collections/__init__.py", line 475, in __init__
self.update(*args, **kwds)
File "/home/pc40583/lib/python3.4/collections/__init__.py", line 562, in update
_count_elements(self, iterable)
File "/home/pc40583/lib/python3.4/site-packages/orgasm/command/index.py", line 279, in reader
store.append((s[0],zlib.compress(s[1])))
TypeError: 'str' does not support the buffer interface
I thought this might be due to opening the FASTQ file in text mode (giving strings) versus bytes from gzipped FASTQ files, but that breaks too:
$ oa index --estimate-length=0.9 example_index example_R1.fastq.gz example_R2.fastq.gz
2015-08-21 12:21:22,733 [INFO ] Forward file compressed by gzip
2015-08-21 12:21:22,739 [INFO ] Reverse file compressed by gzip
2015-08-21 12:21:22,742 [INFO ] Computing read length statistics for the forward file
Traceback (most recent call last):
File "/home/pc40583/bin/oa", line 206, in <module>
config['orgasm']['module'].run(config)
File "/home/pc40583/lib/python3.4/site-packages/orgasm/command/index.py", line 448, in run
stats,cforward = lengthStats(acgtCut(cforward))
File "/home/pc40583/lib/python3.4/site-packages/orgasm/command/index.py", line 282, in lengthStats
stats = Counter(reader())
File "/home/pc40583/lib/python3.4/collections/__init__.py", line 475, in __init__
self.update(*args, **kwds)
File "/home/pc40583/lib/python3.4/collections/__init__.py", line 562, in update
_count_elements(self, iterable)
File "/home/pc40583/lib/python3.4/site-packages/orgasm/command/index.py", line 279, in reader
store.append((s[0],zlib.compress(s[1])))
TypeError: 'str' does not support the buffer interface
Deleting tmp file : /tmp/tmp954emhqb/unziped-_gzr7ybi
Deleting tmp file : /tmp/tmp954emhqb/unziped-ed89l2i_
Deleting tmp directory : /tmp/tmp954emhqb