TransWikia.com

cmapPy exception

Bioinformatics Asked by blue bells on July 20, 2021

I’m trying to read gctx files with cmapPy. This is my code:

from cmapPy.pandasGEXpress.parse_gct import parse
from cmapPy.pandasGEXpress.write_gct import write
parse("C:/Users/User/Desktop/gctx/CAS9_BASELINE_LEVEL3_BING__n10721x10174.gctx")

This is the error:

(base) C:UsersUserDesktophello>D:/anaconda/python.exe c:/Users/User/Desktop/gctx/readgcxtx.py
Traceback (most recent call last):
  File "c:/Users/User/Desktop/gctx/readgcxtx.py", line 3, in <module>
    parse("C:/Users/User/Desktop/gctx/CAS9_BASELINE_LEVEL3_BING__n10721x10174.gctx")
  File "D:anacondalibsite-packagescmapPypandasGEXpressparse_gct.py", line 136, in parse
    num_row_metadata, num_col_metadata) = read_version_and_dims(file_path)
  File "D:anacondalibsite-packagescmapPypandasGEXpressparse_gct.py", line 168, in  read_version_and_dims
    version = f.readline().strip().lstrip("#")
  File "D:anacondalibencodingscp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2440: character maps to <undefined>

I tried changing the path with double slashes or r"…" but it doesn’t work. Thanks.

One Answer

The error I see is,

UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 2440: character maps to

This suggests there is an error in the input format that the program doesn't like.

The thing that bothers me is why you have a mix of / and for directory paths. Windows uses and Linux and OS X use / . I don't Windows so I really can't comment.

  1. It looks like you've used a character at position 2440 that the code doesn't like, this is often the case with ambiguous characters such as degenerate nucleotides or ambiguity codes for example "?" or "N". It seems to suggest its neither or these but something like ...
  2. I'd be cautious of is the carriage returns because Windows is of course very different to Linux in this regard. r (I think) versus n

undefined mapping suggests is quite a specific error and therefore resolvable.

Answered by M__ on July 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP