galaxy-genome-annotation / python-apollo

Python library for talking to Apollo API
MIT License
11 stars 11 forks source link

AttributeError: 'Context' object has no attribute 'gi' #58

Closed mpoelchau closed 11 months ago

mpoelchau commented 11 months ago

Hi everyone! I need to load annotations to the Apollo2.7 UcA track. I've previously used add_transcripts_from_gff3_to_annotations.pl but it looks like the load_gff3 function from this library is the new way to go. I ran into the following error:

(apollo-arrow-env) ARS5APVN2WD42YY:Downloads mpoelchau$ arrow annotations load_gff3 --source https://apollo2-stage-node1-cbo.nal.usda.gov/apollo Galleria_mellonella test.gff
/Users/mpoelchau/Documents/programs/apollo-arrow-env/lib/python3.9/site-packages/urllib3/__init__.py:34: NotOpenSSLWarning: urllib3 v2.0 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
Traceback (most recent call last):
  File "/Users/mpoelchau/Documents/programs/apollo-arrow-env/lib/python3.9/site-packages/arrow/decorators.py", line 16, in custom_exception
    return wrapped(*args, **kwargs)
  File "/Users/mpoelchau/Documents/programs/apollo-arrow-env/lib/python3.9/site-packages/arrow/decorators.py", line 46, in str_output
    print(wrapped(*args, **kwargs))
  File "/Users/mpoelchau/Documents/programs/apollo-arrow-env/lib/python3.9/site-packages/arrow/commands/annotations/load_gff3.py", line 51, in cli
    return ctx.gi.annotations.load_gff3(organism, gff3, source=source, batch_size=batch_size, test=test, use_name=use_name, disable_cds_recalculation=disable_cds_recalculation, timing=timing)
AttributeError: 'Context' object has no attribute 'gi'

'Context' object has no attribute 'gi'

I also get the same error when I use show_organism to make sure the library can find Galleria_mellonella.

The gff seems fine - I can load it onto the browser without a problem. I can also find the organism via curl:

(apollo-arrow-env) ARS5APVN2WD42YY:Downloads mpoelchau$ curl -i -X POST -H "Content-Type: application/json" -d '{ "username": "my-username", "password": "my-password", "organism": "Galleria_mellonella", "client_token": "ignore"}' https://apollo2-stage-node1-cbo.nal.usda.gov/apollo/organism/findAllOrganisms
HTTP/1.1 200 
Server: nginx/1.25.1
Date: Fri, 11 Aug 2023 13:33:47 GMT
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST, OPTIONS
Front-End-Https: on

[{"commonName":"Galleria_mellonella","blatdb":"/usr/local/blat/db/galmel/GCF_026898425.1_CSIRO_AGI_GalMel_v1_genomic.fna.2bi","metadata":"{\"creator\":\"1357111\"}","annotationCount":1,"currentOrganism":true,"obsolete":false,"sequences":221,"directory":"/app/data/other_species/galmel/CSIRO_AGI_GalMel_v1/jbrowse/data","publicMode":true,"valid":true,"genomeFastaIndex":null,"genus":"Galleria","species":"mellonella","id":4690912

Could someone point me in the right direction for debugging? Does this have something to do with the NotOpenSSLWarning?

Thanks!

mpoelchau commented 11 months ago

Never mind, thanks to https://github.com/GMOD/Apollo/issues/2641 I realized that I needed to run arrow init first.

abretaud commented 10 months ago

Hi Monica! Yep it's a typical message you get when there's a problem with the arrow config file, glad you found it, the message could be more explicit :thinking: