-
Notifications
You must be signed in to change notification settings - Fork 51
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
Error when running cooltools random-sample #541
Comments
Yes indeed, I think that's the problem. If you can add it yourself, that should solve it. |
Thank you! Indeed one could do this, right?
I can submit a PR to handle this corner case if it is useful. Our mcool files have been generated with |
Indeed this could be the reason! I am not sure off the top of my head whether this would actually store the value in the file... @nvictus ? |
In the end, my solution was a bit more complicated, as def addSum_mcool(mcool_file, out_file):
clr = cl.Cooler(mcool_file)
c_sum = clr.pixels()[:]["count"].sum()
metadata = dict()
metadata["sum"] = int(c_sum)
for key, value in clr.info.items():
if isinstance(value, np.int64):
metadata[key] = int(value)
else:
metadata[key] = value
print("Sum of the matrix: ", metadata["sum"])
pixel_mat = clr.pixels()[:]
bins = clr.bins()[:]
cl.create_cooler(out_file, bins=bins, pixels=pixel_mat, metadata=metadata) |
Hi, thank you for the amazing tool.
I am encountering this error when downsampling a cool file, I was wondering if you could help me debug this.
I am running:
And I get:
I checked the output of
cooler info
and indeed there is not asum
field. Is that the problem? Should I generate one to make it work?The text was updated successfully, but these errors were encountered: