jbrowse-plugin-msaview 2.4.5 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,7 @@ export function getTranscriptFeatures(feature) {
26
26
  export function getTranscriptLength(feature) {
27
27
  const cdsLen = sum(feature
28
28
  .get('subfeatures')
29
- ?.filter(f => f.get('type')?.toLowerCase() === 'cds')
29
+ ?.filter(f => f.get('type') === 'CDS')
30
30
  .map(s => s.get('end') - s.get('start')) ?? []);
31
31
  return {
32
32
  len: Math.floor(cdsLen / 3),
@@ -3,6 +3,14 @@ export declare function loadStoredData(self: JBrowsePluginMsaViewModel): void;
3
3
  export declare function storeDataToIndexedDB(self: JBrowsePluginMsaViewModel): void;
4
4
  export declare function launchBlastIfNeeded(self: JBrowsePluginMsaViewModel): void;
5
5
  export declare function processInit(self: JBrowsePluginMsaViewModel): void;
6
+ /**
7
+ * Mirror the connected genome view's hover position onto the MSA's hovered
8
+ * column. Returns the autorun body so it can keep a flag tracking whether the
9
+ * MSA's mouseCol was set by this sync: that way an unrelated session hover
10
+ * change clears the column only when the genome put it there, never wiping a
11
+ * column the user is hovering directly in the MSA.
12
+ */
13
+ export declare function syncGenomeHoverToMsaColumn(self: JBrowsePluginMsaViewModel): () => void;
6
14
  export declare function highlightConnectedStructures(self: JBrowsePluginMsaViewModel): void;
7
15
  export declare function autoConnectStructures(self: JBrowsePluginMsaViewModel): void;
8
16
  export declare function observeProteinHighlights(self: JBrowsePluginMsaViewModel): void;
@@ -1,5 +1,6 @@
1
1
  import { getSession } from '@jbrowse/core/util';
2
2
  import { doLaunchBlast } from './doLaunchBlast';
3
+ import { genomeToMSA } from './genomeToMSA';
3
4
  import { cleanupOldData, generateDataStoreId, retrieveMsaData, storeMsaData, } from './msaDataStore';
4
5
  import { gappedToUngappedPosition, getProteinViews, } from './structureConnection';
5
6
  import { getUniprotIdFromAlphaFoldUrl } from './util';
@@ -131,6 +132,27 @@ export function processInit(self) {
131
132
  })();
132
133
  }
133
134
  }
135
+ /**
136
+ * Mirror the connected genome view's hover position onto the MSA's hovered
137
+ * column. Returns the autorun body so it can keep a flag tracking whether the
138
+ * MSA's mouseCol was set by this sync: that way an unrelated session hover
139
+ * change clears the column only when the genome put it there, never wiping a
140
+ * column the user is hovering directly in the MSA.
141
+ */
142
+ export function syncGenomeHoverToMsaColumn(self) {
143
+ let genomeDrivenCol = false;
144
+ return () => {
145
+ const col = genomeToMSA({ model: self });
146
+ if (col !== undefined) {
147
+ self.setMousePos(col);
148
+ genomeDrivenCol = true;
149
+ }
150
+ else if (genomeDrivenCol) {
151
+ self.setMousePos(undefined);
152
+ genomeDrivenCol = false;
153
+ }
154
+ };
155
+ }
134
156
  export function highlightConnectedStructures(self) {
135
157
  const { mouseCol, connectedProteinViews } = self;
136
158
  if (connectedProteinViews.length === 0) {