AssemblyManager
Auto-generated @jbrowse/mobx-state-tree API for the current JBrowse release — see pluggable elements for concepts. Built into JBrowse core. View source.
Properties
| Member | Description |
|---|---|
assembliesassemblies: types.array(assemblyFactory(conf, pm)) | this is automatically managed by an autorun which looks in the parent session.assemblies, session.sessionAssemblies, and session.temporaryAssemblies |
Volatiles
| Member | Description |
|---|---|
unrecognizedReportsunrecognizedReports: createUnrecognizedAssemblyReports() | rate limiter for get's Core-handleUnrecognizedAssembly reports, so each unknown name reaches the extension point once per session |
Getters
| Member | Description |
|---|---|
| assemblyNameMap | |
assemblyNamesListstring[] | read via readConfObject, matching how the afterAttach autorun names the assemblies it creates: get() treats a name found here as "a config exists, its model is just not built yet", so the two must agree |
configuredAssemblyNamesSet<string> | Every name the configs answer to — each assembly's name and its aliases. What has knows before the models exist.Separate from assemblyNamesList rather than widening it: get treats a name found in that list as "a config exists, its model is just not built yet", which has to stay the canonical name the autorun will create the assembly under. A Set because has is called per name by per-render scans over every track in the session. |
assemblyListAnyConfigurationModel[] | combined jbrowse.assemblies, session.sessionAssemblies, and session.temporaryAssemblies |
rpcManagerRpcManager |
Methods
| Member | Description |
|---|---|
getCanonicalAssemblyName(asmName: string) => string | |
getDisplayName(asmName: string) => string | |
| get | The assembly asmName names, or undefined. Reports a name it doesn't know to Core-handleUnrecognizedAssembly so a plugin can go supply it, which is a side effect: a caller only asking whether the session has the assembly wants has instead. Each name is reported at most once per session, since a handler resolves it out of band and the assembly turning up is itself the reactive signal. |
has(asmName: string) => boolean | Whether the session knows this assembly. Use this, not get, to ask only whether the assembly is present: !has(name) is exactly the condition under which get reports name to Core-handleUnrecognizedAssembly, so probing with get tells every installed plugin to go resolve a name that a caller supplying the assembly itself (a hub connection, MAF row navigation) is about to create. |
| loadingAssembly | The first of asmNames that hasn't finished loading — the one a view blocked on them is waiting for, and whose statusMessage / statusProgress its spinner should show. Returns the assembly itself (a stable reference, so a consuming getter doesn't invalidate on every read) or undefined once they are all loaded. |
settleAssemblyResolution(assemblyName: string) => Promise<void> | Wait out whatever might still be about to supply assemblyName, and resolve once nothing is.Resolution is a chain of events, not a duration: a handler probes and adds a connection, the connection fetches a config, the config's assemblies land in the session. Each link is observable, so each is waited on rather than guessed at. - the handler's own promise, if it returned one, covers the part before the session gains anything to watch (the hubs plugin's HEAD probe) - any connection still fetching could be carrying the assembly, so its loading flag going false is the next event. Every loading connection counts, not just one naming this assembly: a connection config need not declare what it will turn out to provide, and waiting for one connection too many costs a moment while missing one returns the wrong answer.A handler that returned nothing gets UNDECLARED_HANDLER_GRACE_MS instead, because it left nothing to wait on. |
| waitForAssembly | use this method instead of assemblyManager.get(assemblyName) to get an assembly with regions loaded |
| requireAssembly | waitForAssembly, but a name that cannot be resolved is an error rather than an undefined for the caller to interpret.Use it where a missing assembly produces a wrong result with no error. A refName map is one case: an empty map means an adapter gets queried with un-renamed refNames, finds nothing, and the track draws blank. Throwing here shows the assembly name to the user, who can add the assembly or fix the track. waitForAssembly returns only once every handler and connection that could supply the name has finished, so an unresolved name here is final and throwing does not race a late load. |
| getRefNameMapForAdapter | The refName map for an adapter under assemblyName. Throws if the assembly cannot be resolved — see requireAssembly. No assemblyName at all is not a failure, just nothing to rename. |
isValidRefName(refName: string, assemblyName: string) => boolean |
Actions
| Member | Description |
|---|---|
| removeAssembly | private: you would generally want to add to manipulate jbrowse.assemblies, session.sessionAssemblies, or session.temporaryAssemblies instead of using this directly |
addAssembly(configuration: any) => void | private: you would generally want to add to manipulate jbrowse.assemblies, session.sessionAssemblies, or session.temporaryAssemblies instead of using this directly this can take an active instance of an assembly, in which case it is referred to, or it can take an identifier e.g. assembly name, which is used as a reference. snapshots cannot be used |