merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
426 stars 145 forks source link

samtools error #398

Closed xvazquezc closed 8 years ago

xvazquezc commented 8 years ago

Hi Meren, I've been trying to install Anvi'o in our server but I keep getting an error that I think it's related to Samtools (v1.2 but tried others) and anvi-init-bam. I tried running run_mini_test but the output is the same. Any clue why is this happening?

(mypythonenv)[z3382651@katana ~]$ anvi-self-test 

:: Output directory ...

/var/tmp/tmpLMXx6x/test-output

:: Anvo'o version ...

Anvi'o version ...............................: unknown
Profile DB version ...........................: 16
Contigs DB version ...........................: 6
Samples information DB version ...............: 2
Auxiliary HDF5 DB version ....................: 1
Users DB version (for anvi-server) ...........: 1

:: Initializing raw BAM files ...

[12 Sep 16 20:16:07 SORT] Sorting BAM File... May take a while depending on the size.                                                    [E::hts_open] fail to open file '/var/tmp/tmpLMXx6x/test-output/SAMPLE-01.bam'
Traceback (most recent call last):
  File "/home/z3382651/bin/mypythondir/mypythonenv/mypythonenv/bin/anvi-init-bam", line 75, in <module>
    output_file_path = args.output_file,))
  File "/home/z3382651/bin/mypythondir/mypythonenv/mypythonenv/bin/anvi-init-bam", line 48, in init_bam_file
    pysam.sort("-o", output_file_path, input_file_path)
  File "/share/apps/python/2.7.10/lib/python2.7/site-packages/pysam/__init__.py", line 71, in __call__
    (retval, "\n".join(stderr)))
pysam.SamtoolsError: 'csamtools returned with error 1: '

Anvi'o's self-test is done, and the temporary output files are cleaned.

I tried to install it from git too, with similar results

(mypythonenv)[z3382651@katana ~]$ anvi-self-test 

:: Output directory ...

/var/tmp/tmpLWli01/test-output

:: Anvo'o version ...

Anvi'o version ...............................: 2.0.3
Profile DB version ...........................: 16
Contigs DB version ...........................: 6
Samples information DB version ...............: 2
Auxiliary HDF5 DB version ....................: 1
Users DB version (for anvi-server) ...........: 1

:: Initializing raw BAM files ...

Traceback (most recent call last):
  File "/home/z3382651/bin/mypythondir/mypythonenv/mypythonenv/bin/anvi-init-bam", line 4, in <module>
    __import__('pkg_resources').run_script('anvio==2.0.3', 'anvi-init-bam')
  File "/home/z3382651/bin/mypythondir/mypythonenv/mypythonenv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 744, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/z3382651/bin/mypythondir/mypythonenv/mypythonenv/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1499, in run_script
    exec(code, namespace, namespace)
  File "/home/z3382651/bin/mypythondir/mypythonenv/mypythonenv/lib/python2.7/site-packages/anvio-2.0.3-py2.7-linux-x86_64.egg/EGG-INFO/scripts/anvi-init-bam", line 6, in <module>
    import pysam
  File "/home/z3382651/bin/mypythondir/mypythonenv/mypythonenv/lib/python2.7/site-packages/pysam/__init__.py", line 22, in <module>
    from pysam.utils import SamtoolsError
  File "/home/z3382651/bin/mypythondir/mypythonenv/mypythonenv/lib/python2.7/site-packages/pysam/utils.py", line 1, in <module>
    from pysam.cutils import _pysam_dispatch
ImportError: cannot import name _pysam_dispatch

Anvi'o's self-test is done, and the temporary output files are cleaned.
meren commented 8 years ago

Hi xvazquezc,

I am sorry, I have no idea :( Is your pysam v0.9.1? What is the operating system? How did you install samtools?

Best,

xvazquezc commented 8 years ago

Hi Meren, The server is CentOS. Samtools is installed as module in the server and it works well. pysam is 0.8.3

On 12 Sep 2016 8:24 PM, "A. Murat Eren" notifications@github.com wrote:

Hi xvazquezc,

I am sorry, I have no idea :( Is your pysam v0.9.1? What is the operating system? How did you install samtools?

Best,

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/meren/anvio/issues/398#issuecomment-246307642, or mute the thread https://github.com/notifications/unsubscribe-auth/ANgG_XVFxwHNw82oZKbmK_NKdPwFztgqks5qpShKgaJpZM4J6b0Q .

xvazquezc commented 8 years ago

For some reason the pysam version was locked by some other program. Purging all the modules from the server and I was able to upgrade pysam running the minimal required programs and get a proper anvio installation. PS: it seems that Chrome is not really supported by CentOS, so for those using it one note: you might be able to install it with a lot of hassle but it's easier (although not so easy) to tunnel the SSH connection from the server to local and browse in your own computer.

This are rough instructions to make that happen:

  1. Start an interactive job on your cluster. Do not even think of running the application on the head node.
  2. Figure out the IP address of the compute node that you have been assigned to. You can do this by typing ‘ping kc04b01’ where kc04b01 is the name of the compute node. The IP address will be needed later.
  3. Run Anvio and get it to start the server on port 8080. You can start the next step whilst you are waiting.
  4. On YOUR LOCAL COMPUTER type the command ‘ssh -D 12345 username>@<host_name’. If you use Windows then you will need to get PuTTy to do the same thing. This is the magic bit. Note: in Windows you can substitute ssh by plink (in PuTTy folder) and avoid the GUI configuration.
  5. Once Anvio has the server running you can set up Google Chrome. If you are using Linux then run ‘google-chrome --proxy-server=socks://localhost:12345’. Doing this from the command line is much easier but you may need to do it via the application itself. In Windows substitute 'google-chrome' by 'chrome.exe' in the Chrome installation path.
  6. To see your results point Chrome at http://:8080.
meren commented 8 years ago

Hi,

Thank you ver much for the info. I am glad to hear that you managed to resolve it.

And here is an alternative (and simpler) way to do the SSH tunnel:

http://merenlab.org/2015/11/28/visualizing-from-a-server/

:)

Best,

Best,