Skip to content

Dosage2vcf update#60

Merged
alex-sandercock merged 2 commits into
developmentfrom
dosage2vcf_update
May 17, 2026
Merged

Dosage2vcf update#60
alex-sandercock merged 2 commits into
developmentfrom
dosage2vcf_update

Conversation

@alex-sandercock
Copy link
Copy Markdown
Collaborator

This pull request improves the documentation and testing of the dosage2vcf function, clarifying its support for different DArT genotype report formats and ensuring correct handling of SNP/INDEL reports. It also adds comprehensive tests to verify the function's behavior with various input formats and edge cases.

Documentation updates:

  • Clarified in the .Rd documentation that dosage2vcf supports both Allele Dose Reports and SNP/INDEL genotype reports, and described how these formats are interpreted and mapped to VCF genotype codes. [1] [2]

Testing improvements:

  • Added helper functions in test-dosage2vcf.R to generate synthetic DArT report and count fixtures for different scenarios, enabling robust and reusable test setups.
  • Added tests to verify that SNP/INDEL 1-row and 2-row reports are handled as diploid genotype reports, that sample names are aligned between reports and counts, and that the output VCF matches expectations.
  • Added a test to ensure that an error is raised if a non-diploid ploidy is specified for SNP/INDEL reports, enforcing correct usage.

Namespace update:

  • Exported the validate_pedigree function in the NAMESPACE file.

Copy link
Copy Markdown
Contributor

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

This PR expands dosage2vcf to support additional DArT genotype report formats while updating documentation and tests around SNP/INDEL handling.

Changes:

  • Refactors dosage2vcf parsing/validation for Allele Dose, SNP/INDEL 1-row, and SNP/INDEL 2-row reports.
  • Adds synthetic test fixtures and tests for SNP/INDEL conversion behavior.
  • Updates documentation and exports validate_pedigree.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
R/dosage2vcf.R Adds report/count parsing helpers, SNP/INDEL genotype conversion, validation, and VCF formatting updates.
tests/testthat/test-dosage2vcf.R Adds fixture writers and tests for SNP/INDEL report conversion and ploidy validation.
man/dosage2vcf.Rd Updates generated documentation for supported report formats.
NAMESPACE Exports validate_pedigree.
Files not reviewed (1)
  • man/dosage2vcf.Rd: Language not supported

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

Comment thread R/dosage2vcf.R
Comment on lines +272 to +274
is_snp_1row <- all(c("MarkerName", "AlleleSequenceRef", "AlleleSequenceAlt", "Variant") %in% names(raw))
is_snp_2row <- all(c("MarkerName", "AlleleSequence", "Variant") %in% names(raw)) &&
anyDuplicated(raw$MarkerName) > 0
Comment thread R/dosage2vcf.R
Comment on lines +490 to +492
alleles_df$AltCountsSum <- rowSums(alt_counts)
alleles_df$RefCountsSum <- rowSums(ref_counts)
alleles_df$TotalCountSum <- alleles_df$AltCountsSum + alleles_df$RefCountsSum
@codecov
Copy link
Copy Markdown

codecov Bot commented May 17, 2026

Codecov Report

❌ Patch coverage is 85.18519% with 56 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.87%. Comparing base (ccc0952) to head (7ae6e3d).

Files with missing lines Patch % Lines
R/dosage2vcf.R 85.18% 56 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development      #60      +/-   ##
===============================================
+ Coverage        81.53%   81.87%   +0.34%     
===============================================
  Files               23       23              
  Lines             2616     2886     +270     
===============================================
+ Hits              2133     2363     +230     
- Misses             483      523      +40     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alex-sandercock alex-sandercock merged commit 099da55 into development May 17, 2026
10 checks passed
@alex-sandercock alex-sandercock deleted the dosage2vcf_update branch May 17, 2026 17:16
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