Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
O
ORG.Asm
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 19,166
    • Issues 19,166
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • ORG.Asm
  • ORG.Asm
  • Issues
  • #2

Closed
Open
Opened Aug 21, 2015 by Peter Cock@p-j-a-cock

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:

40c859a5

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
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: org-asm/org-asm#2