Coder Social home page Coder Social logo

nwunsch_lua's Introduction

nwunsch

Needleman–Wunsch algorithm implementation in Lua.

Features

  • Sequence Comparison: The package enables the comparison of two sequences (seq1 and seq2) by considering all possible alignments and choosing the best one.

  • Scoring System: The scoring system is customisable with match, mismatch, and gap parameters, allowing users to define the reward for matched characters and penalties for mismatches and gaps.

  • Matrix Generation and Population: It creates a dynamic programming matrix of sequence lengths and populates it accordingly based on optimal alignment values.

  • Traceback Functionality: It includes a traceback procedure which identifies the optimal path through the matrix, producing the final alignment of the input sequences.

  • Efficient Evaluation: It utilises a max function to determine the maximum score between match, mismatch, and gap; this feature guarantees the efficiency of the sequence alignment process.

Installation

Install the nwunsch package in your Lua project by installing it with the following command:

luarocks install nwunsch

Usage

local nwunsch = require("nwunsch")

-- Use the package functions
local seq1 = "AGACTAGTTACCGTAGGCTCGAGTCGGATCGGATCGGATCGGATCAA"
local seq2 = "CGAGACGTGACCTTAGGCTCGAGTCGGATCGGATCGGATCGGA"
local match = 2
local mismatch = -1
local gap = -2

local score, align1, align2 = nwunsch.NeedlemanWunsch(seq1, seq2, match, mismatch, gap)
print("Alignment score:", score)
print("Alignment 1:", align1)
print("Alignment 2:", align2)

Use Case: Execute the gene.lua sample code in the examples directory.

License

This project is licensed under the MIT License.

Copyright

(c) 2024 Finbarrs Oketunji.

📚📚 Go and purchase a Lua book.

nwunsch_lua's People

Contributors

0xnu avatar

Watchers

 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.