cerebis / sim3C

Read-pair simulation of 3C-based sequencing methodologies (HiC, Meta3C, DNase-HiC)
GNU General Public License v3.0
19 stars 6 forks source link

problem in Installing sim3C #16

Closed sinamajidian closed 4 years ago

sinamajidian commented 4 years ago

Hi I want to use sim3C. So, based on the instruction I run the following on my mac

(base) sina@SMac HiC % pip install --user git+https://github.com/cerebis/sim3C
Collecting git+https://github.com/cerebis/sim3C
  Cloning https://github.com/cerebis/sim3C to /private/var/folders/3r/dqp_79yd2tzcw310frx28k240000gn/T/pip-req-build-df1bvgg0
  Running command git clone -q https://github.com/cerebis/sim3C /private/var/folders/3r/dqp_79yd2tzcw310frx28k240000gn/T/pip-req-build-df1bvgg0
Requirement already satisfied (use --upgrade to upgrade): sim3C==0.2 from git+https://github.com/cerebis/sim3C in /Users/sina/.local/lib/python3.7/site-packages
Requirement already satisfied: biopython in /Users/sina/.local/lib/python3.7/site-packages (from sim3C==0.2) (1.76)
Requirement already satisfied: intervaltree in /Users/sina/.local/lib/python3.7/site-packages (from sim3C==0.2) (3.0.2)
Requirement already satisfied: numba in /Users/sina/miniconda3/lib/python3.7/site-packages (from sim3C==0.2) (0.48.0)
Requirement already satisfied: numpy in /Users/sina/miniconda3/lib/python3.7/site-packages (from sim3C==0.2) (1.17.3)
Requirement already satisfied: scipy in /Users/sina/.local/lib/python3.7/site-packages (from sim3C==0.2) (1.4.1)
Requirement already satisfied: pyyaml in /Users/sina/miniconda3/lib/python3.7/site-packages (from sim3C==0.2) (5.3.1)
Requirement already satisfied: tqdm in /Users/sina/miniconda3/lib/python3.7/site-packages (from sim3C==0.2) (4.44.1)
Requirement already satisfied: sortedcontainers<3.0,>=2.0 in /Users/sina/.local/lib/python3.7/site-packages (from intervaltree->sim3C==0.2) (2.1.0)
Requirement already satisfied: llvmlite<0.32.0,>=0.31.0dev0 in /Users/sina/miniconda3/lib/python3.7/site-packages (from numba->sim3C==0.2) (0.31.0)
Requirement already satisfied: setuptools in /Users/sina/miniconda3/lib/python3.7/site-packages (from numba->sim3C==0.2) (46.1.3.post20200330)
Building wheels for collected packages: sim3C
  Building wheel for sim3C (setup.py) ... done
  Created wheel for sim3C: filename=sim3C-0.2-py3-none-any.whl size=1949321 sha256=230020d690c157a51180a3c3dd79105d18249b9fddae6b5333956844a9d8fcf7
  Stored in directory: /private/var/folders/3r/dqp_79yd2tzcw310frx28k240000gn/T/pip-ephem-wheel-cache-estdxi7f/wheels/74/80/3d/8b788e25f23a34a8782558ea17051ef6a5984f2bd20e011ca7
Successfully built sim3C

But when I run it, I face a problem

(base) sina@SMac HiC % sim3C
zsh: command not found: sim3C

This is my conda info

(base) sina@SMac sim3C-master % conda info 

     active environment : base
    active env location : /Users/sina/miniconda3
            shell level : 1
       user config file : /Users/sina/.condarc
 populated config files : 
          conda version : 4.8.3
    conda-build version : 3.18.11
         python version : 3.7.5.final.0
       virtual packages : __osx=10.15.1
       base environment : /Users/sina/miniconda3  (writable)
           channel URLs : https://repo.anaconda.com/pkgs/main/osx-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/osx-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /Users/sina/miniconda3/pkgs
                          /Users/sina/.conda/pkgs
       envs directories : /Users/sina/miniconda3/envs
                          /Users/sina/.conda/envs
               platform : osx-64
             user-agent : conda/4.8.3 requests/2.23.0 CPython/3.7.5 Darwin/19.0.0 OSX/10.15.1
                UID:GID : 501:20
             netrc file : None
           offline mode : False

I've heard that running pip in conda environment is not a good idea. Do you think that's the reason? or Should I add sth to path? Can I run the python code without installation?

PS.

I found that you mentioned it should be run on python 2.7. So, I deactivated the conda and use pip like this

sina@SMac ~ % python2.7 -m pip install --user git+https://github.com/cerebis/sim3C
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer mai
ntained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at http
s://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting git+https://github.com/cerebis/sim3C
  Cloning https://github.com/cerebis/sim3C to /private/var/folders/3r/dqp_79yd2tzcw310frx28k240000gn/T/pip-req-build-7Wgc3_
  Running command git clone -q https://github.com/cerebis/sim3C /private/var/folders/3r/dqp_79yd2tzcw310frx28k240000gn/T/pip-req-bu
