kuroの覚え書き

96の個人的覚え書き

MISO

というわけで改めてやり直し

まずはpython2.7.13をインストーラをダウンロードしてインストール(3.6もHomebrew使ってないので)
次に

$ pip2 install misopy
Collecting misopy
  Using cached misopy-0.5.3.tar.gz
Collecting matplotlib (from misopy)
  Downloading matplotlib-2.0.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (12.8MB)
    100% |=============================================| 12.8MB 97kB/s 
Collecting numpy>=1.5.0 (from misopy)
  Downloading numpy-1.13.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (4.6MB)
    100% |=============================================| 4.6MB 308kB/s 
Collecting scipy>=0.9.0 (from misopy)
  Downloading scipy-0.19.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (16.2MB)
    100% |=============================================| 16.2MB 78kB/s 
Collecting pysam>=0.6.0 (from misopy)
  Using cached pysam-0.11.2.2.tar.gz
Collecting python-dateutil (from matplotlib->misopy)
  Using cached python_dateutil-2.6.0-py2.py3-none-any.whl
Collecting subprocess32 (from matplotlib->misopy)
  Downloading subprocess32-3.2.7.tar.gz (54kB)
    100% |=============================================| 61kB 8.4MB/s 
Collecting cycler>=0.10 (from matplotlib->misopy)
  Using cached cycler-0.10.0-py2.py3-none-any.whl
Collecting six>=1.10 (from matplotlib->misopy)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting pytz (from matplotlib->misopy)
  Using cached pytz-2017.2-py2.py3-none-any.whl
Collecting functools32 (from matplotlib->misopy)
  Downloading functools32-3.2.3-2.zip
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 (from matplotlib->misopy)
  Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil, subprocess32, cycler, pytz, functools32, numpy, pyparsing, matplotlib, scipy, pysam, misopy
  Running setup.py install for subprocess32 ... done
  Running setup.py install for functools32 ... done
  Running setup.py install for pysam ... done
  Running setup.py install for misopy ... done
Successfully installed cycler-0.10.0 functools32-3.2.3.post2 matplotlib-2.0.2 misopy-0.5.3 numpy-1.13.0 pyparsing-2.2.0 pysam-0.11.2.2 python-dateutil-2.6.0 pytz-2017.2 scipy-0.19.1 six-1.10.0 subprocess32-3.2.7

こうやれば依存関係を解決してインストールしてくれるから、この方がいい。




と思ったが、まだなんかおかしいらしい・・・手強い。
も一回やり直し。
まずはvirtualenvなる仮想化環境を導入

$ pip install virtualenv
Collecting virtualenv
  Using cached virtualenv-15.1.0-py2.py3-none-any.whl
Installing collected packages: virtualenv
Successfully installed virtualenv-15.1.0

この状態でpython2.7(自前でインストールした2.7.13の方)に導入されているmoduleは

$ pip list
pip (9.0.1)
python-dateutil (2.6.0)
virtualenv (15.1.0)

これだけ。
この状態でまずはpython2.7.13のパッケージのあるディレクトリにパスを通し、仮想環境”MISO”を作る

$ export PATH=/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages:$PATH
$ virtualenv MISO
New python executable in /Users/hoge/MISO/bin/python
Installing setuptools, pip, wheel...done.

この状態でホームディレクトリにMISOというディレクトリができる

$ ls MISO
bin			lib			pip-selfcheck.json
include			misopy

さてようやく仮想環境ができたのでその中にインストールしていく

$ MISO/bin/pip install misopy
Collecting misopy
  Using cached misopy-0.5.3.tar.gz
Collecting matplotlib (from misopy)
  Using cached matplotlib-2.0.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting numpy>=1.5.0 (from misopy)
  Using cached numpy-1.13.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting scipy>=0.9.0 (from misopy)
  Using cached scipy-0.19.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting pysam>=0.6.0 (from misopy)
  Using cached pysam-0.11.2.2.tar.gz
Collecting python-dateutil (from matplotlib->misopy)
  Using cached python_dateutil-2.6.0-py2.py3-none-any.whl
Collecting subprocess32 (from matplotlib->misopy)
  Using cached subprocess32-3.2.7.tar.gz
Collecting cycler>=0.10 (from matplotlib->misopy)
  Using cached cycler-0.10.0-py2.py3-none-any.whl
Collecting six>=1.10 (from matplotlib->misopy)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting pytz (from matplotlib->misopy)
  Using cached pytz-2017.2-py2.py3-none-any.whl
Collecting functools32 (from matplotlib->misopy)
  Using cached functools32-3.2.3-2.zip
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 (from matplotlib->misopy)
  Using cached pyparsing-2.2.0-py2.py3-none-any.whl
Building wheels for collected packages: misopy, pysam, subprocess32, functools32
  Running setup.py bdist_wheel for misopy ... done
  Stored in directory: /Users/hoge/Library/Caches/pip/wheels/8d/7a/aa/eb0b855275e5ae17fef663067b0a06a6d3895a2ba8b7ea4077
  Running setup.py bdist_wheel for pysam ... done
  Stored in directory: /Users/hoge/Library/Caches/pip/wheels/46/11/cc/f4a7a7048ae3f5d9e81d3bf3724aaa692fdef080ae46940092
  Running setup.py bdist_wheel for subprocess32 ... done
  Stored in directory: /Users/hoge/Library/Caches/pip/wheels/7d/4c/a4/ce9ceb463dae01f4b95e670abd9afc8d65a45f38012f8030cc
  Running setup.py bdist_wheel for functools32 ... done
  Stored in directory: /Users/hoge/Library/Caches/pip/wheels/3c/d0/09/cd78d0ff4d6cfecfbd730782a7815a4571cd2cd4d2ed6e69d9
Successfully built misopy pysam subprocess32 functools32
Installing collected packages: six, python-dateutil, subprocess32, cycler, pytz, functools32, numpy, pyparsing, matplotlib, scipy, pysam, misopy
Successfully installed cycler-0.10.0 functools32-3.2.3.post2 matplotlib-2.0.2 misopy-0.5.3 numpy-1.13.0 pyparsing-2.2.0 pysam-0.11.2.2 python-dateutil-2.6.0 pytz-2017.2 scipy-0.19.1 six-1.10.0 subprocess32-3.2.7

この操作でモジュールをインストールしても元のpythonディレクトリにはインストールされず~/MISO以下に導入される

$ pip list --format=legacy
pip (9.0.1)
python-dateutil (2.6.0)
virtualenv (15.1.0)

$ MISO/bin/pip list --format=legacy
cycler (0.10.0)
functools32 (3.2.3.post2)
matplotlib (2.0.2)
misopy (0.5.3)
numpy (1.13.0)
pip (9.0.1)
pyparsing (2.2.0)
pysam (0.11.2.2)
python-dateutil (2.6.0)
pytz (2017.2)
scipy (0.19.1)
setuptools (36.0.1)
six (1.10.0)
subprocess32 (3.2.7)
wheel (0.29.0)

ファイルの在処はここらしい。

ls MISO/lib/python2.7/site-packages/
_posixsubprocess.so
cycler-0.10.0.dist-info
cycler.py
cycler.pyc
dateutil
easy_install.py
easy_install.pyc
functools32
functools32-3.2.3.post2.dist-info
matplotlib
matplotlib-2.0.2-py2.7-nspkg.pth
matplotlib-2.0.2.dist-info
misopy
misopy-0.5.3.dist-info
mpl_toolkits
numpy
numpy-1.13.0.dist-info
pip
pip-9.0.1.dist-info
pkg_resources
pylab.py
pylab.pyc
pyparsing-2.2.0.dist-info
pyparsing.py
pyparsing.pyc
pysam
pysam-0.11.2.2.dist-info
pysplicing
python_dateutil-2.6.0.dist-info
pytz
pytz-2017.2.dist-info
scipy
scipy-0.19.1.dist-info
setuptools
setuptools-36.0.1.dist-info
six-1.10.0.dist-info
six.py
six.pyc
subprocess32-3.2.7.dist-info
subprocess32.py
subprocess32.pyc
wheel
wheel-0.29.0.dist-info

