Giter Club home page Giter Club logo

assembly_go's Introduction

Go Assembly Code

Go package to calculate Assembly Numbers for Molecules.

Build

Make sure go is installed, the instructions for that can be found on the (golang docs)[https://go.dev/doc/install]

Confirm you've installed go correctly by running go version (a version later than 1.15 should be shown)

after that building the command line tool is easy just run go build cmd/app/main.go -o assembly

Usage

Currently basic usage is as follows - note flags (preceded by a dash) can be in any order

filename as argument at the end of the command, outputs assembly index only:

./assembly my_mol.mol

verbose flag will result in more detailed pathway output. In this usage, my_mol.mol must be at the end:

./assembly -verbose my_mol.mol

filename can also be passed as a flag - this takes priority over putting the filename at the end if both are done

./assembly -file=my_mol.mol -verbose

number of workers in the worker pool and the buffer size of the jobs queue. Currently defaults both to 100 (yet to test how optimal the default is).

./assembly -file=my_mol.mol -workers=500 -buffer=500

The -molfile flag defaults to true to read input as a mol file. Switch to false to read input as custom graph txt file. This is a basic format that was used in testing and development as is simply 5 lines, those being name, list of vertex indices, list of associated edges (will be read in pairs, e.g. 1 2 2 3 is edges {1, 2} and {2, 3}), vertex colours, edge colours. Vertex and edge colours interpreted as strings, delineated by spaces. If there are no vertex or edge colours, replace the corresponding line with an exclamation mark "!"

Square graph (name - this line can be anything)
1 2 3 4 5
1 2 2 3 3 4 4 5
A B A B B
Red Blue Red Blue

./assembly -file=my_graph.txt -molfile=false

The -log flag is a boolean, and if present will log the pathway output to a file (default log.txt)

To specify a log file use e.g. -logfile my_log_file.txt (must also have log flag to do anything)

Example

Here's an example with aspirin:

./assembly file=aspirin.mol -verbose

Which produces this output:

Running on file:  aspirin.mol
ORIGINAL GRAPH
+++++++++++++++
Vertices [0 1 2 3 4 5 6 7 8 9 10 11 12]
Edges [[0 1] [2 0] [0 3] [1 4] [5 2] [2 6] [3 10] [4 7] [7 5] [6 8] [6 9] [10 11] [10 12]]
VertexColours [C C C O C C C C O O C O C]
EdgeColours [double single single single double single single double single double single double single]
+++++++++++++++
PATHWAY
Pathway Graphs
======
Vertices [2 0 5]
Edges [[2 0] [5 2]]
VertexColours [C C C]
EdgeColours [single double]
======
======
Vertices [3 10 11 12]
Edges [[3 10] [10 11] [10 12]]
VertexColours [O C O C]
EdgeColours [single double single]
======
======
Vertices [13 1 14]
Edges [[13 1] [1 14]]
VertexColours [C C C]
EdgeColours [double single]
======
----------
Remnant Graph
Vertices [0 3 2 6 8 9 4 7 5]
Edges [[0 3] [2 6] [6 8] [6 9] [4 7] [7 5]]
VertexColours [C O C C O O C C C]
EdgeColours [single single double single double single]
----------
Duplicated Edges
[0 2]
[1 4 5]
[1 2]
+++++++++++++++

Assembly Index:  8
Time:  0.0449225

Sample build command from repo root

go build -o bin\assembly.exe GoAssembly/cmd/app

assembly_go's People

Contributors

hessammehr avatar mjirasek avatar

Watchers

 avatar Jonathan Grizou avatar Lee Cronin avatar

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.