From 9f94ad265cab3c6a05c6aff32c71af4873583ff2 Mon Sep 17 00:00:00 2001 From: Scott Cain Date: Mon, 25 Nov 2024 10:00:08 -0800 Subject: [PATCH] fixing the start coord to avoid negative numbers --- lib/src/accessFasta.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/accessFasta.ts b/lib/src/accessFasta.ts index 1fe5b27..87a473f 100644 --- a/lib/src/accessFasta.ts +++ b/lib/src/accessFasta.ts @@ -17,7 +17,7 @@ export async function accessFasta( gzi: gziFilehandle, }); - const upstreamstart = start - 499; + const upstreamstart = start - 499 < 0 ? 0 : start - 499; const downstreamend = end + 499; const seq = await t.getSequence(refseq, start, end); const upstream = await t.getSequence(refseq, upstreamstart, start);