Skip to content

Can't append new data to existing cool file. #405

Answered by nvictus
1944498970 asked this question in Q&A
Discussion options

You must be logged in to vote

It's not meant to be used that way. a mode allows you to insert a complete cooler data collection (i.e. contact matrix) into a file with other cooler data collections. To build a single data collection incrementally, you can either:

  1. Provide any sort of iterator of dataframes to cooler.create_cooler, like a generator, e.g.:
def iter_pixels():
    ...
    yield chunk1
    ...
    yield chunk2
    ...

cooler.create_cooler('test.cool', bins=bins, pixels=iter_pixels(), dtypes={'count': 'float64'})
  1. Create separate cooler data collections, and then merge them.
cooler.create_cooler('test1.cool', bins=bins, pixels=pixels1, dtypes={'count': 'float64'})
cooler.create_cooler('test2.cool', bins=bins

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by nvictus
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #403 on March 12, 2024 00:16.