Skip to content

Development - #20

Merged
Cristianetaniguti merged 50 commits into
mainfrom
development
Nov 5, 2026
Merged

Cristianetaniguti merged 50 commits into
mainfrom
development

Conversation

@Cristianetaniguti

Copy link
Copy Markdown
Collaborator

Many changes. See NEWs.md

  • current version 1.16.1
  • update to 1.24.0

Copilot AI balanced review requested due to automatic review settings November 5, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Sex-chromosome parsing collapses X/Y identifiers to missing values, allowing markers from different chromosomes to be incorrectly associated with the same segment.

9 open issues
What changed in this PR

Updates Qploidy2 from 1.16.1 to 1.24.0, expanding its copy-number analysis workflow with reference-based standardization, sex-chromosome support, and additional filtering and integration tools.

Changes:

  • Adds sample and cluster filtering, reference-based z-scores, background removal, and safer segmentation.
  • Extends HMM fitting, sex-aware karyotypes, result classification, and import/export support.
  • Updates tests, API documentation, tutorials, and Claude Code setup guidance.
File Description
tests/​testthat/​test-standardization.R Tests reference z-scores and updated summaries.
tests/​testthat/​test-re_standardize.R Updates expected copy-number counts.
tests/​testthat/​test-karyotype.R Adds sex-chromosome inference and plotting tests.
tests/​testthat/​test-hmm_cn.R Expands HMM argument and windowing coverage.
README.md Adds nQuack tutorial and Claude setup guidance.
R/​zscore_segmentation.R Adds chromosome-specific minima and segmentation safeguards.
R/​utils.R Whitespace-only change.
R/​standardization.R Adds filtering and reference-based depth normalization.
R/​standardization_utils.R Adds cluster thresholds and background removal.
R/​split_mk_type.R Classifies markers by sub-genome signal.
R/​segre_test_cnv.R Normalizes punctuation in comments and documentation.
R/​prepare.R Allows non-genotype VCF reads without GT.
R/​plots_standardization.R Updates theta labels and facet formatting.
R/​plot_raw.R Updates theta labels and model-selection defaults.
R/​plot_karyotype.R Supports sex chromosomes, reliability coloring, and masked calls.
R/​pca_plot.R Normalizes documentation punctuation.
R/​merge_qploidy_data.R Normalizes comments and documentation punctuation.
R/​karyotype_notation.R Adds sex inference and expected chromosome dosages.
R/​install_claude_skills.R Downloads workflow guidance into projects.
R/​filter_hmm_CN.R Adds quality masking and sample classification.
R/​export_results.R Groups summary helpers and adds MAPpoly/PennCNV interoperability.
R/​em_hmm_cn.R Revises emissions, priors, and single-window handling.
R/​call_dosages.R Updates heterozygosity defaults.
R/​BAF_distributions.R Updates BAF model-selection defaults.
NAMESPACE Registers new exports, methods, and imports.
man/​test_cn_segregation.Rd Normalizes documentation punctuation.
man/​summarize_cn_mode.Rd Updates the documentation source pointer.
man/​standardize.Rd Documents new filtering options.
man/​split_mk_type.Rd Documents sub-genome marker classification.
man/​simulate_cn_segregation.Rd Normalizes documentation punctuation.
man/​select_best_raw_model.Rd Updates documented heterozygosity defaults.
man/​select_best_baf_model.Rd Updates documented model-selection defaults.
man/​segreg_poly_cn.Rd Normalizes documentation punctuation.
man/​remove_background_noise.Rd Documents background-signal filtering.
man/​re_standardize.Rd Documents filtering options and revised defaults.
man/​print.count_types.Rd Documents classification summary printing.
man/​plot_xy_with_ploidy_guides.Rd Normalizes documentation punctuation.
man/​plot_tested_cn_segregation.Rd Normalizes example notation.
man/​plot_karyotype.Rd Documents reliability coloring and sex chromosomes.
man/​plot_cn_track_by_type.Rd Documents grouped batch plot export.
man/​plot_baf_with_ploidy_guides.Rd Normalizes documentation punctuation.
man/​pca_plot.Rd Normalizes documentation punctuation.
man/​merge_qploidy_datas.Rd Normalizes documentation punctuation.
man/​merge_cn_summary_with_estimates.Rd Updates the documentation source pointer.
man/​karyotype_notation.Rd Documents sex-aware notation and expected dosages.
man/​install_claude_skills.Rd Documents workflow guidance installation.
man/​import_penncnv_results.Rd Documents PennCNV result import.
man/​hmm_estimate_CN.Rd Documents expanded HMM controls and emissions.
man/​hmm_estimate_CN_nQuack.Rd Documents the nQuack-based estimation route.
man/​hmm_estimate_CN_multi.Rd Clarifies forwarding of sex settings.
man/​get_zscore.Rd Documents reference-sample normalization.
man/​get_centers.Rd Documents minimum cluster sizes.
man/​get_baf.Rd Normalizes reference punctuation.
man/​filter_hmm_CN.Rd Documents quality thresholds and masking.
man/​export_mappoly.Rd Documents chromosome-level MAPpoly export.
man/​em_hmm_cn.Rd Documents BAF-only fitting and prior updates.
man/​count_types.Rd Documents ploidy classification and sex settings.
man/​convert2nQuack.Rd Documents standardized-BAF conversion and filtering.
man/​compute_baf_likelihoods.Rd Updates documented heterozygosity defaults.
man/​compare_cn_track.Rd Updates source pointer, colors, and confidence description.
man/​compare_cn_track_summary.Rd Documents multi-sample copy-number overview plots.
man/​call_hmm_dosages.Rd Updates documented heterozygosity defaults.
man/​call_BAF_nQuack_dosages.Rd Documents internal nQuack dosage assignment.
man/​add_changepoint_windows.Rd Documents chromosome-specific segment minima.
docs/​BIcolors_template.css Restyles inline code with light backgrounds.
DESCRIPTION Bumps version and adds the nQuack dependency.
.Rbuildignore Excludes Claude configuration and OAuth files.
.claude/​agents/​qploidy2-input-prep.md Adds input-preparation workflow guidance.

Review effort: Balanced

Comment thread R/export_results.R Resolved
Comment thread R/em_hmm_cn.R
} else if (baf_only) {
llb <- ll_baf_matrix[,k]
if(correct_scale) llb <- ifelse(n_baf > 0, llb / n_baf, 0) # n_baf == 0 would otherwise divide to NaN/Inf
llb[!is.finite(llb)] <- 0
Comment thread R/export_results.R
g <- dat[idx, , drop = FALSE]
row <- list(
Sample = g$Sample[1],
CN_mode = mode(g[[cn_col]]),
Comment thread R/install_claude_skills.R
Comment on lines +55 to +61
tryCatch({
utils::download.file(url, destfile = dest_file, quiet = TRUE)
message("Installed: ", dest_file)
installed <- c(installed, dest_file)
}, error = function(e) {
warning("Failed to download ", skill, ": ", conditionMessage(e))
})
Comment thread R/karyotype_notation.R
Comment on lines +325 to +326
tbl$Sex <- ifelse(!valid, NA_character_,
ifelse(has_het == (sex_system == "XY"), "male", "female"))
Comment thread R/standardization.R
rm_outlier = rm_outlier,
cluster_median = cluster_median)
cluster_median = cluster_median,
min_samples_by_cluster = min_samples_by_cluster)
Comment thread R/standardization.R
# Z score
vmsg("Generating z scores", verbose = verbose, level = 0, type = ">>")
# Z-score mean/sd come from the reference samples in genos only
reference.samples <- unique(genos$SampleName)
Comment thread R/standardization.R
Comment on lines +826 to +830
"ploidy.standardization (%d) differs from the mode of CN_call in dosages (%d). This may lead to unexpected results. ploidy.standardization is set to %d.",
ploidy.standardization, mode(hmm_CN_multi$by_marker$CN_call), mode(hmm_CN_multi$by_marker$CN_call)
))
ploidy.standardization <- mode(hmm_CN_multi$by_marker$CN_call)
if(verbose) cat("Using ploidy.standardization:", ploidy.standardization, "\n")
Comment thread R/zscore_segmentation.R
Comment on lines +136 to +137
seg_len <- min(chr_minseglen, floor(length(z) / 2))
if (!is.finite(seg_len) || seg_len < 1) seg_len <- 1L
@Cristianetaniguti
Cristianetaniguti merged commit 7e942a1 into main Nov 5, 2026
11 checks passed
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