-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move more pluggable element initializations into factory functions (#…
- Loading branch information
Showing
34 changed files
with
509 additions
and
428 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import PluginManager from '@jbrowse/core/PluginManager' | ||
|
||
import ReactComponent from './ArcRendering' | ||
import configSchema from './configSchema' | ||
import ArcRenderer from './ArcRenderer' | ||
|
||
export default (pluginManager: PluginManager) => { | ||
pluginManager.addRendererType( | ||
() => | ||
new ArcRenderer({ | ||
name: 'ArcRenderer', | ||
ReactComponent, | ||
configSchema, | ||
pluginManager, | ||
}), | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
5 changes: 1 addition & 4 deletions
5
...arc/src/LinearArcDisplay/configSchema.tsx → .../arc/src/LinearArcDisplay/configSchema.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import PluginManager from '@jbrowse/core/PluginManager' | ||
import { DisplayType } from '@jbrowse/core/pluggableElementTypes' | ||
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view' | ||
|
||
import { configSchemaFactory } from './configSchema' | ||
import { stateModelFactory } from './model' | ||
|
||
export default (pluginManager: PluginManager) => { | ||
pluginManager.addDisplayType(() => { | ||
const configSchema = configSchemaFactory(pluginManager) | ||
return new DisplayType({ | ||
name: 'LinearArcDisplay', | ||
configSchema, | ||
stateModel: stateModelFactory(configSchema), | ||
trackType: 'FeatureTrack', | ||
viewType: 'LinearGenomeView', | ||
ReactComponent: BaseLinearDisplayComponent, | ||
}) | ||
}) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
export { default as configSchema } from './configSchema' | ||
import { AdapterType } from '@jbrowse/core/pluggableElementTypes' | ||
import PluginManager from '@jbrowse/core/PluginManager' | ||
import configSchema from './configSchema' | ||
|
||
export default (pluginManager: PluginManager) => { | ||
pluginManager.addAdapterType( | ||
() => | ||
new AdapterType({ | ||
name: 'Gff3Adapter', | ||
configSchema, | ||
getAdapterClass: () => import('./Gff3Adapter').then(r => r.default), | ||
}), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,15 @@ | ||
export { default as configSchema } from './configSchema' | ||
import { AdapterType } from '@jbrowse/core/pluggableElementTypes' | ||
import PluginManager from '@jbrowse/core/PluginManager' | ||
import configSchema from './configSchema' | ||
|
||
export default (pluginManager: PluginManager) => { | ||
pluginManager.addAdapterType( | ||
() => | ||
new AdapterType({ | ||
name: 'Gff3TabixAdapter', | ||
configSchema, | ||
getAdapterClass: () => | ||
import('./Gff3TabixAdapter').then(r => r.default), | ||
}), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import PluginManager from '@jbrowse/core/PluginManager' | ||
import { FileLocation } from '@jbrowse/core/util/types' | ||
import { | ||
makeIndex, | ||
makeIndexType, | ||
getFileName, | ||
AdapterGuesser, | ||
} from '@jbrowse/core/util/tracks' | ||
|
||
export default (pluginManager: PluginManager) => { | ||
pluginManager.addToExtensionPoint( | ||
'Core-guessAdapterForLocation', | ||
(adapterGuesser: AdapterGuesser) => { | ||
return ( | ||
file: FileLocation, | ||
index?: FileLocation, | ||
adapterHint?: string, | ||
) => { | ||
const regexGuess = /\.gff3?\.b?gz$/i | ||
const adapterName = 'Gff3TabixAdapter' | ||
const fileName = getFileName(file) | ||
const indexName = index && getFileName(index) | ||
if (regexGuess.test(fileName) || adapterHint === adapterName) { | ||
return { | ||
type: adapterName, | ||
bamLocation: file, | ||
gffGzLocation: file, | ||
index: { | ||
location: index || makeIndex(file, '.tbi'), | ||
indexType: makeIndexType(indexName, 'CSI', 'TBI'), | ||
}, | ||
} | ||
} | ||
return adapterGuesser(file, index, adapterHint) | ||
} | ||
}, | ||
) | ||
|
||
pluginManager.addToExtensionPoint( | ||
'Core-guessAdapterForLocation', | ||
(adapterGuesser: AdapterGuesser) => { | ||
return ( | ||
file: FileLocation, | ||
index?: FileLocation, | ||
adapterHint?: string, | ||
) => { | ||
const regexGuess = /\.gff3?$/i | ||
const adapterName = 'Gff3Adapter' | ||
const fileName = getFileName(file) | ||
const obj = { | ||
type: adapterName, | ||
gffLocation: file, | ||
} | ||
if (regexGuess.test(fileName) && !adapterHint) { | ||
return obj | ||
} else if (adapterHint === adapterName) { | ||
return obj | ||
} | ||
return adapterGuesser(file, index, adapterHint) | ||
} | ||
}, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,16 @@ | ||
import AdapterType from '@jbrowse/core/pluggableElementTypes/AdapterType' | ||
import PluginManager from '@jbrowse/core/PluginManager' | ||
import Plugin from '@jbrowse/core/Plugin' | ||
import { configSchema as gff3TabixAdapterConfigSchema } from './Gff3TabixAdapter' | ||
import { FileLocation } from '@jbrowse/core/util/types' | ||
import { | ||
makeIndex, | ||
makeIndexType, | ||
AdapterGuesser, | ||
getFileName, | ||
} from '@jbrowse/core/util/tracks' | ||
import { configSchema as gff3AdapterConfigSchema } from './Gff3Adapter' | ||
|
||
import Gff3TabixAdapterF from './Gff3TabixAdapter' | ||
import Gff3AdapterF from './Gff3Adapter' | ||
import GuessGff3F from './GuessGff3' | ||
|
||
export default class extends Plugin { | ||
name = 'GFF3Plugin' | ||
|
||
install(pluginManager: PluginManager) { | ||
pluginManager.addAdapterType( | ||
() => | ||
new AdapterType({ | ||
name: 'Gff3TabixAdapter', | ||
configSchema: gff3TabixAdapterConfigSchema, | ||
getAdapterClass: () => | ||
import('./Gff3TabixAdapter/Gff3TabixAdapter').then(r => r.default), | ||
}), | ||
) | ||
pluginManager.addToExtensionPoint( | ||
'Core-guessAdapterForLocation', | ||
(adapterGuesser: AdapterGuesser) => { | ||
return ( | ||
file: FileLocation, | ||
index?: FileLocation, | ||
adapterHint?: string, | ||
) => { | ||
const regexGuess = /\.gff3?\.b?gz$/i | ||
const adapterName = 'Gff3TabixAdapter' | ||
const fileName = getFileName(file) | ||
const indexName = index && getFileName(index) | ||
if (regexGuess.test(fileName) || adapterHint === adapterName) { | ||
return { | ||
type: adapterName, | ||
bamLocation: file, | ||
gffGzLocation: file, | ||
index: { | ||
location: index || makeIndex(file, '.tbi'), | ||
indexType: makeIndexType(indexName, 'CSI', 'TBI'), | ||
}, | ||
} | ||
} | ||
return adapterGuesser(file, index, adapterHint) | ||
} | ||
}, | ||
) | ||
pluginManager.addAdapterType( | ||
() => | ||
new AdapterType({ | ||
name: 'Gff3Adapter', | ||
configSchema: gff3AdapterConfigSchema, | ||
getAdapterClass: () => | ||
import('./Gff3Adapter/Gff3Adapter').then(r => r.default), | ||
}), | ||
) | ||
pluginManager.addToExtensionPoint( | ||
'Core-guessAdapterForLocation', | ||
(adapterGuesser: AdapterGuesser) => { | ||
return ( | ||
file: FileLocation, | ||
index?: FileLocation, | ||
adapterHint?: string, | ||
) => { | ||
const regexGuess = /\.gff3?$/i | ||
const adapterName = 'Gff3Adapter' | ||
const fileName = getFileName(file) | ||
const obj = { | ||
type: adapterName, | ||
gffLocation: file, | ||
} | ||
if (regexGuess.test(fileName) && !adapterHint) { | ||
return obj | ||
} else if (adapterHint === adapterName) { | ||
return obj | ||
} | ||
return adapterGuesser(file, index, adapterHint) | ||
} | ||
}, | ||
) | ||
Gff3TabixAdapterF(pluginManager) | ||
Gff3AdapterF(pluginManager) | ||
GuessGff3F(pluginManager) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { AdapterType } from '@jbrowse/core/pluggableElementTypes' | ||
import PluginManager from '@jbrowse/core/PluginManager' | ||
import configSchema from './configSchema' | ||
|
||
export default (pluginManager: PluginManager) => { | ||
pluginManager.addAdapterType( | ||
() => | ||
new AdapterType({ | ||
name: 'HicAdapter', | ||
configSchema, | ||
getAdapterClass: () => import('./HicAdapter').then(r => r.default), | ||
}), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
export { default as ReactComponent } from './components/HicRendering' | ||
export { default as configSchema } from './configSchema' | ||
export { default } from './HicRenderer' | ||
import PluginManager from '@jbrowse/core/PluginManager' | ||
|
||
import ReactComponent from './components/HicRendering' | ||
import configSchema from './configSchema' | ||
import HicRenderer from './HicRenderer' | ||
|
||
export default (pluginManager: PluginManager) => { | ||
pluginManager.addRendererType( | ||
() => | ||
new HicRenderer({ | ||
name: 'HicRenderer', | ||
ReactComponent, | ||
configSchema, | ||
pluginManager, | ||
}), | ||
) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import PluginManager from '@jbrowse/core/PluginManager' | ||
import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType' | ||
import { createBaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models' | ||
import configSchemaF from './configSchema' | ||
|
||
export default (pluginManager: PluginManager) => { | ||
pluginManager.addTrackType(() => { | ||
const configSchema = configSchemaF(pluginManager) | ||
return new TrackType({ | ||
name: 'HicTrack', | ||
configSchema, | ||
stateModel: createBaseTrackModel(pluginManager, 'HicTrack', configSchema), | ||
}) | ||
}) | ||
} |
Oops, something went wrong.