Skip to content

Add parentage functions#55

Closed
josuechinchilla wants to merge 52 commits intomainfrom
add_parentage_functions
Closed

Add parentage functions#55
josuechinchilla wants to merge 52 commits intomainfrom
add_parentage_functions

Conversation

@josuechinchilla
Copy link
Copy Markdown
Collaborator

Added 2 parentage functions along with the test files and updated package giles to include updates

Cristianetaniguti and others added 30 commits October 3, 2025 15:11
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 <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@josuechinchilla
Copy link
Copy Markdown
Collaborator Author

requested pull to main by mistake. Closed.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds new parentage and MADC→VCF utilities, expands MADC sanity-checking, and significantly extends the package test suite/documentation for these workflows.

Changes:

  • Introduces new parentage functions (validate_pedigree(), find_parentage()) plus tests.
  • Adds madc2vcf_multi() (polyRAD pipeline) and expands MADC preprocessing/sanity checks and count extraction options.
  • Updates existing utilities/docs/tests (e.g., filterVCF(), imputation_concordance(), CI deps, NEWS/DESCRIPTION/NAMESPACE).

Reviewed changes

Copilot reviewed 38 out of 39 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
R/validate_pedigree.R New trio validation + correction outputs
R/find_parentage.R New parentage assignment (single-parent + best-pair)
R/madc2vcf_multi.R New MADC→VCF conversion via polyRAD
R/check_madc_sanity.R New MADC sanity-check function + check_botloci()
R/get_countsMADC.R Extends count extraction to accept in-memory MADC + collapse matches
R/imputation_concordance.R Adds plotting/printing options + doc expansion
R/filterVCF.R Adds optional pre-filter quality metrics output
R/check_ped.R Refactors pedigree checking and reporting behavior
R/utils.R Adds vmsg() + url_exists() helper
tests/testthat/test-validate_pedigree.R New validate_pedigree tests
tests/testthat/test-find_parentage.R New find_parentage tests
tests/testthat/test-madc2vcf_targets.R Expands tests for REF/ALT recovery + external fixture coverage
tests/testthat/test-madc2vcf_all.R Expands tests for madc2vcf_all (external fixtures)
tests/testthat/test-madc2vcf_multi.R Adds tests for madc2vcf_multi (external fixtures)
tests/testthat/test-check_madc_sanity.R Adds tests for check_madc_sanity()
tests/testthat/test-check_ped.R Updates expectations for revised check_ped() output
tests/testthat/test-imputation_concordance.R Minor whitespace cleanup
man/validate_pedigree.Rd New docs for validate_pedigree
man/find_parentage.Rd New docs for find_parentage
man/madc2vcf_multi.Rd New docs for madc2vcf_multi
man/check_madc_sanity.Rd New docs for check_madc_sanity
man/vmsg.Rd New docs for vmsg
man/get_countsMADC.Rd Updates docs for new get_countsMADC signature
man/get_counts.Rd New internal docs for get_counts
man/madc2vcf_targets.Rd Updates docs for new args/behavior
man/madc2vcf_all.Rd Updates docs for required args + others/markers_info
man/imputation_concordance.Rd Updates docs for new args/return semantics
man/filterVCF.Rd Documents new quality.rates argument
man/check_ped.Rd Updates docs for revised check_ped behavior
NEWS.md Adds release notes for 0.7.0 and interim versions
DESCRIPTION Bumps version; updates imports/suggests + metadata
NAMESPACE Exports new functions + imports ggplot2/data.table symbols
.github/workflows/R-CMD-check.yaml Installs new suggested deps in CI
.gitignore Ignores .DS_Store
BIGr.Rproj Adds ProjectId

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread R/validate_pedigree.R
Comment on lines +131 to +139
genos_mat <- as.matrix(genos, rownames = "ID")

# Create homozygous-only matrix for parent analysis
genos_hom <- copy(genos)
marker_cols <- setdiff(names(genos_hom), "ID")
for (col in marker_cols) {
genos_hom[get(col) == 1, (col) := NA_integer_]
}
genos_hom_mat <- as.matrix(genos_hom, rownames = "ID")
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

as.matrix(genos, rownames = "ID") (and the similar call for genos_hom) is not a valid base R as.matrix() usage for a data.frame/data.table and will error because the rownames argument is not supported. Build the matrix from marker columns and then set rownames(mat) <- genos$ID (and likewise for genos_hom).

Suggested change
genos_mat <- as.matrix(genos, rownames = "ID")
# Create homozygous-only matrix for parent analysis
genos_hom <- copy(genos)
marker_cols <- setdiff(names(genos_hom), "ID")
for (col in marker_cols) {
genos_hom[get(col) == 1, (col) := NA_integer_]
}
genos_hom_mat <- as.matrix(genos_hom, rownames = "ID")
marker_cols <- setdiff(names(genos), "ID")
genos_mat <- as.matrix(genos[, ..marker_cols])
rownames(genos_mat) <- genos$ID
# Create homozygous-only matrix for parent analysis
genos_hom <- copy(genos)
for (col in marker_cols) {
genos_hom[get(col) == 1, (col) := NA_integer_]
}
genos_hom_mat <- as.matrix(genos_hom[, ..marker_cols])
rownames(genos_hom_mat) <- genos_hom$ID

Copilot uses AI. Check for mistakes.
Comment thread R/validate_pedigree.R
comparisons <- sum(!is.na(cand_hom) & !is.na(prog_hom))
if (comparisons == 0) return(NA_real_)
(sum(cand_hom != prog_hom, na.rm = TRUE) / comparisons) * 100
})
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

find_best_parent() uses which.min(errors) without handling the case where all candidate error rates are NA (e.g., no comparable homozygous markers for any candidate). In that case which.min() returns integer(0) and indexing candidates[best_idx] yields character(0), which can break downstream assignments. Add an explicit if (all(is.na(errors))) early return with NA id/error_pct.

Suggested change
})
})
if (all(is.na(errors))) return(list(id = NA_character_, error_pct = NA_real_))

Copilot uses AI. Check for mistakes.
Comment on lines +217 to +230
test_that("error_threshold out of range raises an error", {
f <- write_temp_files()
expect_error(validate_pedigree(f$ped, f$genos, error_threshold = 150,
verbose = FALSE, write_txt = FALSE))
expect_error(validate_pedigree(f$ped, f$genos, error_threshold = -1,
verbose = FALSE, write_txt = FALSE))
})

test_that("homozygous_threshold out of range raises an error", {
f <- write_temp_files()
expect_error(validate_pedigree(f$ped, f$genos, homozygous_threshold = 101,
verbose = FALSE, write_txt = FALSE))
expect_error(validate_pedigree(f$ped, f$genos, homozygous_threshold = -5,
verbose = FALSE, write_txt = FALSE))
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

The tests call validate_pedigree(..., error_threshold=...) and homozygous_threshold=..., but the function signature uses trio_error_threshold and single_parent_error_threshold. This will currently fail with “unused argument” errors. Update the tests to use the correct argument names, or add backwards-compatible aliases in validate_pedigree().

Copilot uses AI. Check for mistakes.
Comment thread R/find_parentage.R

#### Logic for Best Pair Method ####
if (method == "best.pair") {
genos_mat <- as.matrix(genos, rownames = "ID")
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

as.matrix(..., rownames = "ID") is not supported for data.frame/data.table and will error. Convert only the marker columns to a matrix and then set rownames() from the ID column (same for genos_hom and for the genos_mat used in the best.pair branch).

Suggested change
genos_mat <- as.matrix(genos, rownames = "ID")
genos_mat <- as.matrix(genos[, !names(genos) %in% "ID", with = FALSE])
rownames(genos_mat) <- genos$ID

Copilot uses AI. Check for mistakes.
Comment thread R/find_parentage.R
Comment on lines +129 to +130
sire_candidates <- all_parents[Sex %in% c("M", "A", "NA"), .SD]
dam_candidates <- all_parents[Sex %in% c("F", "A", "NA")]
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

Sex %in% c("M", "A", "NA") will not keep rows where Sex is actually NA (missing), because NA %in% ... evaluates to NA and filters out. If the intent is to treat missing sex as ambiguous, include an is.na(Sex) branch (or set missing Sex to "A" after toupper).

Suggested change
sire_candidates <- all_parents[Sex %in% c("M", "A", "NA"), .SD]
dam_candidates <- all_parents[Sex %in% c("F", "A", "NA")]
sire_candidates <- all_parents[is.na(Sex) | Sex %in% c("M", "A", "NA"), .SD]
dam_candidates <- all_parents[is.na(Sex) | Sex %in% c("F", "A", "NA")]

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +120
test_that("simu alfalfa",{

github_path <- "https://raw.githubusercontent.com/Breeding-Insight/BIGapp-PanelHub/refs/heads/long_seq/"

# External alfalfa test files
alfalfa_madc <- paste0(github_path, "test_madcs/alfalfa_madc.csv")
alfalfa_madc_wrongID <- paste0(github_path, "test_madcs/alfalfa_madc_wrongID.csv")
alfalfa_madc_raw <- paste0(github_path, "test_madcs/alfalfa_madc_raw.csv") # raw DArT format (7-row header)
alfalfa_iupac <- paste0(github_path, "test_madcs/alfalfa_IUPAC.csv")
alfalfa_lowercase <- paste0(github_path, "test_madcs/alfalfa_lowercase.csv")
alfalfa_botloci <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_f180bp.botloci") # botloci for alfalfa
alfalfa_markers_info <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_snpID_lut.csv") # markers_info: CloneID/BI_markerID, Chr, Pos, Ref, Alt
alfalfa_markers_info_ChromPos <- paste0(github_path, "test_madcs/alfalfa_marker_info_ChromPos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos


# External potato test files
potato_indel_madc <- paste0(github_path, "test_madcs/potato_indel_madc.csv")
potato_indel_iupac <- paste0(github_path, "test_madcs/potato_indel_IUPAC.csv")
potato_indel_lowercase <- paste0(github_path, "test_madcs/potato_indel_lowercase.csv")
potato_more_indels_chrompos_false <- paste0(github_path, "test_madcs/potato_more_indels_madc_ChromPosFALSE.csv")
potato_botloci <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_f150bp_ref_alt.botloci")
potato_markers_info <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_rm1dup_snpID_lut.csv") # CloneID/BI_markerID, Chr, Pos, Ref, Alt
potato_markers_info_ChromPos <- paste0(github_path, "test_madcs/potato_marker_info_chrompos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos

skip_if_offline("raw.githubusercontent.com")

Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

These tests depend on downloading external files from raw.githubusercontent.com (a moving branch URL). Even with skip_if_offline(), this makes CI/CRAN runs flaky and can violate the “no network in tests” expectation. Prefer vendoring minimal fixtures into tests/testthat/ (or using with_mocked_bindings()), and keep any integration test behind an explicit opt-in env var.

Copilot uses AI. Check for mistakes.
Comment on lines +95 to +123
test_that("simu alfalfa",{

github_path <- "https://raw.githubusercontent.com/Breeding-Insight/BIGapp-PanelHub/refs/heads/long_seq/"

# External alfalfa test files
alfalfa_madc <- paste0(github_path, "test_madcs/alfalfa_madc.csv")
alfalfa_madc_wrongID <- paste0(github_path, "test_madcs/alfalfa_madc_wrongID.csv")
alfalfa_madc_raw <- paste0(github_path, "test_madcs/alfalfa_madc_raw.csv") # raw DArT format (7-row header)
alfalfa_iupac <- paste0(github_path, "test_madcs/alfalfa_IUPAC.csv")
alfalfa_lowercase <- paste0(github_path, "test_madcs/alfalfa_lowercase.csv")
alfalfa_botloci <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_f180bp.botloci") # botloci for alfalfa
alfalfa_markers_info <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_snpID_lut.csv") # markers_info: CloneID/BI_markerID, Chr, Pos, Ref, Alt
alfalfa_markers_info_ChromPos <- paste0(github_path, "test_madcs/alfalfa_marker_info_ChromPos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos


# External potato test files
potato_indel_madc <- paste0(github_path, "test_madcs/potato_indel_madc.csv")
potato_indel_iupac <- paste0(github_path, "test_madcs/potato_indel_IUPAC.csv")
potato_indel_lowercase <- paste0(github_path, "test_madcs/potato_indel_lowercase.csv")
potato_more_indels_chrompos_false <- paste0(github_path, "test_madcs/potato_more_indels_madc_ChromPosFALSE.csv")
potato_botloci <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_f150bp_ref_alt.botloci")
potato_markers_info <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_rm1dup_snpID_lut.csv") # CloneID/BI_markerID, Chr, Pos, Ref, Alt
potato_markers_info_ChromPos <- paste0(github_path, "test_madcs/potato_marker_info_chrompos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos

skip_if_offline("raw.githubusercontent.com")

test_that("ALFALFA — clean fixed allele ID MADC", {
out <- tempfile(fileext = ".vcf")
expect_no_error(
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

There are multiple test_that() calls nested inside another test_that() block. Nested test_that() is not supported reliably by testthat and can cause tests to be skipped or error in unexpected ways. Flatten these into top-level test_that() blocks (or use helper functions within a single test).

Copilot uses AI. Check for mistakes.
Comment on lines +73 to +99
test_that("simu alfalfa",{

github_path <- "https://raw.githubusercontent.com/Breeding-Insight/BIGapp-PanelHub/refs/heads/long_seq/"

# External alfalfa test files
alfalfa_madc <- paste0(github_path, "test_madcs/alfalfa_madc.csv")
alfalfa_madc_wrongID <- paste0(github_path, "test_madcs/alfalfa_madc_wrongID.csv")
alfalfa_madc_raw <- paste0(github_path, "test_madcs/alfalfa_madc_raw.csv") # raw DArT format (7-row header)
alfalfa_iupac <- paste0(github_path, "test_madcs/alfalfa_IUPAC.csv")
alfalfa_lowercase <- paste0(github_path, "test_madcs/alfalfa_lowercase.csv")
alfalfa_botloci <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_f180bp.botloci") # botloci for alfalfa
alfalfa_markers_info <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_snpID_lut.csv") # markers_info: CloneID/BI_markerID, Chr, Pos, Ref, Alt
alfalfa_markers_info_ChromPos <- paste0(github_path, "test_madcs/alfalfa_marker_info_ChromPos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos
alfalfa_microhapDB <- paste0(github_path, "alfalfa/alfalfa_allele_db_v001.fa")

# External potato test files
potato_indel_madc <- paste0(github_path, "test_madcs/potato_indel_madc.csv")
potato_indel_iupac <- paste0(github_path, "test_madcs/potato_indel_IUPAC.csv")
potato_indel_lowercase <- paste0(github_path, "test_madcs/potato_indel_lowercase.csv")
potato_more_indels_chrompos_false <- paste0(github_path, "test_madcs/potato_more_indels_madc_ChromPosFALSE.csv")
potato_botloci <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_f150bp_ref_alt.botloci")
potato_markers_info <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_rm1dup_snpID_lut.csv") # CloneID/BI_markerID, Chr, Pos, Ref, Alt
potato_markers_info_ChromPos <- paste0(github_path, "test_madcs/potato_marker_info_chrompos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos
potato_microhapDB <- paste0(github_path, "potato/potato_allele_db_v001.fa")

skip_if_offline("raw.githubusercontent.com")

Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

This test block also downloads external fixtures from GitHub at runtime. That makes test runs flaky and can break when the referenced branch/files change. Consider shipping stable fixtures with the package and removing network dependence from unit tests.

Copilot uses AI. Check for mistakes.
Comment on lines +73 to +105
test_that("simu alfalfa",{

github_path <- "https://raw.githubusercontent.com/Breeding-Insight/BIGapp-PanelHub/refs/heads/long_seq/"

# External alfalfa test files
alfalfa_madc <- paste0(github_path, "test_madcs/alfalfa_madc.csv")
alfalfa_madc_wrongID <- paste0(github_path, "test_madcs/alfalfa_madc_wrongID.csv")
alfalfa_madc_raw <- paste0(github_path, "test_madcs/alfalfa_madc_raw.csv") # raw DArT format (7-row header)
alfalfa_iupac <- paste0(github_path, "test_madcs/alfalfa_IUPAC.csv")
alfalfa_lowercase <- paste0(github_path, "test_madcs/alfalfa_lowercase.csv")
alfalfa_botloci <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_f180bp.botloci") # botloci for alfalfa
alfalfa_markers_info <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_snpID_lut.csv") # markers_info: CloneID/BI_markerID, Chr, Pos, Ref, Alt
alfalfa_markers_info_ChromPos <- paste0(github_path, "test_madcs/alfalfa_marker_info_ChromPos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos
alfalfa_microhapDB <- paste0(github_path, "alfalfa/alfalfa_allele_db_v001.fa")

# External potato test files
potato_indel_madc <- paste0(github_path, "test_madcs/potato_indel_madc.csv")
potato_indel_iupac <- paste0(github_path, "test_madcs/potato_indel_IUPAC.csv")
potato_indel_lowercase <- paste0(github_path, "test_madcs/potato_indel_lowercase.csv")
potato_more_indels_chrompos_false <- paste0(github_path, "test_madcs/potato_more_indels_madc_ChromPosFALSE.csv")
potato_botloci <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_f150bp_ref_alt.botloci")
potato_markers_info <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_rm1dup_snpID_lut.csv") # CloneID/BI_markerID, Chr, Pos, Ref, Alt
potato_markers_info_ChromPos <- paste0(github_path, "test_madcs/potato_marker_info_chrompos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos
potato_microhapDB <- paste0(github_path, "potato/potato_allele_db_v001.fa")

skip_if_offline("raw.githubusercontent.com")

test_that("ALFALFA — clean fixed allele ID MADC", {
out <- tempfile(fileext = ".vcf")
#out <- "test.vcf"
# Default parameters
expect_no_error(
madc2vcf_all(madc = alfalfa_madc,
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

Like test-madc2vcf_targets.R, this file nests multiple test_that() calls inside another test_that() block (the outer "simu alfalfa" test). This pattern is not reliably supported by testthat; split into separate top-level tests.

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +36
github_path <- "https://raw.githubusercontent.com/Breeding-Insight/BIGapp-PanelHub/refs/heads/long_seq/"

# External alfalfa test files
alfalfa_madc <- paste0(github_path, "test_madcs/alfalfa_madc.csv")
alfalfa_madc_wrongID <- paste0(github_path, "test_madcs/alfalfa_madc_wrongID.csv")
alfalfa_madc_raw <- paste0(github_path, "test_madcs/alfalfa_madc_raw.csv") # raw DArT format (7-row header)
alfalfa_iupac <- paste0(github_path, "test_madcs/alfalfa_IUPAC.csv")
alfalfa_lowercase <- paste0(github_path, "test_madcs/alfalfa_lowercase.csv")
alfalfa_botloci <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_f180bp.botloci") # botloci for alfalfa
alfalfa_markers_info <- paste0(github_path, "alfalfa/20201030-BI-Alfalfa_SNPs_DArTag-probe-design_snpID_lut.csv") # markers_info: CloneID/BI_markerID, Chr, Pos, Ref, Alt
alfalfa_markers_info_ChromPos <- paste0(github_path, "test_madcs/alfalfa_marker_info_ChromPos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos
alfalfa_microhapDB <- paste0(github_path, "alfalfa/alfalfa_allele_db_v001.fa")

# External potato test files
potato_indel_madc <- paste0(github_path, "test_madcs/potato_indel_madc.csv")
potato_indel_iupac <- paste0(github_path, "test_madcs/potato_indel_IUPAC.csv")
potato_indel_lowercase <- paste0(github_path, "test_madcs/potato_indel_lowercase.csv")
potato_more_indels_chrompos_false <- paste0(github_path, "test_madcs/potato_more_indels_madc_ChromPosFALSE.csv")
potato_botloci <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_f150bp_ref_alt.botloci")
potato_markers_info <- paste0(github_path, "potato/potato_dartag_v2_3915markers_rm7dupTags_6traitMarkers_rm1dup_snpID_lut.csv") # CloneID/BI_markerID, Chr, Pos, Ref, Alt
potato_markers_info_ChromPos <- paste0(github_path, "test_madcs/potato_marker_info_chrompos.csv") # markers_info: CloneID/BI_markerID, Chr, Pos
potato_microhapDB <- paste0(github_path, "potato/potato_allele_db_v001.fa")

skip_if_offline("raw.githubusercontent.com")

Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

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

This test uses external GitHub-hosted fixtures at runtime. Even with skip_if_offline(), it introduces non-determinism and can fail if the remote branch changes or is rate-limited. Prefer local fixtures for unit tests; keep any online integration test behind an explicit opt-in flag.

Copilot uses AI. Check for mistakes.
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.

4 participants