Skip to content

Commit

Permalink
Working
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Dec 20, 2023
1 parent ce5b1c2 commit 305e7d0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
26 changes: 18 additions & 8 deletions packages/core/assemblyManager/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,20 @@ async function loadRefNameMap(
signal?: AbortSignal,
) {
const { sessionId } = options
await when(() => !!(assembly.regions && assembly.refNameAliases), {
signal,
name: 'when assembly ready',
})

console.log('wpw', adapterConfig)

Check warning on line 64 in packages/core/assemblyManager/assembly.ts

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Unexpected console statement
await when(
() =>
!!(
assembly.regions &&
assembly.refNameAliases &&
adapterConfig.sequenceAdapter
),
{
signal,
name: 'when assembly ready',
},
)

const refNames = (await assembly.rpcManager.call(
sessionId || 'assemblyRpc',
Expand All @@ -82,10 +92,9 @@ async function loadRefNameMap(
}

const refNameMap = Object.fromEntries(
refNames.map(name => {
checkRefName(name)
return [assembly.getCanonicalRefName(name), name]
}),
refNames
.map(name => checkRefName(name))
.map(name => [assembly.getCanonicalRefName(name), name]),
)

// make the reversed map too
Expand All @@ -107,6 +116,7 @@ function checkRefName(refName: string) {
if (!refNameRegex.test(refName)) {
throw new Error(`Encountered invalid refName: "${refName}"`)
}
return refName
}

type RefNameAliases = Record<string, string | undefined>
Expand Down
5 changes: 3 additions & 2 deletions packages/core/pluggableElementTypes/models/baseTrackConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,10 @@ export function createBaseTrackConfig(pluginManager: PluginManager) {
.filter(notEmpty),
)
const c = assemblyManager.get(assemblyNames[0])?.configuration
console.log({ c })
if (c) {
self.adapter.setSequenceAdapter?.(readConfObject(c))
self.adapter.setSequenceAdapter?.(
readConfObject(c.sequence.adapter),
)
}
}),
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/alignments/src/CramAdapter/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const configSchema = ConfigurationSchema(
* generally refers to the reference genome assembly's sequence adapter
* currently needs to be manually added
*/
sequenceAdapters: {
sequenceAdapter: {
type: 'frozen',
description: 'sequence data adapter',
defaultValue: null,
Expand Down
8 changes: 4 additions & 4 deletions plugins/alignments/src/LinearPileupDisplay/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
*/
renderReady() {
const view = getContainingView(self) as LGV
console.log(self.adapterConfig.sequenceAdapter)

Check warning on line 210 in plugins/alignments/src/LinearPileupDisplay/model.ts

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Unexpected console statement
return (
self.adapterConfig.sequenceAdapter &&
self.modificationsReady &&
self.currSortBpPerPx === view.bpPerPx &&
superRenderReady()
Expand Down Expand Up @@ -338,10 +340,7 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
if (!self.autorunReady) {
return
}

const { bpPerPx } = view

self.setCurrSortBpPerPx(bpPerPx)
self.setCurrSortBpPerPx(view.bpPerPx)
},
{ delay: 1000 },
)
Expand All @@ -362,6 +361,7 @@ function stateModelFactory(configSchema: AnyConfigurationSchemaType) {
(!sortReady || self.currSortBpPerPx === view.bpPerPx)
) {
const { pos, refName, assemblyName } = sortedBy
console.log(adapterConfig)

Check warning on line 364 in plugins/alignments/src/LinearPileupDisplay/model.ts

View workflow job for this annotation

GitHub Actions / Lint on node 20 and ubuntu-latest

Unexpected console statement
// render just the sorted region first
// @ts-expect-error
await self.rendererType.renderInClient(rpcManager, {
Expand Down

0 comments on commit 305e7d0

Please sign in to comment.