From 818915bff999857e514c9909bab33a93f4267fb8 Mon Sep 17 00:00:00 2001 From: ivan-aksamentov Date: Wed, 18 Jan 2023 14:07:44 +0100 Subject: [PATCH] fix: prevent double drawing of ref sequence --- src/io/parseFasta.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/io/parseFasta.ts b/src/io/parseFasta.ts index 465729d..d5c511e 100644 --- a/src/io/parseFasta.ts +++ b/src/io/parseFasta.ts @@ -55,7 +55,9 @@ export function parseFastaToRefAndMutations(fasta: string): ReferenceAndMutation const refEntry = fastaEntries.find((entry) => entry.accession.toLowerCase() === 'consensus') ?? fastaEntries[0] - const entries = fastaEntries.slice(1).map((qryEntry) => { + const qryEntries = fastaEntries.filter((entry) => entry.index !== refEntry.index) + + const entries = qryEntries.map((qryEntry) => { if (qryEntry.seq.length === 0) { return { ...qryEntry, mutations: [] } }