organism.delete_features does not work: Can not find organism for null to remove features of
NeillGibson opened this issue · 5 comments
Hi,
Thank you for the nice Apollo client. Most features work as expected.
I am having trouble to delete all genes/transcript features from an organism from the relational database:
connection.organisms.get_organisms()
{'annotationCount': 22979,
'blatdb': None,
'commonName': 'unit_test_organism',
'currentOrganism': True,
'directory': '/data/qa/Tools/apollo/2.0.6/unit_test_organism/data',
'genus': None,
'id': 40,
'publicMode': False,
'sequences': 7,
'species': None,
'valid': True}
See my commands to try to delete all genes/transcript features for
>>> connection.organisms.delete_features(40)
{'error': 'problem removing organism features for organism: java.lang.Exception: Can not find organism for null to remove features of'}
>>> connection.organisms.delete_features('40')
{'error': 'problem removing organism features for organism: java.lang.Exception: Can not find organism for null to remove features of'}
>>> connection.organisms.delete_features("unit_test_organism")
{'error': 'problem removing organism features for organism: java.lang.Exception: Can not find organism for null to remove features of'}
The code in the apollo client posts a json where a value is set for the ID field.
https://github.com/galaxy-genome-annotation/python-apollo/blob/master/apollo/organisms/__init__.py#L152
The server side code seems to expect the a json where a value is set for the Organism (common name) field.
https://github.com/GMOD/Apollo/blob/master/grails-app/controllers/org/bbop/apollo/OrganismController.groovy#L177
I guess this is where it might go wrong. The client and server side code don't use the same field in the json object?
Is it by the way correct that deleting an organism (using the API method deleteOrganism ) includes the deletion of all features from the relational database?
Thank you.
- yep, you're absolutely right, that should be corrected to
'organism'
instead of'id'
. - I'll get a patch out when I'm back from holiday.
- I am under the impression that you cannot delete an organism without deleting all of the features first. (If my memory of the UI popup is correct.)
Ok thank you. I look forward to the patch.
I don't have a test server running at this minute, I hope this fixes it for you though!
Ok thank you. I will let you know if it works. Might take a few days.
I need to upgrade our pypi installed python-apollo client via github I guess?
A new tag has been pushed which should appear on pypi shortly.