Giter Club home page Giter Club logo

smsd's Introduction

SMSD

Small Molecule Subgraph Detector (SMSD) is a Java based software library for finding Maximum Common Subgraph (MCS)/ Substructure between small molecules. This enables help us to find similarity/distance between two molecules. MCS is also used for screening drug like compounds by hitting molecules, which share common subgraph (substructure).

The SMSD code:

The present code is part of the Small Molecule Subgraph Detector (SMSD http://www.ebi.ac.uk/thornton-srv/software/SMSD ) library.

Encourage this project by citing the paper and the (SMSD) URL

S. A. Rahman, M. Bashton, G. L. Holliday, R. Schrader and J. M. Thornton, Small Molecule Subgraph Detector (SMSD) toolkit, Journal of Cheminformatics 2009, 1:12. DOI:10.1186/1758-2946-1-12

Wish you a happy coding!


Maven POM configuration

<dependencies>
    <dependency>
        <groupId>uk.ac.ebi.smsd</groupId>
        <artifactId>smsd-core</artifactId>
        <version>LATEST</version>
    </dependency>
    <dependency>
        <groupId>uk.ac.ebi.smsd</groupId>
        <artifactId>smsd-exec</artifactId>
        <version>LATEST</version>
    </dependency>
</dependencies>

Compile (compiled jar might be available under exec/target/ folder)

-compile core modules
mvn clean install

-compile with dependencies
mvn install

Command Line Options

java -Xms500M -Xmx512M -cp smsd-2.2.0.jar: uk.ac.ebi.smsd.cmd.SMSDcmd

===================

Windows Platform (DOS): SMSD.bat file

java -Xms500M -Xmx512M -cp smsd-2.2.0.jar: uk.ac.ebi.smsd.cmd.SMSDcmd %*

Unix/Mac: SMSD.sh file

java -Xms500M -Xmx512M -cp smsd-2.2.0.jar: uk.ac.ebi.smsd.cmd.SMSDcmd $@

===================


Options

Single SMILES query vs single SMILES target:

java -Xms500M -Xmx512M -cp smsd.jar: uk.ac.ebi.smsd.cmd.SMSDcmd -Q SMI -q "CCN" -T SMI -t "CCCNC"

Single SMILES query vs single MOL target:

java -Xms500M -Xmx512M -cp smsd.jar: uk.ac.ebi.smsd.cmd.SMSDcmd -Q SMI -q "CCN" -T MOL -t Data/ATP.mol

Signature query vs smiles target, outputting the subgraph to stdout:

java -Xms500M -Xmx512M -cp smsd.jar: uk.ac.ebi.smsd.cmd.SMSDcmd -Q SIG -q "[C]([C][C])" -T SMI -t "C(C)CC" -O SMI -o -

Multiway N-MCS, outputing the subgraph as a smiles to stdout:

java -Xms500M -Xmx512M -cp smsd.jar: uk.ac.ebi.smsd.cmd.SMSDcmd -T SDF -t Data/arom.sdf -N -O SMI -o -

Just use ./SMSD -I to list all the image options.

Few more options:

++++++++++++++++++++++++++++++++++++++++++++++
NOTE: The graph matching is performed by removing
the Hydrogens
++++++++++++++++++++++++++++++++++++++++++++++

usage:
       
 -A                  Appends output to existing files, else creates new
                     files
 -a                  Add Hydrogen
 -b                  Match Bond types (Single, Double etc)
 -d <WIDTHxHEIGHT>   Dimension of the image in pixels
 -f <number>         Default: 0, Stereo: 1, Stereo+Fragment: 2,
                     Stereo+Fragment+Energy: 3
 -g                  create png of the mapping
 -h,--help           Help page for command usage
 -I <option=value>   Image options
 -m                  Report all Mappings
 -N                  Do N-way MCS on the target SD file
 -o <filename>       Output the substructure to a file
 -O <type>           Output type
 -Q <type>           Query type (MOL, SMI, etc)
 -q <filepath>       Query filename
 -r                  Remove Hydrogen
 -s                  SubStructure detection
 -S <suffix>         Add suffix to the files
 -T <type>           Target type (MOL, SMI, etc)
 -t <filepath>       Target filename
 -z                  Ring Match

++++++++++++++++++++++++++++++++++++++++++++++

Allowed types for single-molecules (query or target):
MOL	MDL V2000 format
ML2	MOL2 Tripos format
PDB	Protein Databank Format
CML	Chemical Markup Language
SMI	SMILES string format
SIG	Signature string format

Allowed types for multiple-molecules (targets only):
SDF	SD file format

THIRD PARTY TOOL

You need the CDK (https://github.com/cdk/cdk) as SMSD depends on the CDK for processing the Chemical information.

smsd's People

Contributors

asad avatar dependabot[bot] avatar gilleain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smsd's Issues

Fragments

a)Return mapped/common fragments
b)Return unmapped/unique fragments

NullPointer: Aromaticity model

I used this following command on the two attached files (I had to add .txt to the file name to get them to append here):

java8 -Xms500M -Xmx512M -cp SMSD.jar uk.ac.ebi.smsd.cmd.SMSDcmd -Q MOL -q 15422.mol -T MOL -t 58796.mol

and got a coding error:
java.lang.NullPointerException: Aromaticity model requires implicit hydrogen count is set.

I believe these are valid mol files. The program should be able to handle these. So I am submitting this issue as a bug report.

15422.mol.txt
58796.mol.txt

David Mischel
Programmer/Analyst IV
University of California at San Francisco
[email protected]

MCS Code not working with CDK 2.x

I tried to get the MCS search running using the latest CDK 2.3 based on code here: https://github.com/asad/SMSD/blob/master/core/src/test/java/example/MCSSearch.java

I hit a problem. Code is essentially like this:

        IAtomContainer query = ChemUtils.generate2D(smilesParser.parseSmiles('NC1=CC=CC=C1'))
        IAtomContainer target = ChemUtils.generate2D(smilesParser.parseSmiles('NC1=CC(=CC=C1)C(O)=O'))

        ExtAtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(query);
        ExtAtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(target);

        query = ExtAtomContainerManipulator.removeHydrogens(query);
        target = ExtAtomContainerManipulator.removeHydrogens(target);

        ExtAtomContainerManipulator.aromatizeMolecule(query);
        ExtAtomContainerManipulator.aromatizeMolecule(target);

        query = new AtomContainer(query);
        target = new AtomContainer(target);

        boolean bondSensitive = true;
        boolean ringMatch = false;
        boolean stereoMatch = true;
        boolean fragmentMinimization = true;
        boolean energyMinimization = true;

        Isomorphism comparison = new Isomorphism(query, target, Algorithm.DEFAULT, bondSensitive, ringMatch, false);
        comparison.setChemFilters(stereoMatch, fragmentMinimization, energyMinimization);
        AtomAtomMapping firstAtomMapping = comparison.getFirstAtomMapping();

The problem comes from the line comparison.setChemFilters(stereoMatch, fragmentMinimization, energyMinimization)

java.lang.IllegalArgumentException: setFlag() must be provided a valid CDKConstant and not used for custom properties
	at org.openscience.cdk.silent.ChemObject.setFlag(ChemObject.java:315)
	at org.openscience.cdk.ChemObjectRef.setFlag(ChemObjectRef.java:168)
	at org.openscience.cdk.AtomRef.setFlag(AtomRef.java:40)
	at org.openscience.smsd.filters.EnergyFilter.getMappedMoleculeEnergies(EnergyFilter.java:109)
	at org.openscience.smsd.filters.EnergyFilter.sortResults(EnergyFilter.java:62)
	at org.openscience.smsd.filters.EnergyFilter.sortResults(EnergyFilter.java:44)
	at org.openscience.smsd.filters.ChemicalFilters.sortResultsByEnergies(ChemicalFilters.java:105)
	at org.openscience.smsd.BaseMapping.setChemFilters(BaseMapping.java:95)

Looks like something in the CDK API has changed?

Use actual CDK dependencies, not cdk-bundle

The POM file that is present on JCenter declares a dependency on org.openscience.cdk:cdk-bundle:1.5.13.
It would be better to declare the actual CDK modules that it is dependent on.
In my app where I'm trying to use SMSD I'm declaring the actual CDK modules that I need, and using CDK 2.3. When I add the uk.ac.ebi.smsd:sdms-* modules it pulls in org.openscience.cdk:cdk-bundle:1.5.13 which then pulls in lots of CDK 1.5.13 modules as well as the 2.3 ones I already have.
It would of course also reduce bloat to not include the modules that are not needed.

SDF file matching output

The SDF file MCS/Substructure output in the "Target" or "Query" mol should contain the mol names/Title if they are present in the input file rather than the indexing.

----A request or bug reported by a potential user

Image generation problems for N-MCS

If large numbers of targets are used for N-MCS, the java process is highly likely to run out of memory when generating the image. This is because the standard 'subcanvas' size is 300x300, so with 100 molecules this is a circle with a circumference of 30,000 pixels.

Possibly a maximum limit (for number of molecules) could be worked out, or maximum dimensions for the output image. The user can now specify subCanvas dimensions on the command line with "-d WxH" for width x height, although the minimum size for readability is around 50x50.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.