From 1dec9525213de7b8c23bf3393b2b76a46e27f6c7 Mon Sep 17 00:00:00 2001 From: sanine-a Date: Tue, 1 Aug 2023 16:22:54 -0500 Subject: remove src/protein/ --- src/protein/protein.js | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 src/protein/protein.js (limited to 'src/protein/protein.js') diff --git a/src/protein/protein.js b/src/protein/protein.js deleted file mode 100644 index 0223203..0000000 --- a/src/protein/protein.js +++ /dev/null @@ -1,10 +0,0 @@ -const xnor = (a, b) => a === b ? 1 : 0; - -export function compare(pa, pb) { - if (pa.length !== pb.length) { - throw new Error(`attempted to compare proteins with different lengths: ${pa.length} vs ${pb.length}`); - } - return (1/pa.length) * pa - .map((_, i) => xnor(pa[i], pb[i])) - .reduce((acc, val) => acc + val, 0) -} -- cgit v1.2.1