guma44 / GEOparse

Python library to access Gene Expression Omnibus Database (GEO)
BSD 3-Clause "New" or "Revised" License
137 stars 51 forks source link

ValueError when trying to reproduce tutorials #50

Closed CiaranWelsh closed 5 years ago

CiaranWelsh commented 5 years ago

Hi,

The following code from the first section of the tutorials is broken on my machine. I'm running Anaconda Python 3.6 on windows 10.

import GEOparse
gse = GEOparse.get_GEO(filepath="./GSE1563.soft.gz")

Produces the following error

12-Nov-2018 15:40:26 INFO GEOparse - Parsing ./GSE1563.soft.gz: 
Traceback (most recent call last):
  File "C:/Users/Ciaran/Box Sync/MesiSTRAT/PublicDataSetSearch/ReFormatShittyNCBIOutput.py", line 95, in <module>
    gse = GEOparse.get_GEO(filepath="./GSE1563.soft.gz")
  File "C:\ProgramData\Anaconda2\lib\site-packages\GEOparse\GEOparse.py", line 84, in get_GEO
    return parse_GSE(filepath)
  File "C:\ProgramData\Anaconda2\lib\site-packages\GEOparse\GEOparse.py", line 502, in parse_GSE
    with utils.smart_open(filepath) as soft:
  File "C:\ProgramData\Anaconda2\lib\contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "C:\ProgramData\Anaconda2\lib\site-packages\GEOparse\utils.py", line 154, in smart_open
    fh = fopen(filepath, mode)
  File "C:\ProgramData\Anaconda2\lib\gzip.py", line 34, in open
    return GzipFile(filename, mode, compresslevel)
  File "C:\ProgramData\Anaconda2\lib\gzip.py", line 94, in __init__
    fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
ValueError: Invalid mode ('rtb')

Process finished with exit code 1
CiaranWelsh commented 5 years ago

My apologies, I was actually in a Python 2 environment when I thought I was in Python 3. All is working with Python 3. Thanks