Repository navigation
Molecule signature #8252
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
Open
Anthony96pi
wants to merge
36
commits into
galaxyproject:main
Choose a base branch
from
Anthony96pi:molecule-signature
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Molecule signature #8252
Changes from 8 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 6b3b36e
Initial commit for the tools "Molecular Design by Reverse Engineering"
Anthony96pi d288426
Add ECFP input
Anthony96pi dce534e
Resolve Lint Python scripts (3.11) errors
Anthony96pi 268d3ba
Resolve Lint tool-list (3.11) errors
Anthony96pi 21ebe5e
Resolve Lint tool-list (3.11) errors
Anthony96pi 5438387
Resolve Lint tool-list (3.11) errors : add long_description
Anthony96pi 56eac2e
Resolve Lint tool-list (3.11) errors : Check file sizes
Anthony96pi dac8ea0
iuc owner correction
Anthony96pi 41b5188
tool name correction
Anthony96pi 61d307d
indentation expand correction
Anthony96pi fc91af0
comment place order Reference alphabet files pathway
Anthony96pi 9d84e9c
Remove display="radio" from select params for UI consistency
Anthony96pi 90cc273
Remove ECFP vector input type, move preloaded examples to help section
Anthony96pi 6143e96
Fix outdated conditional in test section
Anthony96pi cc9d8b6
feat(pipeline): optional alphabet update from input
Anthony96pi 3925d81
Add SMILES input validation
Anthony96pi 053e7e9
Resolve lint erreor
Anthony96pi a23935d
Resolve lint erreor
Anthony96pi 587e966
Add version column to molsig_alphabets data table
Anthony96pi c450914
Fix .loc tab separators and table config indentation
Anthony96pi 17a434d
Re-trigger Lint tool-list (Zenodo was unreachable)
Anthony96pi ac9b8f7
Re-trigger Lint tool-list (Zenodo was unreachable)
Anthony96pi 41aa70b
Convert .shed.yml to suite with auto tool repositories
Anthony96pi 9c71952
Re-trigger CI
Anthony96pi 6ed68e7
molecule-signature: pin rdkit to 2026.03.2
Anthony96pi 4f86b44
add xref to bio.tools
Anthony96pi 326943a
Add data manager for molsig alphabets
Anthony96pi c46e7f7
Align shed name with folder name
Anthony96pi fbfbd47
Add version_command
Anthony96pi fb2818e
Pass inputs through a JSON configfile and a wrapper script.
Anthony96pi d88af0c
Convert tool help to Markdown
Anthony96pi 8630c8e
Resolve Lint errors
Anthony96pi 2fe4550
Fix data manager output path and test table conf
bernt-matthias 11fbe1b
Generate data table row from a configfile in the fetcher wrapper
bernt-matthias 56ee75f
molecule-signature: stop the parameter sanitizer from rewriting SMILES
bernt-matthias File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| categories: | ||
| - Synthetic Biology | ||
| description: De Novo Molecular Design by Reverse Engineering Fingerprints | ||
| name: molsig | ||
| owner: anthony96p | ||
|
Anthony96pi marked this conversation as resolved.
Resolved
|
||
| 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. | ||
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import sys | ||
|
|
||
| from molsig.enumerate_signature import enumerate_molecule_from_morgan | ||
| from molsig.SignatureAlphabet import load_alphabet | ||
|
|
||
| ecfp_text, alphabet_path, output_path = sys.argv[1], sys.argv[2], sys.argv[3] | ||
|
|
||
| for token in ("__ob__", "__cb__", "__oc__", "__cc__", "[", "]", "{", "}"): | ||
| ecfp_text = ecfp_text.replace(token, "") | ||
| ecfp_vector = [int(x) for x in ecfp_text.replace(",", " ").split()] | ||
|
|
||
| alphabet = load_alphabet(alphabet_path) | ||
| Ssig, Smol, Nsig, thresholds_reached, computational_times = enumerate_molecule_from_morgan( | ||
| ecfp_vector, alphabet | ||
| ) | ||
|
|
||
| with open(output_path, "w") as fd: | ||
| fd.write("SMILES\n") | ||
| for smi in sorted(Smol): | ||
| fd.write(smi + "\n") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| 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) | ||
| 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #value name path | ||
| metanetx MetaNetX (test) ${__HERE__}/mini_metanetx_alphabet.npz | ||
| emolecules eMolecules (test) ${__HERE__}/mini_metanetx_alphabet.npz | ||
| chembl ChEMBL (test) ${__HERE__}/mini_metanetx_alphabet.npz | ||
| drugbank DrugBank (test) ${__HERE__}/mini_metanetx_alphabet.npz |
5 changes: 5 additions & 0 deletions
5
...molecule-signature/test-data/output/Galaxy1-[Molecular Design by Reverse Engineering].tsv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| SMILES | ||
| Oc1cccc2nc3ccccc2nc13 | ||
| Oc1ccccc2nc3cccc3nc12 | ||
| Oc1cccc2nc3ccccc3nc12 | ||
| Oc1ccccc2nc3cccc2nc13 |
5 changes: 5 additions & 0 deletions
5
...molecule-signature/test-data/output/Galaxy2-[Molecular Design by Reverse Engineering].tsv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| SMILES | ||
| OC[C@H]1O[C@@H](O[C@H]2[C@H](O)[C@@H](O)[C@@H](O)[C@H](O)O[C@@H]2CO)[C@H](O)[C@H]1O | ||
| OC[C@H]1O[C@@H](O[C@H]2[C@H](O)[C@@H](O)[C@H](O)O[C@@H]2CO)[C@H](O)[C@@H](O)[C@H]1O | ||
| OC[C@H]1O[C@@H](O[C@H]2[C@H](O)[C@@H](O)[C@H](O)O[C@@H]2CO)[C@H](O)[C@H](O)[C@H]1O | ||
| OC[C@H]1O[C@@H](O[C@H]2[C@H](O)[C@H](O)[C@@H](O)[C@H](O)O[C@@H]2CO)[C@H](O)[C@H]1O |
8 changes: 8 additions & 0 deletions
8
tools/molecule-signature/tool-data/molsig_alphabets.loc.sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # 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 path | ||
| chembl ChEMBL alphabet /path/to/chembl_alphabet.npz | ||
| drugbank DrugBank alphabet /path/to/drugbank_alphabet.npz | ||
| emolecules eMolecules alphabet /path/to/emolecules_alphabet.npz | ||
| metanetx MetaNetX alphabet /path/to/metanetx_alphabet.npz | ||
|
Anthony96pi marked this conversation as resolved.
Resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <tables> | ||
| <table name="molsig_alphabets" comment_char="#"> | ||
| <columns>value, name, path</columns> | ||
|
Anthony96pi marked this conversation as resolved.
Resolved
|
||
| <file path="tool-data/molsig_alphabets.loc" /> | ||
| </table> | ||
| </tables> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <tables> | ||
| <table name="molsig_alphabets" comment_char="#"> | ||
| <columns>value, name, path</columns> | ||
| <file path="${__HERE__}/test-data/molsig_alphabets.loc" /> | ||
| </table> | ||
| </tables> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.