Skip to content

Commit

Permalink
Fix bug where multi-quantitative tracks plotted incorrectly for some …
Browse files Browse the repository at this point in the history
…bigwigs with empty regions (#3839)
  • Loading branch information
cmdcolin authored Aug 9, 2023
1 parent 1c43657 commit 6f1fa62
Show file tree
Hide file tree
Showing 9 changed files with 476 additions and 462 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ exports[`ConfigurationEditor widget renders all the different types of built-in
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-j204z7-MuiFormControlLabel-root"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-12wnr2w-MuiButtonBase-root-MuiCheckbox-root"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary css-12wnr2w-MuiButtonBase-root-MuiCheckbox-root"
>
<input
checked=""
Expand Down Expand Up @@ -1803,7 +1803,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-j204z7-MuiFormControlLabel-root"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-12wnr2w-MuiButtonBase-root-MuiCheckbox-root"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-root MuiCheckbox-colorPrimary css-12wnr2w-MuiButtonBase-root-MuiCheckbox-root"
>
<input
class="PrivateSwitchBase-input css-1m9pwf3"
Expand Down Expand Up @@ -1910,7 +1910,7 @@ exports[`ConfigurationEditor widget renders with defaults of the PileupTrack sch
class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-j204z7-MuiFormControlLabel-root"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-12wnr2w-MuiButtonBase-root-MuiCheckbox-root"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-root MuiCheckbox-colorPrimary css-12wnr2w-MuiButtonBase-root-MuiCheckbox-root"
>
<input
class="PrivateSwitchBase-input css-1m9pwf3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ exports[`renders with a couple of categorized tracks 1`] = `
data-mui-internal-clone-element="true"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-root MuiCheckbox-colorPrimary css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
>
<input
class="PrivateSwitchBase-input css-1m9pwf3"
Expand Down Expand Up @@ -477,7 +477,7 @@ exports[`renders with a couple of categorized tracks 1`] = `
data-mui-internal-clone-element="true"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
>
<input
checked=""
Expand Down Expand Up @@ -625,7 +625,7 @@ exports[`renders with a couple of categorized tracks 1`] = `
data-mui-internal-clone-element="true"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
>
<input
checked=""
Expand Down Expand Up @@ -876,7 +876,7 @@ exports[`renders with a couple of uncategorized tracks 1`] = `
data-mui-internal-clone-element="true"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-root MuiCheckbox-colorPrimary css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
>
<input
class="PrivateSwitchBase-input css-1m9pwf3"
Expand Down Expand Up @@ -953,7 +953,7 @@ exports[`renders with a couple of uncategorized tracks 1`] = `
data-mui-internal-clone-element="true"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
>
<input
checked=""
Expand Down Expand Up @@ -1031,7 +1031,7 @@ exports[`renders with a couple of uncategorized tracks 1`] = `
data-mui-internal-clone-element="true"
>
<span
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary MuiCheckbox-sizeMedium css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
class="MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root MuiCheckbox-root MuiCheckbox-colorPrimary Mui-checked MuiCheckbox-root MuiCheckbox-colorPrimary css-5qvvf1-MuiButtonBase-root-MuiCheckbox-root-compactCheckbox"
>
<input
checked=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ exports[`renders with the available plugins 1`] = `
class="MuiTypography-root MuiTypography-h5 css-1ldbtdh-MuiTypography-root"
>
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-6z5vhu-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-ygjubp-MuiTypography-root-MuiLink-root"
href="https://github.com/GMOD/jbrowse-plugin-msaview#readme"
rel="noopener"
target="_blank"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports[`<AboutWidget /> renders 1`] = `
JBrowse is a
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1xylxj1-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1bhi0za-MuiTypography-root-MuiLink-root"
href="http://gmod.org/"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -45,7 +45,7 @@ exports[`<AboutWidget /> renders 1`] = `
<ul>
<li>
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1xylxj1-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1bhi0za-MuiTypography-root-MuiLink-root"
href="http://google.com"
rel="noopener noreferrer"
target="_blank"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ exports[`<HelpWidget /> renders 1`] = `
<ul>
<li>
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1xylxj1-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1bhi0za-MuiTypography-root-MuiLink-root"
href="https://github.com/GMOD/jbrowse-components/discussions"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -30,7 +30,7 @@ exports[`<HelpWidget /> renders 1`] = `
</li>
<li>
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1xylxj1-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1bhi0za-MuiTypography-root-MuiLink-root"
href="https://github.com/GMOD/jbrowse-components/issues/new/choose"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -40,7 +40,7 @@ exports[`<HelpWidget /> renders 1`] = `
</li>
<li>
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1xylxj1-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1bhi0za-MuiTypography-root-MuiLink-root"
href="https://jbrowse.org/jb2/docs/user_guide"
rel="noopener noreferrer"
target="_blank"
Expand All @@ -50,7 +50,7 @@ exports[`<HelpWidget /> renders 1`] = `
</li>
<li>
<a
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1xylxj1-MuiTypography-root-MuiLink-root"
class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1bhi0za-MuiTypography-root-MuiLink-root"
href="https://jbrowse.org/jb2/docs/"
rel="noopener noreferrer"
target="_blank"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class MultiXYPlotRenderer extends WiggleBaseRenderer {
const { bpPerPx, sources, regions, features } = props
const [region] = regions
const groups = groupBy([...features.values()], f => f.get('source'))
const height = props.height / Object.keys(groups).length
const height = props.height / sources.length
const width = (region.end - region.start) / bpPerPx
let feats = [] as Feature[]
ctx.save()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default class MultiRowLineRenderer extends WiggleBaseRenderer {
const { bpPerPx, sources, regions, features } = props
const [region] = regions
const groups = groupBy([...features.values()], f => f.get('source'))
const height = props.height / Object.keys(groups).length
const height = props.height / sources.length
const width = (region.end - region.start) / bpPerPx
let feats = [] as Feature[]
ctx.save()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class MultiXYPlotRenderer extends WiggleBaseRenderer {
const { bpPerPx, sources, regions, features } = props
const [region] = regions
const groups = groupBy([...features.values()], f => f.get('source'))
const height = props.height / Object.keys(groups).length
const height = props.height / sources.length
const width = (region.end - region.start) / bpPerPx
const Color = await import('color').then(f => f.default)
let feats = [] as Feature[]
Expand Down
Loading

0 comments on commit 6f1fa62

Please sign in to comment.