元の場所はここだった

$ ls /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
README				python_dateutil-2.6.0.dist-info
dateutil			setuptools
easy_install.pyo		virtualenv-15.1.0.dist-info
pip				virtualenv.py
pip-9.0.1.dist-info		virtualenv.pyc
pkg_resources			virtualenv_support

おもむろにMISO環境に突入

$ source MISO/bin/activate
(MISO) hogemac:~ hoge$

プロンプトの頭に(MISO)ってついた。
ちなみにMISO/bin/activateの中身は

# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly

deactivate () {
    unset -f pydoc >/dev/null 2>&1

    # reset old environment variables
    # ! [ -z ${VAR+_} ] returns true if VAR is declared at all
    if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
        PATH="$_OLD_VIRTUAL_PATH"
        export PATH
        unset _OLD_VIRTUAL_PATH
    fi
    if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
        PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
        export PYTHONHOME
        unset _OLD_VIRTUAL_PYTHONHOME
    fi

    # This should detect bash and zsh, which have a hash command that must
    # be called to get it to forget past commands.  Without forgetting
    # past commands the $PATH changes we made may not be respected
    if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
        hash -r 2>/dev/null
    fi

    if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
        PS1="$_OLD_VIRTUAL_PS1"
        export PS1
        unset _OLD_VIRTUAL_PS1
    fi

    unset VIRTUAL_ENV
    if [ ! "${1-}" = "nondestructive" ] ; then
    # Self destruct!
        unset -f deactivate
    fi
}

# unset irrelevant variables
deactivate nondestructive

VIRTUAL_ENV="/Users/hoge/MISO"
export VIRTUAL_ENV

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH

# unset PYTHONHOME if set
if ! [ -z "${PYTHONHOME+_}" ] ; then
    _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
    unset PYTHONHOME
fi

if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
    _OLD_VIRTUAL_PS1="$PS1"
    if [ "x" != x ] ; then
        PS1="$PS1"
    else
        PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1"
    fi
    export PS1
fi

# Make sure to unalias pydoc if it's already there
alias pydoc 2>/dev/null >/dev/null && unalias pydoc

pydoc () {
    python -m pydoc "$@"
}

# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands.  Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
    hash -r 2>/dev/null
fi

ちゃんとインストールされているだろうか?

(MISO) hogeMac:~ hoge$ miso
MISO (Mixture of Isoforms model)
Probabilistic analysis of RNA-Seq data for detecting differential isoforms
Use --help argument to view options.

Using MISO settings file: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/settings/miso_settings.txt
Error: Settings file /Users/hoge/MISO/lib/python2.7/site-packages/misopy/settings/miso_settings.txt does not exist.

MISO setting fileがないぞというエラーは出たが、とりあえずインストールされているらしい。


SAMtoolsのバージョンが0.xでないと動かないという噂もあるので

$ ls local/bin/samtools-0.1.19/
AUTHORS			bam_reheader.c		khash.h
COPYING			bam_rmdup.c		klist.h
ChangeLog.old		bam_rmdupse.c		knetfile.c
INSTALL			bam_sort.c		knetfile.h
Makefile		bam_stat.c		kprobaln.c
Makefile.mingw		bam_tview.c		kprobaln.h
NEWS			bam_tview.h		kseq.h
bam.c			bam_tview_curses.c	ksort.h
bam.h			bam_tview_html.c	kstring.c
bam.h~			bamshuf.c		kstring.h
bam2bcf.c		bamtk.c			misc
bam2bcf.h		bcftools		padding.c
bam2bcf_indel.c		bedcov.c		phase.c
bam2depth.c		bedidx.c		razf.c
bam_aux.c		bgzf.c			razf.h
bam_cat.c		bgzf.h			razip.c
bam_color.c		bgzip.c			sam.c
bam_endian.h		cut_target.c		sam.h
bam_import.c		errmod.c		sam_header.c
bam_index.c		errmod.h		sam_header.h
bam_lpileup.c		examples		sam_view.c
bam_mate.c		faidx.c			sample.c
bam_md.c		faidx.h			sample.h
bam_pileup.c		kaln.c			samtools.1
bam_plcmd.c		kaln.h			win32

ここに用意してみた。PATHを通すかスクリプトの該当箇所で明示的に指定してやる必要あると思う。
→別に1.4で問題ないみたい?

更にインストールがチャンとされているかのテスト

$ module_availability 
Checking availability of Python modules for MISO
Looking for required Python modules..
Checking for availability of: numpy
Checking for availability of: scipy
Checking for availability of: json
Checking for availability of: matplotlib
Traceback (most recent call last):
  File "/Users/hoge/MISO/bin/module_availability", line 11, in <module>
    sys.exit(main())
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/module_availability.py", line 60, in main
    check_module_availability(required_modules)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/module_availability.py", line 22, in check_module_availability
    import matplotlib.pyplot as plt
  File "/Users/hoge/MISO/lib/python2.7/site-packages/matplotlib/pyplot.py", line 115, in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
  File "/Users/hoge/MISO/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 32, in pylab_setup
    globals(),locals(),[backend_name],0)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/matplotlib/backends/backend_macosx.py", line 19, in <module>
    from matplotlib.backends import _macosx
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.

https://github.com/JuliaPy/PyCall.jl/issues/218
ここの書き込みに従って

$ nano .matplotlib/matplotlibrc

backend: TkAgg

$ module_availability 
Checking availability of Python modules for MISO
Looking for required Python modules..
Checking for availability of: numpy
Checking for availability of: scipy
Checking for availability of: json
Checking for availability of: matplotlib
Checking for availability of: pysam
All modules are available!
Looking for required executables..
Checking if samtools is available
  - samtools is available
Checking if bedtools is available
  - bedtools is available

通った!なんなんだ?
最後にMISOのテスト

$ python -m unittest discover misopy
Testing gene-level Psi...
Executing: python /Users/hoge/MISO/lib/python2.7/site-packages/misopy/index_gff.py --index /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/indexed
Indexing GFF...
  - GFF: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff
  - Outputting to: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/indexed
Traceback (most recent call last):
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/index_gff.py", line 199, in <module>
    main()
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/index_gff.py", line 191, in main
    compress_id=options.compress_id)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/index_gff.py", line 153, in index_gff
    gff_genes = gene_utils.load_genes_from_gff(gff_filename)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/Gene.py", line 878, in load_genes_from_gff
    reverse_recs=reverse_recs)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff_utils.py", line 191, in __init__
    include_introns=include_introns)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff_utils.py", line 201, in from_file
    FILE = open(filename, "r")
IOError: [Errno 2] No such file or directory: '/Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff'
Executing: python /Users/hoge/MISO/lib/python2.7/site-packages/misopy/run_events_analysis.py  --compute-genes-psi /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/indexed /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam --output-dir /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/gene-psi-output --read-len 36  --paired-end 250 30 --use-cluster
MISO (Mixture of Isoforms model)
To run MISO, please use "miso" instead.
.Testing single-end SE event interface...
Executing: python /Users/hoge/MISO/lib/python2.7/site-packages/misopy/run_events_analysis.py  --compute-events-psi se-sample /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-data/se-counts/se_test.counts --output-dir /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/SE-output --read-len 35 --overhang-len 4  --event-type SE --use-cluster 
MISO (Mixture of Isoforms model)
To run MISO, please use "miso" instead.
.Testing fr-unstranded...
Checking read  f_read  against  +
Checking read  f_read  against  -
Checking read  r_read  against  +
Checking read  r_read  against  -
Testing fr-firststrand...
.Testing conversion of SAM to BAM...
Executing: sam_to_bam --convert /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-data/sam-data/c2c12.Atp2b1.sam /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output
Converting SAM to BAM...
  - Executing: samtools view -Sbh /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-data/sam-data/c2c12.Atp2b1.sam  > /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.bam
[E::hts_open_format] fail to open file '/Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-data/sam-data/c2c12.Atp2b1.sam'
samtools view: failed to open "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-data/sam-data/c2c12.Atp2b1.sam" for reading: No such file or directory
Sorting BAM file...
  - Executing: samtools sort /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.bam /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted
[bam_sort] Use -T PREFIX / -o FILE to specify temporary and final output files
Usage: samtools sort [options...] [in.bam]
Options:
  -l INT     Set compression level, from 0 (uncompressed) to 9 (best)
  -m INT     Set maximum memory per thread; suffix K/M/G recognized [768M]
  -n         Sort by read name
  -o FILE    Write final output to FILE rather than standard output
  -T PREFIX  Write temporary files to PREFIX.nnnn.bam
      --input-fmt-option OPT[=VAL]
               Specify a single input file format option in the form
               of OPTION or OPTION=VALUE
  -O, --output-fmt FORMAT[,OPT[=VAL]]...
               Specify output format (SAM, BAM, CRAM)
      --output-fmt-option OPT[=VAL]
               Specify a single output file format option in the form
               of OPTION or OPTION=VALUE
      --reference FILE
               Reference sequence FASTA FILE [null]
  -@, --threads INT
               Number of additional threads to use [0]
Indexing BAM...
  - Executing: samtools index /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam
[E::hts_open_format] fail to open file '/Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam'
samtools index: failed to open "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam": No such file or directory
Conversion took 0.00 minutes.
FTesting gene-level Psi...
Testing GFF indexing of: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff
Executing: index_gff --index /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1/indexed
Indexing GFF...
  - GFF: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff
  - Outputting to: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1/indexed
Traceback (most recent call last):
  File "/Users/hoge/MISO/bin/index_gff", line 11, in <module>
    sys.exit(main())
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/index_gff.py", line 191, in main
    compress_id=options.compress_id)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/index_gff.py", line 153, in index_gff
    gff_genes = gene_utils.load_genes_from_gff(gff_filename)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/Gene.py", line 878, in load_genes_from_gff
    reverse_recs=reverse_recs)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff_utils.py", line 191, in __init__
    include_introns=include_introns)
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff_utils.py", line 201, in from_file
    FILE = open(filename, "r")
IOError: [Errno 2] No such file or directory: '/Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff'
Executing: miso --run /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1/indexed /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam --output-dir /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/gene-psi-output --read-len 36 
MISO (Mixture of Isoforms model)
Probabilistic analysis of RNA-Seq data for detecting differential isoforms
Use --help argument to view options.

Using MISO settings file: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/settings/miso_settings.txt
Error: Settings file /Users/hoge/MISO/lib/python2.7/site-packages/misopy/settings/miso_settings.txt does not exist.
.
======================================================================
FAIL: test_a_sam_to_bam (misopy.test_miso.TestMISO)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/test_miso.py", line 51, in test_a_sam_to_bam
    "c2c12.Atp2b1.sorted.bam")))
AssertionError

----------------------------------------------------------------------
Ran 5 tests in 1.618s

FAILED (failures=1)

案の定、エラーでまくる。
対処すべきポイントは以下だと思われる。

IOError: [Errno 2] No such file or directory: '/Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff'

[E::hts_open_format] fail to open file '/Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-data/sam-data/c2c12.Atp2b1.sam'

[E::hts_open_format] fail to open file '/Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam'
s

この辺のファイルが実際ない。pipからじゃなくてバイナリ版から該当ファイルをフォルダごとコピー。
すると

$ python -m unittest discover misopy
Testing gene-level Psi...
Executing: python /Users/hoge/MISO/lib/python2.7/site-packages/misopy/index_gff.py --index /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/indexed
Indexing GFF...
/Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff appears to already be indexed. Aborting.
Executing: python /Users/hoge/MISO/lib/python2.7/site-packages/misopy/run_events_analysis.py  --compute-genes-psi /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/indexed /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam --output-dir /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/gene-psi-output --read-len 36  --paired-end 250 30 --use-cluster
MISO (Mixture of Isoforms model)
To run MISO, please use "miso" instead.
.Testing single-end SE event interface...
Executing: python /Users/hoge/MISO/lib/python2.7/site-packages/misopy/run_events_analysis.py  --compute-events-psi se-sample /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-data/se-counts/se_test.counts --output-dir /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/SE-output --read-len 35 --overhang-len 4  --event-type SE --use-cluster 
MISO (Mixture of Isoforms model)
To run MISO, please use "miso" instead.
.Testing fr-unstranded...
Checking read  f_read  against  +
Checking read  f_read  against  -
Checking read  r_read  against  +
Checking read  r_read  against  -
Testing fr-firststrand...
.Testing conversion of SAM to BAM...
Executing: sam_to_bam --convert /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-data/sam-data/c2c12.Atp2b1.sam /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output
Converting SAM to BAM...
  - Executing: samtools view -Sbh /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-data/sam-data/c2c12.Atp2b1.sam  > /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.bam
Sorting BAM file...
  - Executing: samtools sort /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.bam /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted
[bam_sort] Use -T PREFIX / -o FILE to specify temporary and final output files
Usage: samtools sort [options...] [in.bam]
Options:
  -l INT     Set compression level, from 0 (uncompressed) to 9 (best)
  -m INT     Set maximum memory per thread; suffix K/M/G recognized [768M]
  -n         Sort by read name
  -o FILE    Write final output to FILE rather than standard output
  -T PREFIX  Write temporary files to PREFIX.nnnn.bam
      --input-fmt-option OPT[=VAL]
               Specify a single input file format option in the form
               of OPTION or OPTION=VALUE
  -O, --output-fmt FORMAT[,OPT[=VAL]]...
               Specify output format (SAM, BAM, CRAM)
      --output-fmt-option OPT[=VAL]
               Specify a single output file format option in the form
               of OPTION or OPTION=VALUE
      --reference FILE
               Reference sequence FASTA FILE [null]
  -@, --threads INT
               Number of additional threads to use [0]
Indexing BAM...
  - Executing: samtools index /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam
Conversion took 0.00 minutes.
.Testing gene-level Psi...
Testing GFF indexing of: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff
Executing: index_gff --index /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1/indexed
Indexing GFF...
/Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1.mm9.gff appears to already be indexed. Aborting.
Executing: miso --run /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1/indexed /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam --output-dir /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/gene-psi-output --read-len 36 
MISO (Mixture of Isoforms model)
Probabilistic analysis of RNA-Seq data for detecting differential isoforms
Use --help argument to view options.

Using MISO settings file: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/settings/miso_settings.txt
Computing Psi values...
  - GFF index: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1/indexed
  - BAM: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam
  - Read length: 36
  - Output directory: /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/gene-psi-output
Checking your GFF annotation and BAM for mismatches...
Checking if BAM has mixed read lengths...
Found reads of length 36 in BAM.
Mapping genes to their indexed GFF representation, using /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1/indexed
Searching for /Users/hoge/MISO/lib/python2.7/site-packages/misopy/gff-events/mm9/genes/Atp2b1/indexed/genes_to_filenames.shelve..
  - Found shelved file.
Preparing to run 1 batches of jobs...
Running batch of 1 genes..
  - Executing: python /Users/hoge/MISO/lib/python2.7/site-packages/misopy/run_miso.py --compute-genes-from-file "/Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/gene-psi-output/batch-genes/batch-0_genes.txt" /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/sam-output/c2c12.Atp2b1.sorted.bam /Users/hoge/MISO/lib/python2.7/site-packages/misopy/test-output/gene-psi-output --read-len 36  --overhang-len 1 --settings-filename /Users/hoge/MISO/lib/python2.7/site-packages/misopy/settings/miso_settings.txt
  - Submitted thread batch-0
Waiting on 1 threads...
.
----------------------------------------------------------------------
Ran 5 tests in 10.041s

OK

と、テスト解析は無事走りきるようになった。
次、実際の公開データで試してみるが、その前にヒトゲノムのGFFファイルを準備しないといけないはず。