diff --git a/packages/core/util/index.ts b/packages/core/util/index.ts index 88fe4f1a5f9..b856397e947 100644 --- a/packages/core/util/index.ts +++ b/packages/core/util/index.ts @@ -760,14 +760,19 @@ export async function renameRegionsIfNeeded< ...args, regions: [...(args.regions || [])], } - if (assemblyName && adapterConfig.type !== 'FromConfigSequenceAdapter') { + + // configs can choose to not be associated with the assemblyManager (as with + // the "read assembly" in the read vs ref comparisons) and in this case a + // special flag exists (currently set on the FromConfigSequenceAdapter) + // called noAssemblyManager + // @ts-ignore + if (assemblyName && !adapterConfig.noAssemblyManager) { const refNameMap = await assemblyManager.getRefNameMapForAdapter( adapterConfig, assemblyName, newArgs, ) - // console.log(`${JSON.stringify(regions)} ${JSON.stringify(refNameMap)}`) if (refNameMap && regions && newArgs.regions) { for (let i = 0; i < regions.length; i += 1) { newArgs.regions[i] = renameRegionIfNeeded(refNameMap, regions[i]) diff --git a/plugins/config/src/FromConfigAdapter/FromConfigSequenceAdapter.ts b/plugins/config/src/FromConfigAdapter/FromConfigSequenceAdapter.ts index 4358f1aaa88..3ce23d801cb 100644 --- a/plugins/config/src/FromConfigAdapter/FromConfigSequenceAdapter.ts +++ b/plugins/config/src/FromConfigAdapter/FromConfigSequenceAdapter.ts @@ -22,6 +22,7 @@ export default class FromSequenceConfigAdapter extends FromConfigAdapter { .toPromise() // return ObservableCreate(async observer => { // const feats = await super.getFeatures(region).pipe(toArray()).toPromise() + feats.forEach(feat => { const featStart = feat.get('start') const seqStart = start - featStart @@ -32,9 +33,10 @@ export default class FromSequenceConfigAdapter extends FromConfigAdapter { observer.next( new SimpleFeature({ ...feat.toJSON(), - seq, end: region.end, start: region.start, + seq, + uniqueId: `${Math.random()}`, }), ) }) diff --git a/plugins/config/src/FromConfigAdapter/configSchema.ts b/plugins/config/src/FromConfigAdapter/configSchema.ts index f14cdce1c0a..c09bd4d9144 100644 --- a/plugins/config/src/FromConfigAdapter/configSchema.ts +++ b/plugins/config/src/FromConfigAdapter/configSchema.ts @@ -41,6 +41,14 @@ export const sequenceConfigSchema = ConfigurationSchema( type: 'string', defaultValue: 'SimpleFeature', }, + + // occasionally assemblies may not be associated with the assemblyManager + // e.g. in the case of the "read assembly" that is used in read vs ref + // visualizations + noAssemblyManager: { + type: 'boolean', + defaultValue: false, + }, }, { explicitlyTyped: true }, ) diff --git a/plugins/linear-comparative-view/src/LinearComparativeView/model.ts b/plugins/linear-comparative-view/src/LinearComparativeView/model.ts index 10fb939d747..5c76a09efee 100644 --- a/plugins/linear-comparative-view/src/LinearComparativeView/model.ts +++ b/plugins/linear-comparative-view/src/LinearComparativeView/model.ts @@ -65,8 +65,10 @@ export default function stateModelFactory(pluginManager: PluginManager) { pluginManager.pluggableConfigSchemaType('track'), ), - // this represents assemblies in the specialized - // read vs ref dotplot view + // this represents assemblies in the specialized read vs ref dotplot + // view. note that this was a types.frozen but is turned into an actual + // assembly type because we need to be able to use resolveIdentifier to + // resolve the sequence track inside the assembly viewAssemblyConfigs: types.array(assemblyConfigSchemasType), }), ) diff --git a/plugins/linear-comparative-view/src/index.tsx b/plugins/linear-comparative-view/src/index.tsx index 4ab94fe9e97..966b907c2b5 100644 --- a/plugins/linear-comparative-view/src/index.tsx +++ b/plugins/linear-comparative-view/src/index.tsx @@ -320,6 +320,7 @@ function WindowSizeDlg(props: { assemblyNames: [readAssembly], adapter: { type: 'FromConfigSequenceAdapter', + noAssemblyManager: true, features: [ { start: 0,