Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extracting contact matrices from pairs file #243

Open
arodel21 opened this issue Jul 13, 2024 · 2 comments
Open

Extracting contact matrices from pairs file #243

arodel21 opened this issue Jul 13, 2024 · 2 comments

Comments

@arodel21
Copy link

arodel21 commented Jul 13, 2024

Hello, I am trying to extract the contact matrices from a 5000 bp resolution pairs file following the command

cooler cload pairs \
    -c1 2 -p1 3 -c2 4 -p2 5\
    $CHRSIZES:5000 \
    $AUX.test.nodups.pairs.gz \
    $AUX.test.grcz11.5000.cool

But I get this error

Traceback (most recent call last):
  File "/package/python-cbrg/current/3.11/bin/cooler", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/package/python-cbrg/current/3.11/lib/python3.11/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/package/python-cbrg/current/3.11/lib/python3.11/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/package/python-cbrg/current/3.11/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/package/python-cbrg/current/3.11/lib/python3.11/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/package/python-cbrg/current/3.11/lib/python3.11/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/package/python-cbrg/current/3.11/lib/python3.11/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/package/python-cbrg/current/3.11/lib/python3.11/site-packages/cooler/cli/cload.py", line 551, in pairs
    f_in = get_handle(pairs_path, mode='r', compression='infer')[0]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'IOHandles' object is not subscriptable

I think it happens because the pairs file is too big (248MB) because I have managed to get the cool files from smaller files successfully.

Could you please tell me if there is an alternative way of doing this?

Thanks in advance.

@nvictus
Copy link
Member

nvictus commented Jul 14, 2024

I think you're version of cooler is old and out of sync with pandas. Try pip install -U cooler.

@arodel21
Copy link
Author

@nvictus This worked! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants