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 dd797972b2..d8aa322185 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 (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 5fcb6cd433..3929d07cb8 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 (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 411a933de5..319e7ee48b 100644 --- a/plugins/alignments/src/LinearPileupDisplay/model.ts +++ b/plugins/alignments/src/LinearPileupDisplay/model.ts @@ -177,9 +177,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 } : {}), @@ -207,9 +208,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() 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