guma44 / GEOparse

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

more meaningful error in gsm.download_supplementary_files #24

Closed antonkulaga closed 7 years ago

antonkulaga commented 7 years ago

Whenever I try to use it it downloads everything, but in the end tells me:

Converting to /home/antonkulaga/rna-seq/containers/geoparse/GSM1696283/Supp_GSM1696283_Transgenic_Control_L4_A/SRR2040662_*.fasta.gz
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/antonkulaga/rna-seq/containers/geoparse/env/lib/python3.5/site-packages/GEOparse/GEOTypes.py", line 352, in download_supplementary_files
    self.download_SRA(email, filetype=sra_filetype, directory=directory)
  File "/home/antonkulaga/rna-seq/containers/geoparse/env/lib/python3.5/site-packages/GEOparse/GEOTypes.py", line 463, in download_SRA
    if "command not found" in perr:
TypeError: a bytes-like object is required, not 'str'

Probably it tries to find some SRA tools in the path. So, it is better just to say that SRA tools are not in the PATH

guma44 commented 7 years ago

What python version do you use?

antonkulaga commented 7 years ago

python 3.5

guma44 commented 7 years ago

I am looking at it.

guma44 commented 7 years ago

Probably you do not have SRAToolkit but this you might know.

antonkulaga commented 7 years ago

Yes, just saw that there's a problem with the path, but it would be nice to have some meaningful error telling about it, not cryptic "TypeError: a bytes-like object is required, not 'str'"

guma44 commented 7 years ago

The check procedure is giving error here. One line below there is a meaning full error returned :). Here is the problem described: https://stackoverflow.com/questions/606191/convert-bytes-to-a-python-string. As subprocess.cummunicate returns bytes not string in python 3.5.

guma44 commented 7 years ago

I corrected this error.

antonkulaga commented 7 years ago

is the fix already in master?

On Jun 26, 2017 16:20, "Rafal Gumienny" notifications@github.com wrote:

I corrected this error.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/guma44/GEOparse/issues/24#issuecomment-311057088, or mute the thread https://github.com/notifications/unsubscribe-auth/AAzaxCOqu3OSyruf6bEnvFZ0-jjKMnhcks5sH7AegaJpZM4OFD75 .

guma44 commented 7 years ago

yes