1.0.0 • Published 6 years ago

needleman-wrapper v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

needleman-wrapper

A simple node module that wraps the functionalities of a needleman-wunsch implementation written in C

The original program written in C is found here. https://github.com/noporpoise/seq-align

Install

You can install needleman-wrapper by running,

npm install needleman-wrapper

Usage

Align two unaligned sequences

  • .alignPair( sequence1, sequence2, matchScore, misMatchScore, gapScore, callback )
    callback passed (err, data)

    const needleman = require('needleman-wrapper');
    var sequence1 = 'AADBFGTRHYSRRFDERS';
    var sequence2 = 'AADGTDRSYSRFFDERTS';
    var matchScore = 1;
    var misMatchScore = -1;
    var gapScore = -1;
    
    needleman.alignPair(sequence1,sequence2,matchScore,misMatchScore,gapScore,function(err,data){
        if(err){
            console.log(err);
        }else{
            console.log(data);
        }
    });
        

Align 2 sequences and output alignment along with score

  • .alignPairGetScore (sequence1, sequence2, matchScore, misMatchScore, gapScore, callback) callback passed (err, data)

Align 2 sequences and output alignment along with score matrix

  • .alignPairGetMatrix (sequence1, sequence2, matchScore, misMatchScore, gapScore, callback) callback passed (err, data)

Align sequence file (Read 2 sequences at a time and align them)

  • .alignFile (inputFile, matchScore, misMatchScore, gapScore, callback) callback passed (err, data)

      const needleman = require('needleman-wrapper');
      var inputFile = 'samples/examples.fasta';  
      var matchScore = 1;
      var misMatchScore = -1;
      var gapScore = -1;
      
      needleman.alignFile(inputFile, matchScore, misMatchScore, gapScore, function(err,data){
          if(err){
              console.log(err);
          }else{
              console.log(data);
          }
      });

Align sequence file and output alignments along with score

  • .alignFileGetScore (inputFile, matchScore, misMatchScore, gapScore, callback) callback passed (err, data)

Align sequence file and output pairwise alignment along with score matrix

  • .alignFileGetMatrix (inputFile, matchScore, misMatchScore, gapScore, callback) callback passed (err, data)

NOTE: You can build the bundled binary executable by running,

node util/psaToolBuilder.js