cmap / cmapPy

Assorted tools for interacting with .gct, .gctx files and other Connectivity Map (Broad Institute) data/tools
https://clue.io/cmapPy/index.html
BSD 3-Clause "New" or "Revised" License
124 stars 74 forks source link

pandasGEXpress parse fails #23

Closed stuppie closed 6 years ago

stuppie commented 6 years ago

Download test_l1000.gct (https://github.com/cmap/cmapPy/raw/master/cmapPy/pandasGEXpress/tests/functional_tests/test_l1000.gct)

from cmapPy.pandasGEXpress import parse
parse("test_l1000.gct")

TypeError Traceback (most recent call last)

in () 1 from cmapPy.pandasGEXpress import parse ----> 2 parse("test_l1000.gct") /usr/local/lib/python3.5/dist-packages/cmapPy/pandasGEXpress/parse.py in parse(file_path, convert_neg_666, rid, cid, ridx, cidx, row_meta_only, col_meta_only, make_multiindex) 57 msg = "parse_gct does not use the argument {}. Ignoring it...".format(unused_arg) 58 logger.warning(msg) ---> 59 curr = parse_gct.parse(file_path, convert_neg_666, row_meta_only, col_meta_only, make_multiindex) 60 elif file_path.endswith(".gctx"): 61 curr = parse_gctx.parse(file_path, convert_neg_666, rid, cid, ridx, cidx, row_meta_only, col_meta_only, /usr/local/lib/python3.5/dist-packages/cmapPy/pandasGEXpress/parse_gct.py in parse(file_path, convert_neg_666, row_meta_only, col_meta_only, make_multiindex) 121 # Read version and dimensions 122 (version, num_data_rows, num_data_cols, --> 123 num_row_metadata, num_col_metadata) = read_version_and_dims(file_path) 124 125 # Read in metadata and data /usr/local/lib/python3.5/dist-packages/cmapPy/pandasGEXpress/parse_gct.py in read_version_and_dims(file_path) 145 146 # Get version from the first line --> 147 version = f.readline().strip().lstrip("#") 148 149 if version not in ["1.3", "1.2"]: TypeError: a bytes-like object is required, not 'str'
oena commented 6 years ago

Hi @stuppie, we have some outstanding issues with Python 3 and are likely to remove compatibility until we have some more time/resources to update the repo (or unless you would like to contribute some time to it!). The master branch also has some other unit test bugs that I'm aware of and have fixed on the testing_travis branch; these will be merged into master this week and will also correspond to a new release of the package on PyPI and bioconda. I apologize for the inconvenience.

Until then, I recommend using a Python 2.7 environment for your use of cmapPy; our installation instructions can help you make a conda environment with that version of Python.

levlitichev commented 6 years ago

Closing issue because related to Py3 incompatibility, a problem we're aware of. Keeping issue https://github.com/cmap/cmapPy/issues/25 open instead.