ISmapper installation issue


#1

Hi,
I am very new to command line and I was trying to install a program called IS mapper on my server. There are instructions on how to pip install the program on the server but when I m trying to do so an error message comes up. I am sorry if this is a very silly request but I cant seems to find a solution myself.
Thank you in advance,
Maria

PS This is what i get
Processing ./IS_mapper

Installing collected packages: ISMapper

Running setup.py install for ISMapper … error

Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-i1j4xrzs-build/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-uqefm76n-record/install-record.txt --single-version-externally-managed --compile:

running install

running build

running build_py

creating build

creating build/lib

creating build/lib/ismap

copying scripts/version.py -> build/lib/ismap

copying scripts/slurm_ismap_sg.py -> build/lib/ismap

copying scripts/__init__.py -> build/lib/ismap

copying scripts/slurm_ismap.py -> build/lib/ismap

copying scripts/create_genbank_table.py -> build/lib/ismap

copying scripts/compiled_table.py -> build/lib/ismap

copying scripts/create_typing_out.py -> build/lib/ismap

copying scripts/ismap.py -> build/lib/ismap

copying scripts/binary_table.py -> build/lib/ismap

running build_scripts

creating build/scripts-3.5

copying and adjusting scripts/binary_table.py -> build/scripts-3.5

copying and adjusting scripts/compiled_table.py -> build/scripts-3.5

copying and adjusting scripts/create_genbank_table.py -> build/scripts-3.5

copying and adjusting scripts/slurm_ismap.py -> build/scripts-3.5

copying and adjusting scripts/create_typing_out.py -> build/scripts-3.5

copying and adjusting scripts/slurm_ismap_sg.py -> build/scripts-3.5

changing mode of build/scripts-3.5/binary_table.py from 664 to 775

changing mode of build/scripts-3.5/compiled_table.py from 664 to 775

changing mode of build/scripts-3.5/create_genbank_table.py from 664 to 775

changing mode of build/scripts-3.5/slurm_ismap.py from 664 to 775

changing mode of build/scripts-3.5/create_typing_out.py from 664 to 775

changing mode of build/scripts-3.5/slurm_ismap_sg.py from 664 to 775

running install_lib

creating /usr/local/lib/python3.5/dist-packages/ismap

error: could not create '/usr/local/lib/python3.5/dist-packages/ismap': Permission denied



----------------------------------------

Command “/usr/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-i1j4xrzs-build/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-uqefm76n-record/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-i1j4xrzs-build/


#2

Hi Maria - you can install ISmapper systemwide with:

git clone https://github.com/jhawkey/IS_mapper/
sudo pip install IS_mapper/

or install for just a single user with:

git clone https://github.com/jhawkey/IS_mapper/
sudo pip install --user IS_mapper/


#3

Thank you, this worked fine, but i still get an error (different one).
Is that something you could help me with ?
Traceback (most recent call last):

File “/usr/local/bin/ismap”, line 9, in

load_entry_point('ISMapper==0.1.5.1', 'console_scripts', 'ismap')()

File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 542, in load_entry_point

return get_distribution(dist).load_entry_point(group, name)

File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2569, in load_entry_point

return ep.load()

File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2229, in load

return self.resolve()

File “/usr/lib/python3/dist-packages/pkg_resources/init.py”, line 2235, in resolve

module = __import__(self.module_name, fromlist=['__name__'], level=0)

File “/usr/local/lib/python3.5/dist-packages/ismap/ismap.py”, line 160

print built_index

#4

Oops - this was my mistake, we need to make sure that ISMapper is called with python2, not python3.

Return to the directory that contains the directory that was generated by git clone https://github.com/jhawkey/IS_mapper/.

Remove the current installation of ISMapper:

sudo pip uninstall ISMapper

Then reinstall with pip2:

sudo pip2 install IS_Mapper/

That should fix the print/brackets error.


#5

Thank you so much! This works fine


#6

Well, I talked ahead of myself. The program was installed correctly but when i tried to test it with the recommended files an error came up again. I m sorry for taking up your time.
Here it is:
ismap --reads ERR225612_1.fastq.gz --queries IS_mapper/test/inputs/ISSsu3.fasta --typingRef IS_mapper/test/inputs/S_suis_P17.gbk --log --runtype typing --output S_suis

Traceback (most recent call last):

File “/usr/local/bin/ismap”, line 11, in

load_entry_point('ISMapper==0.1.5.1', 'console_scripts', 'ismap')()

File “/usr/local/lib/python2.7/dist-packages/ismap/ismap.py”, line 469, in main

samtools_runner = RunSamtools()

File “/usr/local/lib/python2.7/dist-packages/ismap/ismap.py”, line 59, in init

version_id=re.findall('0\.[0-9]\.[0-9]{1,2}', version_string)[0]

IndexError: list index out of range


#7

Good - we’re making progress!

I actually tested the install for ISMapper earlier and there’s a bug in the part of the script that does the detection of which samtools version you’re running. I’ll submit a pull request with the author, but to fix this quickly, you can patch the code yourself.

You need to edit the file IS_Mapper/scripts/ismap.py, which you can find in the directory that you cloned from github.

Find the following lines:

        if len(version_string) == 0: 
            print("Could not find Samtools") 
            raise IOError 
        if len(re.findall('1\.[0-9]\.[0-9]', version_string)): 
            version_id=re.findall('1\.[0-9]\.[0-9]{1,2}', version_string)[0] 
            print("Found samtools version {}".format(version_id)) 
            self.version=1 
        else: 
            version_id=re.findall('0\.[0-9]\.[0-9]{1,2}', version_string)[0] 
            print("Found samtools version {}".format(version_id)) 
            self.version=0

Replace them with:

        if len(version_string) == 0:
            print("Could not find Samtools")
            raise IOError
        if len(re.findall('\s1\.[0-9]', version_string)):
            version_id=re.findall('1\.[0-9]', version_string)[0]
            print("Found samtools version {}".format(version_id.lstrip(" ")))
            self.version=1
        elif len(re.findall('\s1\.[0-9]\.[0-9]', version_string)):
            version_id=re.findall('1\.[0-9]\.[0-9]{1,2}', version_string)[0]
            print("Found samtools version {}".format(version_id.lstrip(" ")))
            self.version=1
        else:
            version_id=re.findall('\s0\.[0-9]\.[0-9]{1,2}', version_string)[0]
            print("Found samtools version {}".format(version_id.lstrip(" ")))
            self.version=0

Then, make sure you are in the directory that contains the cloned repo and reinstall ISMapper with pip:

sudo pip2 uninstall ISMapper
sudo pip2 install IS_Mapper/


#8

That completely solved the problem !! Thank you