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

Update createOrganism.py to use python-apollo library for web service calls #1

Open
mpoelchau opened this issue Feb 3, 2021 · 3 comments
Assignees

Comments

@mpoelchau
Copy link
Contributor

Vern discovered that there is a python apollo library (https://pypi.org/project/apollo/), and that it is much better for forming the web service calls to Apollo. He suggested updating createOrganism.py to use this library.

@mpoelchau
Copy link
Contributor Author

I loaded the data to apollo2-stage, installed the apollo python library, checked out the new refactor branch and ran it with the following command from my mac:

(base) ARSMDBE22WAHMP1:bin mpoelchau$ python3 createOrganism.py -host https://apollo2-stage-node1.nal.usda.gov/apollo -organism Photinus_pyralis -genus Photinus -species pyralis -directory /app/data/other_species/phopyr/Ppyr1.3/jbrowse/data -blatdb /usr/local/blat/db/phopyr/GCF_008802855.1_Ppyr1.3_genomic.fna.2bi -publicMode -token ignore -username secretusername -password secretpassword
Create organism: Organism Photinus_pyralis does not exist
Error Createing Organism 'Photinus_pyralis' see error below:
Apollo Error in function "add_organism":
	-problem saving organism: org.codehaus.groovy.grails.web.converters.exceptions.ConverterException: Error parsing JSON

@g8tor any ideas what's going on?

@mpoelchau
Copy link
Contributor Author

D'oh, it was the problem with the mal-formatted trackList.json file, totally unrelated... Fixed the tracklist, and the script worked like a charm!

One improvement suggestion - could you update the script so that it automatically appends /apollo to the URL (e.g. the user specifies -host http://localhost:8080, the script turns it into http://localhost:8080/apollo/[webservice function here]. If it's not appropriate here we'll need to update the cwl script to add it, and the documentation of this script to add it.

@mpoelchau
Copy link
Contributor Author

I'll note for future reference that createOrganism.py/apollo's web services are veeeery particular about the host URL: for our staging server it should be https://apollo2-stage-node1.nal.usda.gov/apollo (NO Backslash at the end!)

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