Add ped cleaner#5
Merged
Merged
Conversation
added 3 commits
May 13, 2026 16:39
…ividual help content for each module
There was a problem hiding this comment.
Pull request overview
Adds a Pedigree Cleaner workflow, reorganizes app navigation/help content around pedigree and composition tools, and updates shared UI styling/resources.
Changes:
- Adds
mod_ped_cleanerplus dedicated help content for Pedigree Cleaner, SNMF, and PolyBreedTools. - Reworks app sidebar/tab wiring and removes the Genomic Diversity module from the active app.
- Adds custom CSS/JS for dashboard theming and card/tab behavior.
Reviewed changes
Copilot reviewed 17 out of 22 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
R/mod_SNMF.R |
Adds module help button and image export support; mostly reformats existing SNMF UI/server. |
R/mod_polybreedtools.R |
Adds help button/content integration and reorganizes UI layout. |
R/mod_ped_cleaner.R |
New Pedigree Cleaner UI/server module. |
R/mod_Home.R |
Removes/comment-disables the tutorials value box. |
R/mod_help.R |
Replaces old help page with accordion-based help for new supported modules. |
R/mod_diversity.R |
Deletes the Genomic Diversity module. |
R/help_SNMF.R |
Adds reusable SNMF help content. |
R/help_polybreedtools.R |
Adds reusable PolyBreedTools help content. |
R/help_ped_cleaner.R |
Adds reusable Pedigree Cleaner help content. |
R/app_ui.R |
Adds Pedigree Cleaner tab, updates sidebar/menu/source link, and injects CSS/JS. |
R/app_server.R |
Wires Pedigree Cleaner and Help servers; removes active Diversity server wiring. |
NAMESPACE |
Removes unused includeMarkdown import. |
inst/app/www/custom.js |
Adds card-header collapse behavior and tab active-state sync. |
inst/app/www/custom.css |
Adds dashboard color/theme overrides and UI styling. |
inst/.gitignore |
Ignores an SNMF test VCF under inst. |
.Rhistory |
Updates tracked interactive R history. |
.Rbuildignore |
Adds local AI tool directories to build ignore. |
.gitignore |
Ignores .positai. |
Comments suppressed due to low confidence (1)
R/mod_SNMF.R:759
- The exported ancestry plot is rebuilt independently from
output$snmf_q_plot, duplicating the reshape/theme logic. Sharing a single plot helper would prevent the downloaded image from diverging from the on-screen plot when future changes are made.
q <- q_matrix()
df <- data.frame(ID = rownames(q), q, check.names = FALSE)
q_cols <- colnames(q)
long <- stats::reshape(df, varying = q_cols, v.names = "Q", timevar = "Cluster",
times = q_cols, direction = "long")
long$ID <- factor(long$ID, levels = unique(df$ID))
long$Cluster <- factor(long$Cluster, levels = q_cols)
ggplot(long, ggplot2::aes(x = ID, y = Q, fill = Cluster)) +
geom_col(width = 0.9) +
scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
labs(x = "Individual", y = "Ancestry proportion", fill = "Cluster") +
theme_minimal() +
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 1, size = 8),
panel.grid.major.x = element_blank())
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…/familia into add_ped_cleaner
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 23 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
R/mod_ped_cleaner.R:235
shinyjs::enable("download_results")will not work reliably in a module because the actual DOM id is namespaced. Enable the button using the namespaced id (e.g.,shinyjs::enable(session$ns("download_results"))) so downloads are re-enabled after a successful run.
shinyWidgets::updateProgressBar(
session = session, id = "pb_ped",
value = 100, status = "success",
title = "Finished"
)
shinyjs::enable("download_results")
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 23 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
R/mod_ped_cleaner.R:398
- These section titles are hard-coded as "Conflicting Trios Resolved" even though correction is optional. If the user disables correction, the table should not be labeled as "resolved" (same for any other conditionally-corrected issue types). Suggest making the title conditional on the run settings or using a neutral label like "Conflicting Trios".
render_if("Exact Duplicates Removed", report$exact_duplicates)
render_if("Conflicting Trios Resolved", report$conflicting_trios)
render_if("Inconsistent Sex Roles", report$inconsistent_sex_roles)
render_if("Missing Parents Added", report$missing_parents)
Comment on lines
+236
to
+244
| validation_raw <- utils::read.table(input$validation_file$datapath, header = TRUE, sep = "\t") | ||
| # NA filtering: validation samples (rows) with < 50% marker call rate | ||
| validation_markers <- validation_raw[, colnames(validation_raw) != "ID", drop = FALSE] | ||
| sample_call_rate <- rowSums(!is.na(validation_markers)) / ncol(validation_markers) | ||
| removed_samples <- validation_raw$ID[sample_call_rate < 0.5] | ||
| validation_filtered <- validation_raw[sample_call_rate >= 0.5, , drop = FALSE] | ||
| if (nrow(validation_filtered) == 0) { | ||
| stop("No validation samples remain after filtering for genotyping rate >= 50%.") | ||
| } |
Comment on lines
+452
to
+458
| # Palette fix: brewer palete allows up to 9 colors but we need 10 | ||
| palette_name <- input$snmf_color_choice %||% "Set1" | ||
| palette_info <- RColorBrewer::brewer.pal.info[palette_name, , drop = FALSE] | ||
| max_colors <- palette_info$maxcolors[[1]] | ||
| n_base <- max(3L, max_colors) # brewer.pal requires n >= 3 | ||
| base_colors <- RColorBrewer::brewer.pal(n_base, palette_name) | ||
| fill_colors <- grDevices::colorRampPalette(base_colors)(length(q_cols)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
added ped_cleaner, css and restructured help module and sections