Skip to content
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
24f696d
Initial commit for the tools "Molecular Design by Reverse Engineering"
Anthony96pi Jun 1, 2026
6b3b36e
Initial commit for the tools "Molecular Design by Reverse Engineering"
Anthony96pi Jun 1, 2026
d288426
Add ECFP input
Anthony96pi Jul 30, 2026
dce534e
Resolve Lint Python scripts (3.11) errors
Anthony96pi Jul 30, 2026
268d3ba
Resolve Lint tool-list (3.11) errors
Anthony96pi Jul 30, 2026
21ebe5e
Resolve Lint tool-list (3.11) errors
Anthony96pi Jul 30, 2026
5438387
Resolve Lint tool-list (3.11) errors : add long_description
Anthony96pi Aug 4, 2026
56eac2e
Resolve Lint tool-list (3.11) errors : Check file sizes
Anthony96pi Sep 14, 2026
dac8ea0
iuc owner correction
Anthony96pi Sep 14, 2026
41b5188
tool name correction
Anthony96pi Sep 14, 2026
61d307d
indentation expand correction
Anthony96pi Sep 14, 2026
fc91af0
comment place order Reference alphabet files pathway
Anthony96pi Sep 28, 2026
9d84e9c
Remove display="radio" from select params for UI consistency
Anthony96pi Sep 29, 2026
90cc273
Remove ECFP vector input type, move preloaded examples to help section
Anthony96pi Oct 6, 2026
6143e96
Fix outdated conditional in test section
Anthony96pi Oct 6, 2026
cc9d8b6
feat(pipeline): optional alphabet update from input
Anthony96pi Oct 12, 2026
3925d81
Add SMILES input validation
Anthony96pi Oct 12, 2026
053e7e9
Resolve lint erreor
Anthony96pi Oct 12, 2026
a23935d
Resolve lint erreor
Anthony96pi Oct 12, 2026
587e966
Add version column to molsig_alphabets data table
Anthony96pi Oct 13, 2026
c450914
Fix .loc tab separators and table config indentation
Anthony96pi Oct 13, 2026
17a434d
Re-trigger Lint tool-list (Zenodo was unreachable)
Anthony96pi Oct 13, 2026
ac9b8f7
Re-trigger Lint tool-list (Zenodo was unreachable)
Anthony96pi Oct 16, 2026
41aa70b
Convert .shed.yml to suite with auto tool repositories
Anthony96pi Nov 16, 2026
9c71952
Re-trigger CI
Anthony96pi Nov 16, 2026
6ed68e7
molecule-signature: pin rdkit to 2026.03.2
Anthony96pi Nov 16, 2026
4f86b44
add xref to bio.tools
Anthony96pi Nov 27, 2026
326943a
Add data manager for molsig alphabets
Anthony96pi Nov 27, 2026
c46e7f7
Align shed name with folder name
Anthony96pi Nov 27, 2026
fbfbd47
Add version_command
Anthony96pi Nov 27, 2026
fb2818e
Pass inputs through a JSON configfile and a wrapper script.
Anthony96pi Nov 27, 2026
d88af0c
Convert tool help to Markdown
Anthony96pi Nov 27, 2026
8630c8e
Resolve Lint errors
Anthony96pi Nov 27, 2026
2fe4550
Fix data manager output path and test table conf
bernt-matthias Nov 27, 2026
11fbe1b
Generate data table row from a configfile in the fetcher wrapper
bernt-matthias Nov 27, 2026
56ee75f
molecule-signature: stop the parameter sanitizer from rewriting SMILES
bernt-matthias Nov 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tools/molecule-signature/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
categories:
- Synthetic Biology
description: De Novo Molecular Design by Reverse Engineering Fingerprints
name: molsig
Comment thread
bernt-matthias marked this conversation as resolved.
Resolved
owner: iuc
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/main/tools/molecule-signature
homepage_url: https://github.com/brsynth/molecule-signature
long_description: The algorithm uses an alphabet of small molecular environments — chemical Lego bricks. It searches for combinations whose summed fingerprint exactly matches the input ECFP, formulated as a system of linear Diophantine equations. Once compatible fragment combinations are found, the method reconnects them into chemically valid molecular graphs.
type: unrestricted
auto_tool_repositories:
name_template: "{{ tool_id }}"
description_template: "Wrapper for molsig: {{ tool_name }}."
suite:
name: "suite_molsig"
description: "A suite of tools that brings molecule-signature (molsig) into Galaxy."
long_description: |
The algorithm uses an alphabet of small molecular environments — chemical Lego bricks. It searches for combinations whose summed fingerprint exactly matches the input ECFP, formulated as a system of linear Diophantine equations. Once compatible fragment combinations are found, the method reconnects them into chemically valid molecular graphs.
126 changes: 126 additions & 0 deletions tools/molecule-signature/molecule-signature.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<tool id="molsig" name="Molecule signature" version="0.1.0+galaxy0" python_template_version="3.5" profile="21.05">
Comment thread
bernt-matthias marked this conversation as resolved.
Resolved
<macros>
<xml name="alphabet_selector_block">
Comment thread
bernt-matthias marked this conversation as resolved.
Resolved
<param name="alphabet_selector" type="select" label="Alphabet:" >

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation is off here.

If we add a tool with a data table then we should maybe also add a data manager. The tool will be auto installed on usegalaxy.eu, without a data manager reference data would need to be installed manually be the admins. This will likely not happen without a data manager (and with one we could even automatize https://github.com/galaxyproject/idc/), i.e. usegalaxy would end up with a non-functional tool.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We chose .loc files instead of a data manager on Björn's advice, since the alphabet files should not change. That's why we went with this setup.

I've never worked with data managers, but I understand the benefits they offer. I'll look into it to see if this is a feasible option that can be implemented quickly without having to start from scratch.
I don't have much time left for this project.

For your information, it's intended for a specific instance on usegalaxy.fr

<options from_data_table="molsig_alphabets">
<column name="value" index="0"/>
<column name="name" index="1"/>
<column name="version" index="2"/>
<column name="path" index="3"/>
</options>
</param>
</xml>

<xml name="smiles_checks">
<sanitizer>
<valid initial="string.ascii_letters,string.digits">
<add value="@+-[]()=#:/\.%*"/>
</valid>
</sanitizer>
<validator type="regex" message="Not a valid SMILES: only letters, digits and @ + - [ ] ( ) = # : / \ . % * are allowed.">^[A-Za-z0-9@+\-\[\]()=#:/\\.%*]+$</validator>
Comment thread
bernt-matthias marked this conversation as resolved.
Resolved
</xml>
</macros>

<requirements>
<requirement type="package" version="2.1.1">molecule-signature</requirement>
<requirement type="package" version="2026.03.2">rdkit</requirement>
</requirements>

Comment thread
bernt-matthias marked this conversation as resolved.
Resolved
<command detect_errors="exit_code"><![CDATA[
#if $incl_input_alf=="true"
Comment thread
bernt-matthias marked this conversation as resolved.
Resolved
python3 '$__tool_directory__/static/update_alphabet.py' '$alphabet_selector.fields.path' updated_alphabet.npz '$input_text' &&
Comment thread
bernt-matthias marked this conversation as resolved.
Resolved

#else
ln -s '$alphabet_selector.fields.path' updated_alphabet.npz &&

#end if

molsig enumerate --smiles '$input_text' --alphabet updated_alphabet.npz --output analogues_smiles.tsv
]]></command>

<inputs>
<!-- Modèle SMILES en entrée -->

<param name="input_text" type="text" optional="false" label="Smiles entry :">
<help><![CDATA[Examples: Phenazinol <code>C1=CC=C2C(=C1)N=C3C=CC=C(C3=N2)O</code>, Linoleic acid <code>CCCCC/C=C/C/C=C/C/C=C/C/C=C/CCCCC(=O)O</code>]]></help>
<expand macro="smiles_checks"/>
</param>


<expand macro="alphabet_selector_block"/>

<param name="incl_input_alf" type="boolean" truevalue="true" falsevalue="false" checked="true"
label="Include input molecule in alphabet (recommended for molecular design)"/>

</inputs>
<outputs>
<data name="analogues_smiles" format="tsv" from_work_dir="analogues_smiles.tsv" />
</outputs>
<tests>
<test>
<param name="input_text" value="C1=CC=C2C(=C1)N=C3C=CC=C(C3=N2)O"/>
<param name="incl_input_alf" value="true"/>
Comment thread
bernt-matthias marked this conversation as resolved.
Resolved
<param name="alphabet_selector" value="metanetx"/>
<output name="analogues_smiles" file="output/Galaxy1-[Molecular Design by Reverse Engineering].tsv" compare="sim_size"/>
Comment thread
bernt-matthias marked this conversation as resolved.
Resolved
</test>
</tests>

<help><![CDATA[
Comment thread
bernt-matthias marked this conversation as resolved.
Resolved
**De Novo Molecular Design by Reverse Engineering Fingerprints**

**❔ How to use ?**

**SMILES** *(Compute the ECFP from molecule)*

-Example: *CCO* or *c1ccccc1*

Ready-to-copy SMILES examples:

- Phenazinol : ``C1=CC=C2C(=C1)N=C3C=CC=C(C3=N2)O``
- Linoleic Acid : ``CCCCC/C=C/C/C=C/C/C=C/C/C=C/CCCCC(=O)O``
- Ursolic Acid : ``C[C@@H]1CC[C@@]2(CC[C@@]3(C(=CC[C@H]4[C@]3(CC[C@@H]5[C@@]4(CC[C@@H](C5(C)C)O)C)C)[C@@H]2[C@H]1C)C)C(=O)O``
- Orlistat : ``CCCCCCCCCCC[C@@H](C[C@H]1[C@@H](C(=O)O1)CCCCCC)OC(=O)C(CC(C)C)NC=O``

⟹ Find out more about SMILES: `Wikipedia - SMILES <https://en.wikipedia.org/wiki/Simplified_Molecular_Input_Line_Entry_System>`_

**Alphabet**::

-MetaNetX (Biology) – 227,717 fragments from 206,338 molecules
-eMolecules (Comerciales) – 570,421 fragments from 5 million molecules
-ChEMBL (Drug-like) – 712,244 fragments from 1,907,613 molecules
-DrugBank (Drugs) – 40,138 fragments from 9,516 molecules


.. class:: infomark

**How does the method work?**

Extended-Connectivity Fingerprints (**ECFPs**) are widely used molecular vectorizations in cheminformatics. They encode local atomic environments into numerical vectors and are commonly used for **QSAR/QSPR**, similarity search, virtual screening, and machine-learning models that predict molecular activities or properties.

Here, we address the inverse problem. Instead of starting from a molecule to predict properties, we start from a fingerprint and ask whether other molecular structures can produce exactly the same ECFP. Such molecules can be seen as fingerprint analogues and may share similar predicted properties in models relying on this representation.

The algorithm uses an **alphabet** of small molecular environments — chemical **Lego bricks**. It searches for combinations whose summed fingerprint exactly matches the input ECFP, formulated as a system of **linear Diophantine equations**. Once compatible fragment combinations are found, the method reconnects them into chemically valid molecular graphs.

.. class:: warningmark

In our experiments, ~91.3% of cases yield no analogue. ECFP collisions are rare, so requiring identical fingerprints imposes a very strong constraint on the molecular space.

Reference alphabet files (ChEMBL, DrugBank, eMolecules, MetaNetX) must be
installed by a Galaxy admin and referenced in tool-data/molsig_alphabets.loc.
Files are available at: https://zenodo.org/records/22691018

----

**Tool source code**: `GitHub - molecule-signature <https://github.com/brsynth/molecule-signature>`_

**Attribution**

This tool is part of the PEPR Bioproductions (B-BEST) program, supported by the France 2030 investment plan via the French National Research Agency (ANR) and co-led by INRAE and IFPEN [ANR-22-PEBB-0008].

]]></help>
<citations>
<citation type="doi">
10.1186/s13321-025-01074-5
</citation>
</citations>
</tool>
26 changes: 26 additions & 0 deletions tools/molecule-signature/static/update_alphabet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import sys

from molsig.enumerate_utils import get_first_stereoisomer
from molsig.SignatureAlphabet import (load_alphabet, merge_alphabets, SignatureAlphabet)
from rdkit import Chem

RADIUS = 2
NBITS = 2048
USE_STEREO = True

alphabet_path = sys.argv[1]
output_path = sys.argv[2]
smiles_0 = sys.argv[3]

Alphabet = load_alphabet(alphabet_path)

mol = Chem.MolFromSmiles(smiles_0)
if mol is None:
sys.exit(f"SMILES is not validated by rdkit: {smiles_0}")
smiles = get_first_stereoisomer(smiles_0)

Alphabet_mol = SignatureAlphabet(radius=RADIUS, nBits=NBITS, use_stereo=USE_STEREO)
Alphabet_mol.fill([smiles], verbose=False)
Alphabet = merge_alphabets(Alphabet, Alphabet_mol)

Alphabet.save(output_path)
Binary file not shown.
5 changes: 5 additions & 0 deletions tools/molecule-signature/test-data/molsig_alphabets.loc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#value name version path
metanetx MetaNetX (test) 1.0 ${__HERE__}/mini_metanetx_alphabet.npz
emolecules eMolecules (test) 1.0 ${__HERE__}/mini_metanetx_alphabet.npz
chembl ChEMBL (test) 1.0 ${__HERE__}/mini_metanetx_alphabet.npz
drugbank DrugBank (test) 1.0 ${__HERE__}/mini_metanetx_alphabet.npz
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SMILES
Oc1cccc2nc3ccccc2nc13
Oc1ccccc2nc3cccc3nc12
Oc1cccc2nc3ccccc3nc12
Oc1ccccc2nc3cccc2nc13
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
]1341;command_started;command=7072696e7466202723205265666572656e636520616c7068616265742066696c657320666f7220746865206d6f6c73696720746f6f6c2e5c6e27# Reference alphabet files for the molsig tool.
# Download the real .npz files from: https://zenodo.org/records/22691018
# Then edit the paths below to point to where you stored them on this instance.
#value name version path
#chembl ChEMBL alphabet 1.0 /path/to/chembl_alphabet.npz
#drugbank DrugBank alphabet 1.0 /path/to/drugbank_alphabet.npz
#emolecules eMolecules alphabet 1.0 /path/to/emolecules_alphabet.npz
#metanetx MetaNetX alphabet 1.0 /path/to/metanetx_alphabet.npz
6 changes: 6 additions & 0 deletions tools/molecule-signature/tool_data_table_conf.xml.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<tables>
<table name="molsig_alphabets" comment_char="#">
<columns>value, name, version, path</columns>
<file path="tool-data/molsig_alphabets.loc" />
</table>
</tables>
6 changes: 6 additions & 0 deletions tools/molecule-signature/tool_data_table_conf.xml.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<tables>
<table name="molsig_alphabets" comment_char="#">
<columns>value, name, version, path</columns>
<file path="${__HERE__}/test-data/molsig_alphabets.loc" />
</table>
</tables>
Loading