NameError: name 'utils' is not defined
1
0
Entering edit mode
6.8 years ago
arsilan324 ▴ 90

I am trying to run convert_gff3_to_ncbi_tbl.py script but getting this error.

ubt80:EMBLmyGFF3 arslan$ python3 convert_gff3_to_ncbi_tbl.py -i juncus.fasta.transdecoder.refined.gff3 -o arslan.tbl -ln TEST -nap JE -gf juncus-rp.fasta
INFO: splitting mRNA off gene Transcript_138016|g.186294
Traceback (most recent call last):
  File "convert_gff3_to_ncbi_tbl.py", line 89, in <module>
    main()
  File "convert_gff3_to_ncbi_tbl.py", line 82, in main
    tbl.print_tbl_from_assemblies(assemblies=assemblies, ofh=ofh, go_obo=args.go_obo, lab_name=args.lab_name)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/biocode/tbl.py", line 86, in print_tbl_from_assemblies
    print_biogene(gene=new_gene, fh=ofh, obo_dict=go_idx, lab_name=lab_name)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/biocode/tbl.py", line 117, in print_biogene
    gene_coords = utils.interbase0_to_humancoords(gene_loc.fmin, gene_loc.fmax, gene_loc.strand)
NameError: name 'utils' is not defined

Can you please comment how can I fix it? Thanks

Python GFF3 NCBI TBL • 10k views
ADD COMMENT
0
Entering edit mode

Did you install biocode? The script is trying to import some biocode stuff (module / function / class? I don't know how python call them) and failing, hence the error. What happens if you start the python interpreter and try to import biocode?

ADD REPLY
0
Entering edit mode

Yes, I did install it using pip. What do you mean by?

  • What happens if you start the python interpreter and try to import biocode
ADD REPLY
1
Entering edit mode

Issue python3, the inteactive interpreter will open, then issue import biocode.

$ python3
Python 3.6.4 (default, Jan  5 2018, 02:13:53) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import biocode
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'biocode'

You could try installing biocode with virtualenv + pip.

P.S.: did you use pip or pip3?

ADD REPLY
0
Entering edit mode

The biocode libraries were all written with Python3, so installation is needed using pip3. (I'm the author) Here it looks like you might be trying to run it using a GitHub checkout instead. That's fine too, but you'd need to add the biocode/lib dir to your PYTHONPATH if you do it that way. This is all in the README.

https://github.com/jorvis/biocode/blob/master/README.rst

ADD REPLY
0
Entering edit mode
6.8 years ago
tdmurphy ▴ 230

Have you tried NCBI's converter, to go straight from GFF3 to ASN.1 submission files? See: https://www.ncbi.nlm.nih.gov/genbank/genomes_gff/

ADD COMMENT
0
Entering edit mode

Thank you for mentioning this tool. I am trying to install it using chmod +x but it is not helping me. I am using mac. I am unable to find instructions as well. Can you suggest how to install. Thanks

ADD REPLY

Login before adding your answer.

Traffic: 1626 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6