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

Where to store obo file #307

Open
Tim-Kirkwood opened this issue Nov 1, 2024 · 1 comment
Open

Where to store obo file #307

Tim-Kirkwood opened this issue Nov 1, 2024 · 1 comment

Comments

@Tim-Kirkwood
Copy link

Hello,

Thank you for making this tool.

I am trying to replicate this usecase with this command on Windows 11, Python 3:

python C:\Anaconda3\pkgs\goatools-1.2.3-pyh7cba7a3_2\python-scripts\plot_go_term.py --term=GO:0055013,GO:0060048,GO:0003300,GO:0055008,GO:0055003,GO:0035995,GO:0007076,GO:0006936,GO:0010628,GO:0050714,GO:0010737,GO:0051592,GO:0045214,GO:0048769,GO:0030241,GO:0030240,GO:0006941

I get this error:

Traceback (most recent call last):
  File "C:\Anaconda3\pkgs\goatools-1.2.3-pyh7cba7a3_2\python-scripts\plot_go_term.py", line 84, in <module>
    g = GODag(obo_file)
  File "C:\Anaconda3\envs\pip_env\lib\site-packages\goatools\obo_parser.py", line 321, in __init__
    self.version, self.data_version = self.load_obo_file(
  File "C:\Anaconda3\envs\pip_env\lib\site-packages\goatools\obo_parser.py", line 327, in load_obo_file
    reader = OBOReader(obo_file, optional_attrs)
  File "C:\Anaconda3\envs\pip_env\lib\site-packages\goatools\obo_parser.py", line 56, in __init__
    raise Exception(
Exception: COULD NOT READ(go-basic.obo)
download obo file first
 [http://geneontology.org/ontology/go-basic.obo]

As I am on Windows, I cant use wget. Therefore, I manually downloaded the go-basic.obo file and put it in C:\Anaconda3\pkgs\goatools-1.2.3-pyh7cba7a3_2\site-packages\goatools. This is because it looks like OBOReader expects the obo file to be in the same location as the obo_parser module. However, I got the same error.

Can I confirm where the obo file should be placed? Please could you suggest any other potential fixes?

Thanks very much!
Tim

@tanghaibao
Copy link
Owner

@Tim-Kirkwood

For this script and most other cases, the obo file should be placed in the current working directory.

For example, let's say you download the obo to /tmp, then you can just run the script there.

$ ls -1 *.obo
go-basic.obo

$ plot_go_term.py --term=GO:0055013
go-basic.obo: fmt(1.2) rel(2024-06-17) 45,494 Terms
GO:0055013	level-05	depth-05	cardiac muscle cell development [biological_process]
all parents: {'GO:0048856', 'GO:0009987', 'GO:0032502', 'GO:0055006', 'GO:0008150', 'GO:0048468', 'GO:0048869', 'GO:0055001'}
all children: {'GO:0055014', 'GO:0060926', 'GO:0055015', 'GO:0060928', 'GO:0060931'}
lineage info for terms ['GO:0055013'] written to GO_lineage.pdf

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

2 participants