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

pubmed-annotate breaks with AttributeError on some articles. #173

Closed
caufieldjh opened this issue Aug 15, 2023 · 0 comments · Fixed by #178
Closed

pubmed-annotate breaks with AttributeError on some articles. #173

caufieldjh opened this issue Aug 15, 2023 · 0 comments · Fixed by #178

Comments

@caufieldjh
Copy link
Member

@AgranyaGitHub reports that a run of pubmed-annotate on disease vs. cellular process relationships in the IBD literature template (ibd_literature and ibd_literature.DiseaseCellularProcessRelationship) encountered this:

  File “/Users/agranyaketha/opt/anaconda3/envs/ontogpt/bin/ontogpt”, line 6, in <module>
    sys.exit(main())
  File “/Users/agranyaketha/opt/anaconda3/envs/ontogpt/lib/python3.10/site-packages/click/core.py”, line 1130, in __call__
    return self.main(*args, **kwargs)
  File “/Users/agranyaketha/opt/anaconda3/envs/ontogpt/lib/python3.10/site-packages/click/core.py”, line 1055, in main
    rv = self.invoke(ctx)
  File “/Users/agranyaketha/opt/anaconda3/envs/ontogpt/lib/python3.10/site-packages/click/core.py”, line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File “/Users/agranyaketha/opt/anaconda3/envs/ontogpt/lib/python3.10/site-packages/click/core.py”, line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File “/Users/agranyaketha/opt/anaconda3/envs/ontogpt/lib/python3.10/site-packages/click/core.py”, line 760, in invoke
    return __callback(*args, **kwargs)
  File “/Users/agranyaketha/Documents/GitHub/ontogpt/src/ontogpt/cli.py”, line 373, in pubmed_annotate
    textlist = pmc.text(pmids[: pubmed_annotate_limit + 1])
  File “/Users/agranyaketha/Documents/GitHub/ontogpt/src/ontogpt/clients/pubmed_client.py”, line 335, in text
    these_docs = self.parse_pmxml(
  File “/Users/agranyaketha/Documents/GitHub/ontogpt/src/ontogpt/clients/pubmed_client.py”, line 468, in parse_pmxml
    pa.find(“PubmedData”).find(“ArticleIdList”).find(“ArticleId”, {“IdType”: “pmc”})
AttributeError: ‘NoneType’ object has no attribute ‘find’

My best guess is that one of the Pubmed results in the search doesn't have an ArticleIdList at all, which is pretty weird, and my guess is that the IDs are stored somewhere else in that entry.

Reproduce with:

ontogpt -vvv pubmed-annotate -t ibd_literature.DiseaseCellularProcessRelationship “inflammatory bowel disease” --limit 2000 -o output.yaml -O yaml
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

Successfully merging a pull request may close this issue.

1 participant