Laboratoire-de-Chemoinformatique / Synt-On

Open-source tool for synthons-based library design.
BSD 3-Clause "New" or "Revised" License
64 stars 23 forks source link

Unable to raise stack size resource limit #2

Closed ljmartin closed 2 years ago

ljmartin commented 2 years ago

Hi SynthI, really cool library and congrats on the nice publication.

I'm unable to run the scripts as written due to this line:

https://github.com/Laboratoire-de-Chemoinformatique/SynthI/blob/63cdc183f2db414374e07f347f0dbc2fa8704cd9/src/SynthI.py#L638

On my machine (MacOS 11.2.3, conda, Python 3.9.7), any script using one of the functions with that line returns:

Traceback (most recent call last):
  File "/Users/ljmartin/Documents/programs/SynthI/src/gensynth.py", line 6, in <module>
    frag = fragmentation(fragmentationMode="use_all", maxNumberOfReactionCentersPerFragment=3,
  File "/Users/ljmartin/Documents/programs/SynthI/src/SynthI.py", line 638, in __init__
    resource.setrlimit(resource.RLIMIT_STACK, [0x100 * max_rec, resource.RLIM_INFINITY])
ValueError: not allowed to raise maximum limit

Seems to work fine if I just comment those lines out - but how important is it to raise that limit? At what numbers of compounds might it become an issue? Thanks

YulianaZabolotna commented 2 years ago

Hello!

Thank you for your comment. I am working on Linux, so I was not aware of such an issue with MAC.

I needed to raise the limit because I fragment molecules recursively till the available BBs are found (or till the smallest possible synthons if no BBs library is given). So it is actually not the question of the number of compounds, but rather their size - if you work with large molecules that can be fragmented by a lot of different synthetic paths you can have a problem.

Could you, please, try using SynthI on your system with those lines being commented and let me know if it works with your dataset. I will try to find a Mac from one of my colleagues and find some permanent solution, but this might take some time.

Thanks

ljmartin commented 2 years ago

Ah, I see - it works fine for me with those lines commented out. However, I was not using large molecules. I could process a building block library, and fragment molecules that were made up of a maximum of three building blocks - I didn't try any larger. Thanks