Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed May 28, 2024
1 parent 2a716e6 commit dc14dca
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 115 deletions.
1 change: 0 additions & 1 deletion packages/core/assemblyManager/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ async function loadRefNameMap(
) {
const { sessionId } = options

console.log('wpw', adapterConfig)
await when(
() =>
!!(
Expand Down
8 changes: 7 additions & 1 deletion packages/product-core/src/ui/AboutDialogContents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ export default function AboutContents({
) : null}
<Attributes
attributes={confPostExt}
omit={['displays', 'baseUri', 'refNames', 'formatAbout']}
omit={[
'displays',
'baseUri',
'refNames',
'formatAbout',
'sequenceAdapters',
]}
hideUris={hideUris}
/>
</BaseCard>
Expand Down
98 changes: 48 additions & 50 deletions plugins/alignments/src/BamAdapter/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
)
}
4 changes: 2 additions & 2 deletions plugins/alignments/src/BamAdapter/index.ts
Original file line number Diff line number Diff line change
@@ -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),
})
})
Expand Down
104 changes: 53 additions & 51 deletions plugins/alignments/src/CramAdapter/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown>) {
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<string, unknown>) {
self.sequenceAdapter = s
},
}),
},
)
}
4 changes: 2 additions & 2 deletions plugins/alignments/src/CramAdapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
})
Expand Down
6 changes: 2 additions & 4 deletions plugins/alignments/src/LinearPileupDisplay/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } : {}),
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dc14dca

Please sign in to comment.