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

original Media object wont load without object_type string #16

Closed

Conversation

samseaver
Copy link
Contributor

This simple script wouldn't work for me:

#!/usr/bin/env python
import cobrakbase
kbase = cobrakbase.KBaseAPI()
ws = "KBaseMedia"
media = kbase.get_from_ws('Carbon-D-Glucose', ws)

I figured out somehow that the Media object in cobrakbase/core/kbasebiochem/media.py is not passing the object_type field, while the one in cobrakbase/core/kbasebiochemmedia.py does, and if I use the latter, it doesn't fail, but I'm unsure if this is the right object to use for ModelSEEDPy

@samseaver
Copy link
Contributor Author

I was testing in ModelSEEDPy and so by implementing these changes it seems to work with model.medium=<media object> but it's not fully tested...

@Fxe
Copy link
Owner

Fxe commented Nov 2, 2023

The example code snippet you gave works just fine for me.
Also tested on another model and medium assignment works:

import cobrakbase
kbase = cobrakbase.KBaseAPI()
model = kbase.get_from_ws('GCF_000005845.2.RAST.mdl', 151186)
media = kbase.get_from_ws('Carbon-D-Glucose', 151186)
model.medium = media

The corrected type for KBase media should be cobrakbase.core.kbasebiochem.media.Media I have old types when I wasn't following the KBase datatype "path"

@Fxe
Copy link
Owner

Fxe commented Nov 2, 2023

Oh, I think you are using the wrong branch... https://github.com/Fxe/cobrakbase/tree/cobra-model ! this is the corrected branch, sorry for the confusion. Will fix this mess since it is not obvious for other folks.

@samseaver
Copy link
Contributor Author

I was using the cobra-model branch, but I see you've updated it so I'll do a pull and test

@samseaver samseaver closed this Nov 2, 2023
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 this pull request may close these issues.

2 participants