Giter Site home page Giter Site logo

Comments (6)

jorvis avatar jorvis commented on July 16, 2024

Note for others reading this, this is a git clone rather than an installation using PyPi.

Kyle - The key directory I don't see in your PYTHONPATH is this: /home/ktretina/git/biocode/lib

What happens when you add that?

from biocode.

ktretina avatar ktretina commented on July 16, 2024

It doesn't seem to make a difference, I still get the same error when I set it to this (below), open a new session, then run the script.

export PYTHONPATH=$PYTHONPATH:/home/jorvis/lib:/home/jorvis/svn/jorvis/utilities/lib:/home/jorvis/git/biocode/lib:/home/jorvis/git/Emergence/emergence/apps:/home/ktretina/git/biocode/lib/biocode/:/home/ktretina/git/biocode/lib

from biocode.

jorvis avatar jorvis commented on July 16, 2024

Confused here. I just spawned a brand-new VM, empty, and did this:

jorvis@falcon-node-001:~$ sudo apt-get install git
...
jorvis@falcon-node-001:~$ git clone https://github.com/jorvis/biocode.git
Cloning into 'biocode'...
remote: Counting objects: 3495, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 3495 (delta 0), reused 0 (delta 0), pack-reused 3491
Receiving objects: 100% (3495/3495), 1.08 MiB | 0 bytes/s, done.
Resolving deltas: 100% (2073/2073), done.
Checking connectivity... done.

jorvis@falcon-node-001:~$ export PYTHONPATH=$HOME/biocode/lib

jorvis@falcon-node-001:~$ ./biocode/gff/write_fasta_from_gff.py 
usage: write_fasta_from_gff.py [-h] -i INPUT_FILE [-o OUTPUT_FILE]
                               [-t {protein,cds}] [-f FASTA]
                               [-ft {mRNA,polypeptide}] [--check_ends]
                               [--check_internal_stops]
write_fasta_from_gff.py: error: the following arguments are required: -i/--input_file

from biocode.

ktretina avatar ktretina commented on July 16, 2024

I tried a series of different additions to my PYTHONPATH, and was able to get a different error:

[ktretina@medusa ~]$ export PYTHONPATH=/home/ktretina/git/biocode/lib/biocode
[ktretina@medusa ~]$ python ~/git/biocode/gff/write_fasta_from_gff.py -i ref.gff3 -f ref.fasta -o ref.fasta -t cds
Traceback (most recent call last):
File "/home/ktretina/git/biocode/gff/write_fasta_from_gff.py", line 31, in
from biocode import utils, gff
ImportError: No module named 'biocode'
[ktretina@medusa ~]$ export PYTHONPATH=/home/ktretina/git/biocode:/home/ktretina/git/biocode/lib/biocode/
[ktretina@medusa ~]$ python ~/git/biocode/gff/write_fasta_from_gff.py -i ref.gff3 -f ref.fasta -o ref.fasta -t cds
Traceback (most recent call last):
File "/home/ktretina/git/biocode/gff/write_fasta_from_gff.py", line 31, in
from biocode import utils, gff
ImportError: No module named 'biocode'
[ktretina@medusa ~]$ export PYTHONPATH=/home/ktretina/git/:/home/ktretina/git/biocode:/home/ktretina/git/biocode/lib:/home/ktretina/git/biocode/lib/biocode
[ktretina@medusa samples]$ python ~/git/biocode/gff/write_fasta_from_gff.py -i reference/Tparva_Muguga_newref.gff3 -f reference/reference.tp.assembly.all.fasta -o test.fasta -t cds
Traceback (most recent call last):
File "/home/ktretina/git/biocode/gff/write_fasta_from_gff.py", line 126, in
main()
File "/home/ktretina/git/biocode/gff/write_fasta_from_gff.py", line 65, in main
utils.add_assembly_fasta(assemblies, args.fasta)
File "/home/ktretina/git/biocode/lib/biocode/utils.py", line 219, in add_assembly_fasta
fasta_seqs = utils.fasta_dict_from_file(fasta_file)
NameError: name 'utils' is not defined

I'm a little confused by this, because I would expect it to first throw an error at import utils.

from biocode.

jorvis avatar jorvis commented on July 16, 2024

Try making your PYTHONPATH only this:

export PYTHONPATH=/home/ktretina/git/biocode/lib

from biocode.

ktretina avatar ktretina commented on July 16, 2024

This seems to have done the trick! Thanks!

from biocode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.