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

organism.delete_features does not work: Can not find organism for null to remove features of #4

Closed
NeillGibson opened this issue Oct 29, 2017 · 5 comments

Comments

@NeillGibson
Copy link

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.

@hexylena
Copy link
Member

  • 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.)

@NeillGibson
Copy link
Author

Ok thank you. I look forward to the patch.

@hexylena
Copy link
Member

I don't have a test server running at this minute, I hope this fixes it for you though!

@NeillGibson
Copy link
Author

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?

@hexylena
Copy link
Member

A new tag has been pushed which should appear on pypi shortly.

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