Skip to content

Hwinata fix h padding - #190

Merged
whelena merged 4 commits into
mainfrom
hwinata-fix-h-padding
Aug 17, 2026
Merged

Hwinata fix h padding#190
whelena merged 4 commits into
mainfrom
hwinata-fix-h-padding

Conversation

@whelena

@whelena whelena commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Fix horizontal.padding for polygon plot use case, ensuring its translated to vertical.padding in horizontal fishplots.

Checklist

  • This PR does NOT contain Protected Health Information (PHI). A repo may need to be deleted if such data is uploaded.
    Disclosing PHI is a major problem1 - Even a small leak can be costly2.

  • This PR does NOT contain germline genetic data3, RNA-Seq, DNA methylation, microbiome or other molecular data4.

  • This PR does NOT contain other non-plain text files, such as: compressed files, images (e.g. .png, .jpeg), .pdf, .RData, .xlsx, .doc, .ppt, or other output files.

  To automatically exclude such files using a .gitignore file, see here for example.

  • I have read the code review guidelines and the code review best practice on GitHub check-list.

  • I have set up or verified the main branch protection rule following the github standards before opening this pull request.

  • The name of the branch is meaningful and well formatted following the standards, using [AD_username (or 5 letters of AD if AD is too long)]-[brief_description_of_branch].

  • I have added the major changes included in this pull request to the CHANGELOG.md under the next release version or unreleased, and updated the date.

Footnotes

  1. UCLA Health reaches $7.5m settlement over 2015 breach of 4.5m patient records

  2. The average healthcare data breach costs $2.2 million, despite the majority of breaches releasing fewer than 500 records.

  3. Genetic information is considered PHI.
    Forensic assays can identify patients with as few as 21 SNPs

  4. RNA-Seq, DNA methylation, microbiome, or other molecular data can be used to predict genotypes (PHI) and reveal a patient's identity.

@whelena
whelena requested a review from WuSelina May 18, 2026 17:05
@whelena
whelena merged commit 9acc0c4 into main Aug 17, 2026
7 checks passed
@whelena
whelena deleted the hwinata-fix-h-padding branch August 17, 2026 02:11
whelena added a commit that referenced this pull request Aug 17, 2026
test-linear.R built its plot with horizontal.padding = -1. That squeezed the
plot area until the gene annotations collapsed into unreadable coloured specks
and the axis tick labels crowded over the polygon -- the "test plots are not
right" symptom in issue #186. The fixture was the only place a negative
horizontal padding was exercised, so nothing else caught it.

Sweeping the parameter shows -1 and 0 both crush the annotations, 1 and 2
render them cleanly outside the polygon, and 3 pushes the axis titles off the
edge. Use 1, which keeps the pre-#190 layout (PGA left, SNV right, ticks
outside the plot) while leaving space between the polygon and the axes. The
gene labels TP53/CDKN2A/CSMD1/FHIT/TERT/MYC and NOTCH1/SOX2/TP63/PIK3CA/EGFR
are legible again.

Regenerate the snapshots. Comparing every stored grob against its predecessor
with compare.trees confirms only two changed: linear.example (this padding
change) and fish.example (the CCF axis is now flush with the polygon rather
than overhanging it, which is what "make axes flush against polygon" in #190
set out to do). The other nine are unchanged, so the regeneration accepted
nothing silently.

Two fixes to update-snapshots.R were needed to run it at all:

  * pkg.root used dirname(sys.frame(1)$ofile), which only resolves under
    source(). Invoked the documented way -- Rscript tests/update-snapshots.R --
    sys.frame(1) raised "not that many frames on the stack" and the script died
    before loading the package. Resolve the path from --file= first, fall back
    to sys.frames()[[1]]$ofile, then getwd().
  * Swap devtools::load_all for pkgload::load_all. devtools is not in Suggests
    and merely re-exports load_all from pkgload.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants