aidenlab / straw

Extract data quickly from Juicebox via straw
MIT License
62 stars 36 forks source link

the error of test data #56

Closed ningwei-wei closed 3 years ago

ningwei-wei commented 3 years ago

hi, when i use straw , it has some problems. i used your test data

import straw
result = straw.straw('NONE', 'test.hic', 'X', 'X', 'BP', 1000000)
for i in range(len(result)):
    print("{0}\t{1}\t{2}".format(result[i].binX, result[i].binY, result[i].counts))

the error is

Traceback (most recent call last):
  File "test2.py", line 5, in <module>
    result = straw.straw('NONE', 'test.hic', 'X', 'X', 'BP', 100000)
TypeError: __init__() takes from 2 to 3 positional arguments but 7 were given

can you help me to solve it?

sa501428 commented 3 years ago

Hi @ningwei-wei, How did you install the package? Are you using pip or did you install from source?

ningwei-wei commented 3 years ago

i Clone the library and cd into the straw/ directory. then pip install ./python

Processing ./python
Requirement already satisfied: requests in /slst/home/ningwei/anaconda3/envs/mustache/lib/python3.8/site-packages (from hic-straw==0.0.8) (2.23.0)
Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /slst/home/ningwei/anaconda3/envs/mustache/lib/python3.8/site-packages (from requests->hic-straw==0.0.8) (1.25.8)
Requirement already satisfied: idna<3,>=2.5 in /slst/home/ningwei/anaconda3/envs/mustache/lib/python3.8/site-packages (from requests->hic-straw==0.0.8) (2.9)
Requirement already satisfied: chardet<4,>=3.0.2 in /slst/home/ningwei/anaconda3/envs/mustache/lib/python3.8/site-packages (from requests->hic-straw==0.0.8) (3.0.4)
Requirement already satisfied: certifi>=2017.4.17 in /slst/home/ningwei/anaconda3/envs/mustache/lib/python3.8/site-packages (from requests->hic-straw==0.0.8) (2019.11.28)
Building wheels for collected packages: hic-straw
  Building wheel for hic-straw (setup.py) ... done
  Created wheel for hic-straw: filename=hic_straw-0.0.8-py3-none-any.whl size=10275 sha256=fd32267f7533be8a72db304d56c798491a7280b28640b767331fd03117dfe6e7
  Stored in directory: /tmp/pip-ephem-wheel-cache-u7yw6qo3/wheels/34/f1/01/e65f8c164a13e638d9555fe80d8329dc8580df4e10118dbe99
Successfully built hic-straw
Installing collected packages: hic-straw
  Attempting uninstall: hic-straw
    Found existing installation: hic-straw 0.0.8
    Uninstalling hic-straw-0.0.8:
      Successfully uninstalled hic-straw-0.0.8
Successfully installed hic-straw-0.0.8
sa501428 commented 3 years ago

The python branch has a newer usage (which we are eventually planning to transition towards). You can see it in the readme of that folder: https://github.com/aidenlab/straw/blob/master/python/README.md#examples

For the older style usage, you can install from the pybind11_python folder.