DRL / blobtools

Modular command-line solution for visualisation, quality control and taxonomic partitioning of genome datasets
GNU General Public License v3.0
190 stars 44 forks source link

Problems with more "global" install #60

Closed mw55309 closed 7 years ago

mw55309 commented 7 years ago

Hey Dom

Sorry for being dumb, I'm sure this is my issue, but nonetheless I could do with some help.

So I have python2.7.3 installed via conda. I activate the environment and install according to your instructions. It all works!

$ ./blobtools
usage: blobtools [<command>] [<args>...] [--help] [--version]

commands:

    create        create a BlobDB
    view          generate tabular view, CONCOCT input or COV files from BlobDB
    plot          generate a BlobPlot from a BlobDB
    covplot       generate a CovPlot from a BlobDB and a COV file

    map2cov       generate a COV file from BAM file
    taxify        generate a BlobTools compatible HITS file (TSV)
    bamfilter     subset paired-end reads from a BAM file
    seqfilter     subset sequences in FASTA file based sequence IDs in list
    nodesdb       create nodesdb based on NCBI Taxdump's names.dmp and nodes.dmp

    -h, --help      show this
    -v, --version   show version number

See 'blobtools <command> --help' for more information on a specific command.

examples:

    # 1. Create a BlobDB
    ./blobtools create -i example/assembly.fna -b example/mapping_1.bam -t example/blast.out -o example/test

    # 2. Generate a tabular view
    ./blobtools view -i example/test.blobDB.json

    # 3. Generate a blobplot
    ./blobtools blobplot -i example/test.blobDB.json

However, I don'#t want to be in the blobtools directory to run it. But if I go outside:

cd ..
./blobtools/blobtools
Traceback (most recent call last):
  File "/home/ubuntu/blobtools/lib/blobtools.py", line 77, in <module>
    exit(call(['./blobtools', '-h']))
  File "/usr/local/anaconda3/envs/python2.7.3/lib/python2.7/subprocess.py", line 493, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/local/anaconda3/envs/python2.7.3/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/local/anaconda3/envs/python2.7.3/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 13] Permission denied

Sorry I am not knowledgeable enough about Python to figure this out, though have done 100s of python installs

Any idea why this is happening?

Mick

mw55309 commented 7 years ago

I mean it seems to me that this line:

    else:
        exit(call(['./blobtools', '-h']))

in blobtools.py assumes that blobtools is in the current working director?

DRL commented 7 years ago

Hi Mick,

not dumb at all ... I think you actually found a bug. If no argument is provided it nopes out. But if you provide the name of any of the commands (create, view, etc ...) it should work.

Can you confirm that

/PATH/TO/BLOBTOOLS/blobtools create -h

works?

cheers,

dom

mw55309 commented 7 years ago

Hi Dom

It does and this can be fixed by putting the full path in

    else:
        exit(call(['./blobtools', '-h']))

As you can see from that code, it assumes blobtools executeable is in the CWD

Cheers Mick

DRL commented 7 years ago

Hi Mick,

fixed it in the branch 'master' ...

cheers,

dom