From b301420433ce6eca7acf16df3a79368b52e19f26 Mon Sep 17 00:00:00 2001 From: Garrett Stevens Date: Mon, 29 Jun 2026 23:16:25 +0000 Subject: [PATCH] Use alignment read tag for transcript strand --- .../src/extensions/annotationFromPileup.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/jbrowse-plugin-apollo/src/extensions/annotationFromPileup.ts b/packages/jbrowse-plugin-apollo/src/extensions/annotationFromPileup.ts index a75bba9a9..d5a5f091c 100644 --- a/packages/jbrowse-plugin-apollo/src/extensions/annotationFromPileup.ts +++ b/packages/jbrowse-plugin-apollo/src/extensions/annotationFromPileup.ts @@ -55,9 +55,25 @@ export function annotationFromPileup(pluggableElement: PluggableElementType) { getAnnotationFeature(jbrowseFeature: Feature, refSeqId: string) { const start: number = jbrowseFeature.get('start') const end: number = jbrowseFeature.get('end') - const strand = jbrowseFeature.get('strand') as 1 | -1 | undefined const name = jbrowseFeature.get('name') as string | undefined + let strand: 1 | -1 | undefined + const tags = jbrowseFeature.get('tags') as Record< + string, + string | number | undefined + > + const { ts, TS, XS } = tags + for (const tag of [ts, TS, XS]) { + if (!strand && tag) { + if ([1, '1', '+'].includes(tag)) { + strand = 1 + } else if ([-1, '-1', '-'].includes(tag)) { + strand = -1 + } + } + } + strand ??= jbrowseFeature.get('strand') as 1 | -1 | undefined + const cigarData = jbrowseFeature.get('CIGAR') as string const ops = parseCigar(cigarData) let position = start