pairtools icon indicating copy to clipboard operation
pairtools copied to clipboard

Extracting contact matrices from pairs file

Open arodel21 opened this issue 7 months ago • 2 comments

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.

arodel21 avatar Jul 13 '24 22:07 arodel21