ild-7Wgc3_
Requirement already satisfied (use --upgrade to upgrade): sim3C==0.2 from git+https://github.com/cerebis/sim3C in ./Library/Python/
2.7/lib/python/site-packages
Requirement already satisfied: biopython in ./Library/Python/2.7/lib/python/site-packages (from sim3C==0.2) (1.76)
Requirement already satisfied: intervaltree in ./Library/Python/2.7/lib/python/site-packages (from sim3C==0.2) (3.0.2)
Requirement already satisfied: numba in ./Library/Python/2.7/lib/python/site-packages (from sim3C==0.2) (0.47.0)
Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from sim3C==0.2) (1.8.0rc1)
Requirement already satisfied: scipy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from sim3C==0.2) (0.13.0b1)
Requirement already satisfied: pyyaml in ./Library/Python/2.7/lib/python/site-packages (from sim3C==0.2) (5.3.1)
Requirement already satisfied: tqdm in ./Library/Python/2.7/lib/python/site-packages (from sim3C==0.2) (4.45.0)
Requirement already satisfied: sortedcontainers<3.0,>=2.0 in ./Library/Python/2.7/lib/python/site-packages (from intervaltree->sim3C==0.2) (2.1.0)
Requirement already satisfied: funcsigs; python_version < "3.3" in ./Library/Python/2.7/lib/python/site-packages (from numba->sim3C==0.2) (1.0.2)
Requirement already satisfied: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from numba->sim3C==0.2) (41.0.1)
Requirement already satisfied: enum34; python_version < "3.4" in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from numba->sim3C==0.2) (1.1.6)
Requirement already satisfied: singledispatch; python_version < "3.4" in ./Library/Python/2.7/lib/python/site-packages (from numba->sim3C==0.2) (3.4.0.3)
Requirement already satisfied: llvmlite>=0.31.0dev0 in ./Library/Python/2.7/lib/python/site-packages (from numba->sim3C==0.2) (0.31.0)
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from singledispatch; python_version < "3.4"->numba->sim3C==0.2) (1.12.0)
Building wheels for collected packages: sim3C
  Building wheel for sim3C (setup.py) ... done
  Created wheel for sim3C: filename=sim3C-0.2-py2-none-any.whl size=1949321 sha256=5416e2513c8b11ec561a79d0b6e3a196b6da5a22e52b90cc2e1e7b3950dc47d7
  Stored in directory: /private/var/folders/3r/dqp_79yd2tzcw310frx28k240000gn/T/pip-ephem-wheel-cache-wgM3Pa/wheels/3e/08/b9/db0e763e62e60dac8df880ad0f70a430eb031ad042f2dfbcb0
Successfully built sim3C
sina@SMac ~ % sim3C
zsh: command not found: sim3C

When I check the pip list it is there

...
scipy                                  0.13.0b1
setuptools                             41.0.1  
sim3C                                  0.2    

When I go in to python 2.7. I can import sim3C

sina@SMac ~ % python2.7

Python 2.7.16 (default, Oct 17 2019, 17:14:30) 
[GCC 4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.32.4) (-macos10.15-objc-s on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sim3c
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named sim3c
>>> import sim3C
>>> 

It shows that sim3C is installed. But my question is How I can use it in Terminal?

cerebis commented 4 years ago

Hi Sina

Have you resolved your installation problem?

On Fri, 17 Apr 2020 at 11:17 pm, Sina Majidian notifications@github.com wrote:

Closed #16 https://github.com/cerebis/sim3C/issues/16.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cerebis/sim3C/issues/16#event-3244345649, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABN2PCY26TQVI2EECP7TMTTRNBJFDANCNFSM4MKPTLUQ .

sinamajidian commented 4 years ago

Thanks for your reply. No, but I've found the commit on Jul 25, 2019 containing the sim3c.py. It looks working.

cerebis commented 4 years ago

This warning can safely be ignored. It pertains to how the dependent Art.py module is used by sim3C and I should really change that to be a debug statement, rather than warning.

On Sun, 19 Apr 2020 at 14:08, Sina Majidian notifications@github.com wrote:

Thanks for your reply. No, but I've found the commit on Jul 25, 2019 containing the sim3c.py. It looks working. I've mentioned the reference genome and I'm facing with a warning.

sim3C.py --dist uniform -n 500000 -l 150 -e NlaIII -m hic simHap1.fasta sim.fastq ...

WARNING | 2020-04-19 08:21:36,897 | Art | No reference supplied, calls will have to supply a template

Would you please describe the warning? I can guess sim3c doesn't complain about the reference genome. I'm wondering whether there is an option in simulation for using HindIII or MboI enzyme?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cerebis/sim3C/issues/16#issuecomment-616023918, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABN2PC2G6TCV47BVAH4D4GTRNJ2NXANCNFSM4MKPTLUQ .

cerebis commented 4 years ago

To answer your original question, sim3C was indeed originally developed using Python 2.7. Since it is now 2020 and 2.7 is officially deprecated, other modules have changed to only >=3 support. This is where your installation problem is stemming.

One solution is to use my experimental Python 3 branch (named python3) but it is not thoroughly tested.

The other is to try installing again for Python 2.7. Since you raised this issue, I have added version constraints on the dependent modules to avoid pulling down the latest code which is no longer Python 2.7 compatible.

cerebis commented 4 years ago

To answer your original question, sim3C was indeed originally developed using Python 2.7. Since it is now 2020 and 2.7 is officially deprecated, other modules have changed to only >=3 support. This is where your installation problem is stemming.

One solution is to use my experimental Python 3 branch (named python3) but it is not thoroughly tested.

The other is to try installing again for Python 2.7. Since you raised this issue, I have added version constraints on the dependent modules to avoid pulling down the latest code which is no longer Python 2.7 compatible.

43e2ccfabf55f9ddb84754e9b29b8791d4bd34c0