Can't append new data to existing cool file. #405
-
Hello! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This code snippet can illustrate the issue: new_pixels=pd.DataFrame({'bin1_id':[1],'bin2_id':[1],'count':[2]}) clr = cooler.Cooler('test.cool') the output is [[0. 0.][0. 2.]] the old data( pixels=pd.DataFrame({'bin1_id':[0],'bin2_id':[1],'count':[1]}) ) can't fetch. |
Beta Was this translation helpful? Give feedback.
-
It's not meant to be used that way.
def iter_pixels():
...
yield chunk1
...
yield chunk2
...
cooler.create_cooler('test.cool', bins=bins, pixels=iter_pixels(), dtypes={'count': 'float64'})
cooler.create_cooler('test1.cool', bins=bins, pixels=pixels1, dtypes={'count': 'float64'})
cooler.create_cooler('test2.cool', bins=bins, pixels=pixels2, dtypes={'count': 'float64'})
cooler.merge_coolers('test.cool', ['test1.cool', 'test2.cool']) |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response. This answer truly resolved my issue. |
Beta Was this translation helpful? Give feedback.
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:cooler.create_cooler
, like a generator, e.g.: