R/sanity_check_functions.R
check_genome_chr_length.RdValidates that the actual chromosome lengths in a simulated genome match their expected lengths. Checks both maternal and paternal copies of each chromosome.
check_genome_chr_length(clone_genome, expected_chr_lengths)A nested list containing genome sequences:
First level: haplotypes (maternal/paternal)
Second level: chromosomes with nucleotide sequences
A nested list containing expected chromosome lengths:
First level: haplotypes (maternal/paternal)
Second level: named numeric vector of chromosome lengths
A nested list where:
First level: haplotypes (maternal/paternal)
Second level: chromosomes
Values are status messages indicating whether lengths match or not, including both expected and actual lengths when there's a mismatch
The function:
Checks each chromosome in both maternal and paternal copies
Compares actual sequence length to expected length
Generates informative messages about matches and mismatches
Useful for validating genome synthesis results
if (FALSE) { # \dontrun{
validation_results <- check_genome_chr_length(
clone_genome = synthesized_genome,
expected_chr_lengths = expected_lengths
)
# Access results for specific chromosomes
validation_results$maternal$chr1 # Check maternal chr1 status
} # }