Skip to content

Commit

Permalink
Merge branch 'main' into 2020_desktop_builds
Browse files Browse the repository at this point in the history
  • Loading branch information
elliothershberg authored Aug 6, 2021
2 parents 1f4ef55 + ba45e95 commit e63577f
Show file tree
Hide file tree
Showing 77 changed files with 2,137 additions and 238 deletions.
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
## 1.3.3 (2021-08-02)

<details><summary>Packages in this release</summary>
<p>

| Package | Download |
| --------------------------------------- | ---------------------------------------------------------------- |
| @jbrowse/core | https://www.npmjs.com/package/@jbrowse/core |
| @jbrowse/plugin-alignments | https://www.npmjs.com/package/@jbrowse/plugin-alignments |
| @jbrowse/plugin-breakpoint-split-view | |
| @jbrowse/plugin-circular-view | https://www.npmjs.com/package/@jbrowse/plugin-circular-view |
| @jbrowse/plugin-config | https://www.npmjs.com/package/@jbrowse/plugin-config |
| @jbrowse/plugin-data-management | https://www.npmjs.com/package/@jbrowse/plugin-data-management |
| @jbrowse/plugin-dotplot-view | |
| @jbrowse/plugin-filtering | |
| @jbrowse/plugin-gff3 | https://www.npmjs.com/package/@jbrowse/plugin-gff3 |
| @jbrowse/plugin-hic | |
| @jbrowse/plugin-legacy-jbrowse | https://www.npmjs.com/package/@jbrowse/plugin-legacy-jbrowse |
| @jbrowse/plugin-linear-comparative-view | |
| @jbrowse/plugin-linear-genome-view | https://www.npmjs.com/package/@jbrowse/plugin-linear-genome-view |
| @jbrowse/plugin-lollipop | |
| @jbrowse/plugin-menus | |
| @jbrowse/plugin-sequence | https://www.npmjs.com/package/@jbrowse/plugin-sequence |
| @jbrowse/plugin-spreadsheet-view | |
| @jbrowse/plugin-sv-inspector | |
| @jbrowse/plugin-svg | https://www.npmjs.com/package/@jbrowse/plugin-svg |
| @jbrowse/plugin-trackhub-registry | |
| @jbrowse/plugin-variants | https://www.npmjs.com/package/@jbrowse/plugin-variants |
| @jbrowse/plugin-wiggle | https://www.npmjs.com/package/@jbrowse/plugin-wiggle |
| @jbrowse/cli | https://www.npmjs.com/package/@jbrowse/cli |
| @jbrowse/desktop | |
| @jbrowse/react-linear-genome-view | https://www.npmjs.com/package/@jbrowse/react-linear-genome-view |
| @jbrowse/web | |

</p>
</details>

#### :rocket: Enhancement

- Other
- [#2127](https://github.com/GMOD/jbrowse-components/pull/2127) Add example dataset for COLO829 ([@cmdcolin](https://github.com/cmdcolin))
- `core`
- [#2141](https://github.com/GMOD/jbrowse-components/pull/2141) Update to @material-ui/core@4.12.2 ([@cmdcolin](https://github.com/cmdcolin))
- [#2126](https://github.com/GMOD/jbrowse-components/pull/2126) Allow opening plaintext .vcf files from the "Add track" workflow ([@cmdcolin](https://github.com/cmdcolin))

#### :bug: Bug Fix

- Other
- [#2159](https://github.com/GMOD/jbrowse-components/pull/2159) Stop local storage quota-exceeded errors preventing the app from starting ([@cmdcolin](https://github.com/cmdcolin))
- [#2161](https://github.com/GMOD/jbrowse-components/pull/2161) Remove outline from clicking on SVG chord tracks ([@cmdcolin](https://github.com/cmdcolin))
- [#2157](https://github.com/GMOD/jbrowse-components/pull/2157) Fix rendering of negative strand alignment modifications/methylation ([@cmdcolin](https://github.com/cmdcolin))
- [#2131](https://github.com/GMOD/jbrowse-components/pull/2131) Fix mouseovers/click handlers after "force load" button pressed ([@cmdcolin](https://github.com/cmdcolin))
- [#2128](https://github.com/GMOD/jbrowse-components/pull/2128) Fix using the "Color by modifications" setting on files that need ref renaming ([@cmdcolin](https://github.com/cmdcolin))
- [#2115](https://github.com/GMOD/jbrowse-components/pull/2115) Fix bug where sometimes plugin could not be removed from UI ([@garrettjstevens](https://github.com/garrettjstevens))
- [#2119](https://github.com/GMOD/jbrowse-components/pull/2119) Fix loading indicator on the reference sequence selector getting stuck ([@cmdcolin](https://github.com/cmdcolin))
- `core`
- [#2101](https://github.com/GMOD/jbrowse-components/pull/2101) Fix behavior of the end-of-list indicator in refNameAutocomplete to always display as a disabled item ([@teresam856](https://github.com/teresam856))

#### :house: Internal

- Other
- [#2152](https://github.com/GMOD/jbrowse-components/pull/2152) Remove storybook symlink workaround ([@garrettjstevens](https://github.com/garrettjstevens))
- `core`
- [#2099](https://github.com/GMOD/jbrowse-components/pull/2099) Use rbush data structure for layout of feature tracks ([@cmdcolin](https://github.com/cmdcolin))

#### Committers: 3

- Colin Diesh ([@cmdcolin](https://github.com/cmdcolin))
- Garrett Stevens ([@garrettjstevens](https://github.com/garrettjstevens))
- Teresa Martinez ([@teresam856](https://github.com/teresam856))

## 1.3.2 (2021-07-07)

<details><summary>Packages in this release</summary>
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.3.2",
"version": "1.3.3",
"npmClient": "yarn",
"useWorkspaces": true
}
36 changes: 35 additions & 1 deletion packages/core/PluginManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ export default class PluginManager {

rootModel?: AbstractRootModel

extensionPoints: Map<string, Function[]> = new Map()

constructor(initialPlugins: (Plugin | PluginLoadRecord)[] = []) {
// add the core plugin
this.addPlugin({ plugin: new CorePlugin(), metadata: { isCore: true } })
Expand Down Expand Up @@ -308,7 +310,7 @@ export default class PluginManager {
const typeRecord = this.getElementTypeRecord(groupName)

this.elementCreationSchedule.add(groupName, () => {
const newElement = creationCallback(this)
let newElement = creationCallback(this)
if (!newElement.name) {
throw new Error(`cannot add a ${groupName} with no name`)
}
Expand All @@ -319,6 +321,11 @@ export default class PluginManager {
)
}

newElement = this.evaluateExtensionPoint(
'Core-extendPluggableElement',
newElement,
) as PluggableElementType

typeRecord.add(newElement.name, newElement)
})

Expand Down Expand Up @@ -551,4 +558,31 @@ export default class PluginManager {
): this {
return this.addElementType('rpc method', creationCallback)
}

addToExtensionPoint<T>(
extensionPointName: string,
callback: (extendee: T) => T,
) {
let callbacks = this.extensionPoints.get(extensionPointName)
if (!callbacks) {
callbacks = []
this.extensionPoints.set(extensionPointName, callbacks)
}
callbacks.push(callback)
}

evaluateExtensionPoint(extensionPointName: string, extendee: unknown) {
const callbacks = this.extensionPoints.get(extensionPointName)
let accumulator = extendee
if (callbacks) {
for (const callback of callbacks) {
try {
accumulator = callback(accumulator)
} catch (error) {
console.error(error)
}
}
}
return accumulator
}
}
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jbrowse/core",
"version": "1.3.2",
"version": "1.3.3",
"description": "JBrowse 2 core libraries used by plugins",
"keywords": [
"jbrowse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const BaseViewModel = types
width: 800,
}))
.views((/* self */) => ({
get menuItems(): MenuItem[] {
menuItems(): MenuItem[] {
return []
},
}))
Expand Down
10 changes: 7 additions & 3 deletions packages/core/ui/FileSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ const FileLocationEditor = observer(
}}
aria-label="file or url picker"
>
<ToggleButton value="file" aria-label="local file">
File
</ToggleButton>
{new URLSearchParams(window.location.search).get(
'adminKey',
) ? null : (
<ToggleButton value="file" aria-label="local file">
File
</ToggleButton>
)}
<ToggleButton value="url" aria-label="url">
URL
</ToggleButton>
Expand Down
4 changes: 2 additions & 2 deletions packages/core/ui/ViewContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const ViewMenu = observer(
}) => {
const [anchorEl, setAnchorEl] = useState<HTMLElement>()

if (!(model.menuItems && model.menuItems.length)) {
if (!model.menuItems?.().length) {
return null
}

Expand Down Expand Up @@ -115,7 +115,7 @@ const ViewMenu = observer(
onClose={() => {
setAnchorEl(undefined)
}}
menuItems={model.menuItems}
menuItems={model.menuItems()}
/>
</>
)
Expand Down
2 changes: 1 addition & 1 deletion packages/core/util/tracks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export function guessAdapter(
type: 'VcfTabixAdapter',
vcfGzLocation: file,
index: {
location: index || makeIndex(file, 'tbi'),
location: index || makeIndex(file, '.tbi'),
indexType: makeIndexType(indexName, 'CSI', 'TBI'),
},
}
Expand Down
7 changes: 5 additions & 2 deletions packages/core/util/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export * from './util'
export interface AbstractViewContainer {
views: AbstractViewModel[]
removeView(view: AbstractViewModel): void
addView(typeName: string, initialState: Record<string, unknown>): void
addView(
typeName: string,
initialState: Record<string, unknown>,
): void | AbstractViewModel
}
export function isViewContainer(
thing: unknown,
Expand Down Expand Up @@ -119,7 +122,7 @@ export function isSessionModelWithConfigEditing(
/** abstract interface for a session that manages widgets */
export interface SessionWithWidgets extends AbstractSessionModel {
visibleWidget?: { id: string }
widgets?: unknown[]
widgets: Map<string, unknown>
addWidget(
typeName: string,
id: string,
Expand Down
2 changes: 1 addition & 1 deletion plugins/alignments/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jbrowse/plugin-alignments",
"version": "1.3.1",
"version": "1.3.3",
"description": "JBrowse 2 alignments adapters, tracks, etc.",
"keywords": [
"jbrowse",
Expand Down
47 changes: 32 additions & 15 deletions plugins/alignments/src/PileupRenderer/PileupRenderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -411,24 +411,41 @@ export default class PileupRenderer extends BoxRendererType {
if (i >= 0 && i < methBins.length) {
const l1 = regionSequence[i].toLowerCase()
const l2 = regionSequence[i + 1].toLowerCase()
// color
if (l1 === 'c' && l2 === 'g') {
const s = rstart + i
const [leftPx, rightPx] = bpSpanPx(s, s + 1, region, bpPerPx)
if (methBins[i]) {
ctx.fillStyle = 'red'
} else {
ctx.fillStyle = 'blue'

// if we are zoomed out, display just a block over the cpg
if (bpPerPx > 2) {
if (l1 === 'c' && l2 === 'g') {
const s = rstart + i
const [leftPx, rightPx] = bpSpanPx(s, s + 2, region, bpPerPx)
if (methBins[i] || methBins[i + 1]) {
ctx.fillStyle = 'red'
} else {
ctx.fillStyle = 'blue'
}
ctx.fillRect(leftPx, topPx, rightPx - leftPx + 0.5, heightPx)
}
ctx.fillRect(leftPx, topPx, rightPx - leftPx + 0.5, heightPx)
}
// if we are zoomed in, color the c inside the cpg
else {
// color
if (l1 === 'c' && l2 === 'g') {
const s = rstart + i
const [leftPx, rightPx] = bpSpanPx(s, s + 1, region, bpPerPx)
if (methBins[i]) {
ctx.fillStyle = 'red'
} else {
ctx.fillStyle = 'blue'
}
ctx.fillRect(leftPx, topPx, rightPx - leftPx + 0.5, heightPx)

const [leftPx2, rightPx2] = bpSpanPx(s + 1, s + 2, region, bpPerPx)
if (methBins[i + 1]) {
ctx.fillStyle = 'red'
} else {
ctx.fillStyle = 'blue'
const [leftPx2, rightPx2] = bpSpanPx(s + 1, s + 2, region, bpPerPx)
if (methBins[i + 1]) {
ctx.fillStyle = 'red'
} else {
ctx.fillStyle = 'blue'
}
ctx.fillRect(leftPx2, topPx, rightPx2 - leftPx2 + 0.5, heightPx)
}
ctx.fillRect(leftPx2, topPx, rightPx2 - leftPx2 + 0.5, heightPx)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/breakpoint-split-view/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jbrowse/plugin-breakpoint-split-view",
"version": "1.3.1",
"version": "1.3.3",
"description": "JBrowse 2 breakpoint detail split view",
"keywords": [
"jbrowse",
Expand Down
6 changes: 3 additions & 3 deletions plugins/breakpoint-split-view/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ export default function stateModelFactory(pluginManager: any) {
)
},

get menuItems(): MenuItem[] {
menuItems(): MenuItem[] {
const menuItems: MenuItem[] = []
self.views.forEach((view, idx) => {
if (view.menuItems) {
if (view.menuItems?.()) {
menuItems.push({
label: `View ${idx + 1} Menu`,
subMenu: view.menuItems,
subMenu: view.menuItems(),
})
}
})
Expand Down
2 changes: 1 addition & 1 deletion plugins/circular-view/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jbrowse/plugin-circular-view",
"version": "1.3.2",
"version": "1.3.3",
"description": "JBrowse 2 circular view",
"keywords": [
"jbrowse",
Expand Down
2 changes: 1 addition & 1 deletion plugins/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jbrowse/plugin-config",
"version": "1.3.1",
"version": "1.3.3",
"description": "JBrowse 2 config utilities",
"keywords": [
"jbrowse",
Expand Down
2 changes: 1 addition & 1 deletion plugins/data-management/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jbrowse/plugin-data-management",
"version": "1.3.1",
"version": "1.3.3",
"description": "JBrowse 2 linear genome view",
"keywords": [
"jbrowse",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function LockedPlugin() {
return (
<Tooltip
style={{ marginRight: '0.5rem' }}
title="This plugin was installed by an admin. It cannot be removed."
title="This plugin was installed by an administrator, you cannot remove it."
>
<LockIcon />
</Tooltip>
Expand Down
Loading

0 comments on commit e63577f

Please sign in to comment.