From dc14dca3a632e1f94173704bfc982907e9ed269e Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 20 Dec 2023 17:25:32 -0500 Subject: [PATCH] Misc --- packages/core/assemblyManager/assembly.ts | 1 - .../src/ui/AboutDialogContents.tsx | 8 +- .../alignments/src/BamAdapter/configSchema.ts | 98 ++++++++--------- plugins/alignments/src/BamAdapter/index.ts | 4 +- .../src/CramAdapter/configSchema.ts | 104 +++++++++--------- plugins/alignments/src/CramAdapter/index.ts | 4 +- .../src/LinearPileupDisplay/model.ts | 6 +- .../models/serverSideRenderedBlock.ts | 4 - 8 files changed, 114 insertions(+), 115 deletions(-) diff --git a/packages/core/assemblyManager/assembly.ts b/packages/core/assemblyManager/assembly.ts index 7820dc5446..8fbff59a5b 100644 --- a/packages/core/assemblyManager/assembly.ts +++ b/packages/core/assemblyManager/assembly.ts @@ -61,7 +61,6 @@ async function loadRefNameMap( ) { const { sessionId } = options - console.log('wpw', adapterConfig) await when( () => !!( diff --git a/packages/product-core/src/ui/AboutDialogContents.tsx b/packages/product-core/src/ui/AboutDialogContents.tsx index 44434327c7..84324d2ce5 100644 --- a/packages/product-core/src/ui/AboutDialogContents.tsx +++ b/packages/product-core/src/ui/AboutDialogContents.tsx @@ -86,7 +86,13 @@ export default function AboutContents({ ) : null} diff --git a/plugins/alignments/src/BamAdapter/configSchema.ts b/plugins/alignments/src/BamAdapter/configSchema.ts index 376506f1f7..12ef650f42 100644 --- a/plugins/alignments/src/BamAdapter/configSchema.ts +++ b/plugins/alignments/src/BamAdapter/configSchema.ts @@ -5,61 +5,59 @@ import { types } from 'mobx-state-tree' * #config BamAdapter * used to configure BAM adapter */ -function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars - -const configSchema = ConfigurationSchema( - 'BamAdapter', - { - /** - * #slot - */ - bamLocation: { - type: 'fileLocation', - defaultValue: { uri: '/path/to/my.bam', locationType: 'UriLocation' }, - }, +export default function configSchemaF() { + return ConfigurationSchema( + 'BamAdapter', + { + /** + * #slot + */ + bamLocation: { + type: 'fileLocation', + defaultValue: { uri: '/path/to/my.bam', locationType: 'UriLocation' }, + }, - index: ConfigurationSchema('BamIndex', { + index: ConfigurationSchema('BamIndex', { + /** + * #slot index.indexType + */ + indexType: { + model: types.enumeration('IndexType', ['BAI', 'CSI']), + type: 'stringEnum', + defaultValue: 'BAI', + }, + /** + * #slot index.location + */ + location: { + type: 'fileLocation', + defaultValue: { + uri: '/path/to/my.bam.bai', + locationType: 'UriLocation', + }, + }, + }), /** - * #slot index.indexType + * #slot */ - indexType: { - model: types.enumeration('IndexType', ['BAI', 'CSI']), - type: 'stringEnum', - defaultValue: 'BAI', + fetchSizeLimit: { + type: 'number', + description: + 'size to fetch in bytes over which to display a warning to the user that too much data will be fetched', + defaultValue: 5_000_000, }, /** - * #slot index.location + * #slot + * generally refers to the reference genome assembly's sequence adapter + * currently needs to be manually added */ - location: { - type: 'fileLocation', - defaultValue: { - uri: '/path/to/my.bam.bai', - locationType: 'UriLocation', - }, + sequenceAdapter: { + type: 'frozen', + description: + 'sequence data adapter, used to calculate SNPs when BAM reads lacking MD tags', + defaultValue: null, }, - }), - /** - * #slot - */ - fetchSizeLimit: { - type: 'number', - description: - 'size to fetch in bytes over which to display a warning to the user that too much data will be fetched', - defaultValue: 5_000_000, - }, - /** - * #slot - * generally refers to the reference genome assembly's sequence adapter - * currently needs to be manually added - */ - sequenceAdapter: { - type: 'frozen', - description: - 'sequence data adapter, used to calculate SNPs when BAM reads lacking MD tags', - defaultValue: null, }, - }, - { explicitlyTyped: true }, -) - -export default configSchema + { explicitlyTyped: true }, + ) +} diff --git a/plugins/alignments/src/BamAdapter/index.ts b/plugins/alignments/src/BamAdapter/index.ts index c84f0325c6..878925fa54 100644 --- a/plugins/alignments/src/BamAdapter/index.ts +++ b/plugins/alignments/src/BamAdapter/index.ts @@ -1,13 +1,13 @@ import PluginManager from '@jbrowse/core/PluginManager' import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType' -import configSchema from './configSchema' +import configSchemaF from './configSchema' export default function BamAdapterF(pluginManager: PluginManager) { pluginManager.addAdapterType(() => { return new AdapterType({ name: 'BamAdapter', displayName: 'BAM adapter', - configSchema, + configSchema: configSchemaF(), getAdapterClass: () => import('./BamAdapter').then(r => r.default), }) }) diff --git a/plugins/alignments/src/CramAdapter/configSchema.ts b/plugins/alignments/src/CramAdapter/configSchema.ts index 7e4acaa6e2..4e754a42e1 100644 --- a/plugins/alignments/src/CramAdapter/configSchema.ts +++ b/plugins/alignments/src/CramAdapter/configSchema.ts @@ -6,60 +6,62 @@ import { ConfigurationSchema } from '@jbrowse/core/configuration' */ function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars -const configSchema = ConfigurationSchema( - 'CramAdapter', - { - /** - * #slot fetchSizeLimit - */ - fetchSizeLimit: { - type: 'number', - description: - 'size in bytes over which to display a warning to the user that too much data will be fetched', - defaultValue: 3_000_000, - }, +export default function configSchemaF() { + return ConfigurationSchema( + 'CramAdapter', + { + /** + * #slot fetchSizeLimit + */ + fetchSizeLimit: { + type: 'number', + description: + 'size in bytes over which to display a warning to the user that too much data will be fetched', + defaultValue: 3_000_000, + }, - /** - * #slot cramLocation - */ - cramLocation: { - type: 'fileLocation', - defaultValue: { - uri: '/path/to/my.cram', - locationType: 'UriLocation', + /** + * #slot cramLocation + */ + cramLocation: { + type: 'fileLocation', + defaultValue: { + uri: '/path/to/my.cram', + locationType: 'UriLocation', + }, }, - }, - /** - * #slot craiLocation - */ - craiLocation: { - type: 'fileLocation', - defaultValue: { - uri: '/path/to/my.cram.crai', - locationType: 'UriLocation', + /** + * #slot craiLocation + */ + craiLocation: { + type: 'fileLocation', + defaultValue: { + uri: '/path/to/my.cram.crai', + locationType: 'UriLocation', + }, }, - }, - /** - * #slot sequenceAdapter - * generally refers to the reference genome assembly's sequence adapter - * currently needs to be manually added - */ - sequenceAdapter: { - type: 'frozen', - description: 'sequence data adapter', - defaultValue: null, - }, - }, - { - explicitlyTyped: true, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - actions: (self: any) => ({ - setSequenceAdapter(s: Record) { - self.sequenceAdapter = s + /** + * #slot sequenceAdapter + * generally refers to the reference genome assembly's sequence adapter + * this can be manually added via the baseTrackConfig autorun, or manually + * specified + */ + sequenceAdapter: { + type: 'frozen', + description: 'sequence data adapter', + defaultValue: null, }, - }), - }, -) -export default configSchema + }, + { + explicitlyTyped: true, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + actions: (self: any) => ({ + setSequenceAdapter(s: Record) { + self.sequenceAdapter = s + }, + }), + }, + ) +} diff --git a/plugins/alignments/src/CramAdapter/index.ts b/plugins/alignments/src/CramAdapter/index.ts index 8155682c4f..14f7bb6ff3 100644 --- a/plugins/alignments/src/CramAdapter/index.ts +++ b/plugins/alignments/src/CramAdapter/index.ts @@ -2,14 +2,14 @@ import PluginManager from '@jbrowse/core/PluginManager' import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType' // locals -import configSchema from './configSchema' +import configSchemaF from './configSchema' export default function CramAdapterF(pluginManager: PluginManager) { pluginManager.addAdapterType(() => { return new AdapterType({ name: 'CramAdapter', displayName: 'CRAM adapter', - configSchema, + configSchema: configSchemaF(), getAdapterClass: () => import('./CramAdapter').then(r => r.default), }) }) diff --git a/plugins/alignments/src/LinearPileupDisplay/model.ts b/plugins/alignments/src/LinearPileupDisplay/model.ts index 6bd6b9a995..e4d2572fd7 100644 --- a/plugins/alignments/src/LinearPileupDisplay/model.ts +++ b/plugins/alignments/src/LinearPileupDisplay/model.ts @@ -188,9 +188,10 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) { trackMaxHeight, mismatchAlpha, rendererTypeName, + rendererType, } = self const configBlob = getConf(self, ['renderers', rendererTypeName]) || {} - return self.rendererType.configSchema.create( + return rendererType.configSchema.create( { ...configBlob, ...(featureHeight !== undefined ? { height: featureHeight } : {}), @@ -218,9 +219,7 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) { */ renderReady() { const view = getContainingView(self) as LGV - console.log(self.adapterConfig.sequenceAdapter) return ( - self.adapterConfig.sequenceAdapter && self.modificationsReady && self.currSortBpPerPx === view.bpPerPx && superRenderReady() @@ -372,7 +371,6 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) { (!sortReady || self.currSortBpPerPx === view.bpPerPx) ) { const { pos, refName, assemblyName } = sortedBy - console.log(adapterConfig) // render just the sorted region first // @ts-expect-error await self.rendererType.renderInClient(rpcManager, { diff --git a/plugins/linear-genome-view/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts b/plugins/linear-genome-view/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts index 4d076d6f15..213d5a3fc7 100644 --- a/plugins/linear-genome-view/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +++ b/plugins/linear-genome-view/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts @@ -291,10 +291,6 @@ async function renderBlockEffect( return undefined } - console.log(renderArgs?.adapterConfig.sequenceAdapter) - if (!renderArgs?.adapterConfig.sequenceAdapter) { - return undefined - } if (displayError) { self.setError(displayError) return undefined