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

It seems impossible to instantiate GeneToGoTermAssociation objects using the python classes #1507

Open
KeithKelleher opened this issue May 20, 2024 · 0 comments
Labels

Comments

@KeithKelleher
Copy link

Describe the bug
I'm using the python classes for the biolink model, currently trying to create a GeneToGoTermAssociation object.
Whatever I pass as the subject of the association, it gets cast to a "GeneId" and GeneId can't pass through the post_init validation for FunctionalAssociation. It fails with this error:

TypeError: biolink_model.datamodel.model.MacromolecularMachineMixin() argument after ** must be a mapping, not GeneId

To Reproduce
Here's a minimal reproduction:

from biolink_model.datamodel import GeneToGoTermAssociation, Gene

gene = Gene(id="NCBIGene:10513", category="biolink:Gene")
print(gene)

ggta = GeneToGoTermAssociation(id=2, subject=gene, predicate="biolink:associated_with", object="GO:0005875")

Expected behavior
It should be possible to create those objects using the python classes

What working group (or team) did this request originate from?
NCATS Informatics

@nlharris nlharris added the bug label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants