-
Notifications
You must be signed in to change notification settings - Fork 27
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
command-line tool #53
Comments
Hi Francois,
Feel free to close the issue if it answers your question. Hope this helps, |
Thanks, I'll give it a try. |
Sometimes, I would like mols2grid to just be able to visualize some molecules in a browser. |
If you know mview from chemaxon, than that's what I'd like but in open-source. |
I had written one in the past, as you suggested, but it is now broken: mols2grid.save(mols, output='caff.html', template="table", prerender=True) Gives me: ---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In [4], line 1
----> 1 mols2grid.save(mols, output='caff.html', template="table", prerender=True)
File ~/usr/miniconda/lib/python3.11/functools.py:909, in singledispatch.<locals>.wrapper(*args, **kw)
905 if not args:
906 raise TypeError(f'{funcname} requires at least '
907 '1 positional argument')
--> 909 return dispatch(args[0].__class__)(*args, **kw)
File ~/usr/miniconda/lib/python3.11/site-packages/mols2grid/dispatch.py:298, in _(mols, **kwargs)
294 @save.register(Series)
295 @save.register(list)
296 @save.register(tuple)
297 def _(mols, **kwargs):
--> 298 template, kwargs, render_kwargs = _prepare_kwargs(kwargs, "save")
299 output = kwargs.pop("output")
300 return MolGrid.from_mols(mols, **kwargs).save(
301 output, template=template, **render_kwargs
302 )
File ~/usr/miniconda/lib/python3.11/site-packages/mols2grid/dispatch.py:24, in _prepare_kwargs(kwargs, kind)
20 """Separate kwargs for the init and render methods of MolGrid"""
21 template = kwargs.pop("template", _SIGNATURE["render"]["template"].default)
22 render_kwargs = {
23 param: kwargs.pop(param, sig.default)
---> 24 for param, sig in _SIGNATURE[f"to_{template}"].items()
25 }
26 if kind == "display":
27 render_kwargs.update(
28 {
29 param: kwargs.pop(param, sig.default)
30 for param, sig in _SIGNATURE["display"].items()
31 }
32 )
KeyError: 'to_table' |
Software that was working in the past, but doesn't anymore makes me feel very sad. |
For the
For the CLI, yeah I can see some use case for it, but I have some other priorities for this package and rarely enough time to spare unfortunately. I remember you opening PR #54, apologies for not giving feedback on that. If you're still up for it I can make some suggestions and guide you to integrate it as an actual CLI tool. |
I could repair molenc_mview.py, thanks! |
Hello,
Is there a way to have a command-line tool for this use case:
I am not under jupyter or what not.
My input files are either .sdf, .mol2 or .smi (and in a SMILES file, the SMILES string are the first field/column).
Thanks a lot,
Francois.
The text was updated successfully, but these errors were encountered: