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

'Circos.initialize_from_matrix' running error: x is invalid range of sector. #27

Closed
qijt123 opened this issue Jun 12, 2023 · 2 comments
Closed
Labels
question Further information is requested

Comments

@qijt123
Copy link

qijt123 commented Jun 12, 2023

When I run the 'Circos.initialize_from_matrix' function, I get an error. The error is as follows:

ValueError: x=0.6189621949302285 is invalid range of 'stroma' sector.
Sector = 'stroma'
Size = 0.6189621949302284 (0 - 0.6189621949302284)
Radian size = 0.64 (-4.63 - -3.98)
Degree size = 36.69 (-265.00 - -228.31)

@moshi4
Copy link
Owner

moshi4 commented Jun 12, 2023

Hi @qijt123

It appears that the error is occurring because the sector size should be 0.6189621949302285, but due to a rounding error in the floating point number it is 0.6189621949302284.

The maximum number of decimal digits that can be accurately stored in floating point numbers in python is 15, so if you truncate the number of decimal digits in the matrix to 15 or less beforehand, it should work correctly.

@qijt123
Copy link
Author

qijt123 commented Jun 12, 2023

Hi, @moshi4
Thank you very much for your reply. Your answer perfectly solved my problem.

@moshi4 moshi4 closed this as completed Jun 12, 2023
@moshi4 moshi4 added the question Further information is requested label May 3, 2024
@moshi4 moshi4 mentioned this issue May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants