Skip to content
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

Hwinata test dendrogram #134

Merged
merged 61 commits into from
Aug 28, 2024
Merged

Hwinata test dendrogram #134

merged 61 commits into from
Aug 28, 2024

Conversation

whelena
Copy link
Collaborator

@whelena whelena commented Jul 27, 2024

Description

Edit dendrogram angle calculation such that angles are sepcified to give fixed x distances between leaf nodes.

Does not support mixed mode yet.

Closes #133

Analysis Results

Radial Mode

Screenshot 2024-07-26 at 5 08 39 PM

Dendrogram mode

Screenshot 2024-07-26 at 5 11 46 PM

Dendrogram with 1000 clones

Screenshot 2024-07-26 at 5 08 51 PM

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.

dan-knight and others added 30 commits May 10, 2024 10:32
…Visualization into hwinata-add-documentation
…lic-R-CancerEvolutionVisualization into hwinata-test-dendrogram
…lutionVisualization into hwinata-test-dendrogram
@dan-knight dan-knight changed the base branch from main to dendrogram August 1, 2024 00:06
@dan-knight
Copy link
Collaborator

I like the improvements to angle and x-distance calculation. These utility functions are great candidates for unit testing. I'll write a few unit tests while you make the fixes on documentation, etc.

R/add.segs.R Outdated
basex <- basex + dx + offset.x;
# basex <- basex + offset.x;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to keep this? I don't think we should leave commented-out code here as it will probably be unclear in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops yea, I probably just missed it while cleaning up the code

@@ -26,43 +23,118 @@ calculate.angles.radial <- function(v, tree, spread, total.angle) {
num.children <- length(child.ids);

if (num.children > 0) {
parent.angle <- angles[current.node.id];
parent.angle <- angles[tree$tip == current.node.id];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming you made this change to support arbitrary node IDs? (Rather than auto-generated, ordered IDs that can be indexed directly)

Copy link
Collaborator Author

@whelena whelena Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yaa, I initially change it because I thought a named list for angles might work better but i was worried it might get messed up since the tree$tip are also numeric. So the added code is actually reverting to original.

@whelena
Copy link
Collaborator Author

whelena commented Aug 1, 2024

@dan-knight Can you double check the merge, I think the dplyr dependency was not removed properly because the danknight-dplyr was too far behind the dendrogram branch. I tried converting it myself to remove the dplyr dependency but I'm running into other errors.

R/angles.R Outdated
@@ -2,14 +2,11 @@ calculate.angles.radial <- function(v, tree, spread, total.angle) {
root.node.id <- v$id[[1]];
node.ids <- c(root.node.id);

random.scale <- median(tree$length1) * spread;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this called "random" scale?

Copy link
Collaborator Author

@whelena whelena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me!

@@ -1,7 +1,7 @@
Package: CancerEvolutionVisualization
Title: Publication Quality Phylogenetic Tree Plots
Version: 3.0.0
Date: 2024-05-07
Version: 2.1.0
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we reverting back to 2.1?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I think Git was confused about which change took priority. I'll change it to 3.0.0.

@whelena whelena marked this pull request as ready for review August 28, 2024 20:03
@whelena
Copy link
Collaborator Author

whelena commented Aug 28, 2024

I reverted and fixed it to match the code standard of the rest of it.

@whelena
Copy link
Collaborator Author

whelena commented Aug 28, 2024

I reverted and fixed it to match the code standard of the rest of it.

@whelena whelena merged commit bcd41a7 into dendrogram Aug 28, 2024
5 checks passed
@whelena whelena deleted the hwinata-test-dendrogram branch August 28, 2024 20:19
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.

Dendrogram mode fails edge case with many clones
2 participants