Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 encoded canopus.tsv #3

Open
askerdb opened this issue Jun 6, 2021 · 0 comments
Open

UTF-8 encoded canopus.tsv #3

askerdb opened this issue Jun 6, 2021 · 0 comments

Comments

@askerdb
Copy link

askerdb commented Jun 6, 2021

Hi,

Thanks for making this software!

I ran the following:

from canopus import Canopus
C = Canopus(sirius="/emc/cbmr/users/chs962/mani_diet_sirius_aligned_canopus")
C.npcSummary().to_csv("npc_summary.csv")

I ran it on a workspace generated with SIRIUS 4.8.2.

It failed with an error about parsing ascii that i unfortunately didn't save
presumably because the canopus.tsv is utf-8 encoded:
-bash-4.2$ file /emc/cbmr/users/chs962/mani_diet_sirius_aligned_canopus/canopus.tsv
/emc/cbmr/users/chs962/mani_diet_sirius_aligned_canopus/canopus.tsv: UTF-8 Unicode text, with very long lines

I applied the following fix:
@@ -771,7 +772,8 @@ class SiriusWorkspace(object):

 def load_ontology_index(self):
     mapping = dict()
  •    with Path(self.rootdir, "canopus.tsv").open() as fhandle:
    
  •    print(Path(self.rootdir, "canopus.tsv"))
    
  •    with Path(self.rootdir, "canopus.tsv").open(encoding="utf-8") as fhandle:
           header=None
           ri = None
           coid = None
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant