Coder Social home page Coder Social logo

sourire's Introduction

Sourire

"D'un enfant le sourire - Agrandit l'univers" -- Charles de Leusse

In the grand tradition of Clojure libraries we begin with an irrelevant quote.

Sourire is a minimal web API on top of the Smiles molecule rendering function of the GGA Software Indigo cheminformatics toolkit.

Usage

[base-url]/molecule/[url-encoded-smiles-string]?indigo-param-name=param-value

Smiles notation uses characters that are considered unsafe for use in URLs. Therefore the API only accepts smiles strings in URL encoded format.

Pull and run Docker image

Sourire is automatically built as a Docker image and available from the Docker registry.

Pull the image from the registry:

docker pull thomasjmoerman/sourire

Launch the container as a daemon bound to host port 9999 (or another port of your choice):

docker run -d -p 9999:8080 thomasjmoerman/sourire:latest

Build and run manually

Use leiningen to create a runnable jar (assuming you are in the project folder):

$ lein create-standalone

Launch the application:

java -jar target/sourire-0.1.0-SNAPSHOT-standalone.jar

You can provide a Java argument to specify the web server port:

java -jar target/sourire-0.1.0-SNAPSHOT-standalone.jar :port 8080

REPL

You can run a Clojure REPL supporting the famous Stuart Sierra Workflow, Reloaded pattern.

$ lein user-repl
WARNING: user-level profile defined in project files.
nREPL server started on port 8777 on host 127.0.0.1
REPL-y 0.3.0
Clojure 1.7.0-alpha5
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> (launch)

Examples

Vitamin B1

Smiles code: OCCc1c(C)[n+](=cs1)Cc2cnc(C)nc(N)2

Sourire URL: http://localhost:8000/molecule/OCCc1c%28C%29%5Bn%2B%5D%28%3Dcs1%29Cc2cnc%28C%29nc%28N%292?render-comment=Vitamin%20B1

vitamin b1

Glucose

Smiles code: OC[C@@H](O1)[C@@H](O)[C@H](O)[C@@H](O)[C@@H](O)1

Sourire URL: http://localhost:8000/molecule/OC%5BC%40%40H%5D%28O1%29%5BC%40%40H%5D%28O%29%5BC%40H%5D%28O%29%5BC%40%40H%5D%28O%29%5BC%40%40H%5D%28O%291?render-comment=glucose

Glucose

Caffeine

Smiles code: CN1C=NC2=C1C(=O)N(C)C(=O)N2C

Sourire URL: http://localhost:8000/molecule/CN1C%3DNC2%3DC1C%28%3DO%29N%28C%29C%28%3DO%29N2C?render-comment=caffeine

Caffeine

Oenanthotoxin

Smiles code: CCC[C@@H](O)CC\\C=C\\C=C\\C#CC#C\\C=C\\CO

Sourire URL: http://localhost:8000/molecule/CCC%5BC%40%40H%5D%28O%29CC%5CC%3DC%5CC%3DC%5CC%23CC%23C%5CC%3DC%5CCO?render-comment=oenanthotoxin

Caffeine

License

The Do Whatever The Hell You Like License.

I am not liable for accidentally launched intercontinental ballistic missionaries.

sourire's People

Contributors

tmoerman avatar

Stargazers

 avatar Ben avatar  avatar Subham avatar Janto Dreijer avatar  avatar Yuri Dias avatar Claude Manchester avatar  avatar Olivér Remény avatar Chris Zheng avatar Lin avatar M Haidar Hanif avatar Camille Appert avatar  avatar Saul Johnson avatar Mike Hugo avatar Christopher Chevalier avatar Toni Verbeiren avatar

Watchers

James Cloos avatar  avatar

Forkers

tverbeiren

sourire's Issues

Image size parameter

It would be nice to have a parameter to set the height or width of the image or both.
In case of both it would resize the image according to the lowest value.

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.