-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render gene with CDS subfeatures properly #2863
Conversation
@@ -25,7 +25,8 @@ function Box(props: { | |||
const { feature, region, config, featureLayout, bpPerPx, topLevel } = props | |||
const { start, end } = region | |||
const screenWidth = (end - start) / bpPerPx | |||
const { left = 0, width = 0 } = featureLayout.absolute | |||
const width = (feature.get('end') - feature.get('start')) / bpPerPx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is an interesting issue because I was not able to trust the feature layout's calculation of width. it might be that it needs further investigation
Codecov Report
@@ Coverage Diff @@
## main #2863 +/- ##
=======================================
Coverage 59.92% 59.92%
=======================================
Files 590 590
Lines 26573 26574 +1
Branches 6450 6450
=======================================
+ Hits 15923 15925 +2
+ Misses 10346 10345 -1
Partials 304 304
Continue to review full report at Codecov.
|
while the code is very workaround-y, it fixes a real issue and alternatives may require a fairly large refactoring. so, we could accept this as is perhaps larger refactoring might involve making a "Gene" glyph and only doing subsubfeatures for that, but that may require modifications to how chooseGlyph works and then only doing changes in vertical alignment on a Gene feature (currently on main it is sort of trying to add "gene-type glyphs in the middle of a transcript) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good, I agree we can do larger refactoring later if needed.
Possible fix for #1887
before
after
this feature has CDS subfeature so triggers "hasSubSub" in the util
There are a number of weird workarounds here, but it does solve the proximate problem
Sort of unrelated but I think it may be worth making the layout part of a pre-processing routine. The way the code makes the layout as a side product of rendering might not be ideal