nado.editlength
v1.0.1
Published
calculate edit length between 2 strings
Downloads
3
Readme
nado.editLength
nado.editLength support edit length of 2 Strings.
API
#levenshtein_distance(textA, textB) Levenshtein distance allows deletion, insertion, substition.
const ed = require('nado.editLength');
var strA = 'bluemoon';
var strB = 'mono';
var ld = ed.levenshtein_distance(strA, strB);
returned JSON
{ length: 6,
edit_operation: {
dispaly_A : 'bluemoon',
dispaly_operation: '----..XX',
dispaly_B : ' mono',
}
}
#damerau_levenshtein_distance(textA, textB) Demerau-Levenshtein distance allows deletion, insertion, substition and transposition.
const ed = require('nado.editLength');
var strA = 'bluemoon';
var strB = 'mono';
var ld = ed.demerau_levenshtein_distance(strA, strB);
returned JSON
{ length: 5,
edit_operation: {
dispaly_A : 'bluemoon',
dispaly_operation: '----..<>',
dispaly_B : ' mono',
}
}
#match_genome(test, target) find similar position between test sequence and target sequence.
const ed = require('nado.editLength');
var test = 'CCTACGGGTGGCTGCAGTGGGGGA';
var target = 'AAACTCCTACGGGAGGCAGCAGTGGGGGATATTGGACAATGGGGGGAACCCTGATCCAGCGACGCCGCGTGAGTGAAGAAGTATCTCGGTATGTAAAGCTCTAT';
var ld = ed.match_genome(test, target);
returned JSON
{ result: { unmatched: 2,
start: 6,
length: 24
},
edit_operation: {
dispaly_A : 'CCTACGGGTGGCTGCAGTGGGGGA',
dispaly_operation: '........X...X...........',
dispaly_B : 'CCTACGGGAGGCAGCAGTGGGGGA',
}
}