This function calculates a one-dimensional site frequency spectrum from a VCF file. It processes the file in batches for efficient memory usage.
The user can decide between a folded or unfolded spectrum.
Logical, deciding if folded (TRUE) or unfolded (FALSE) SFS is returned.
batch_size
The number of variants to be processed in each batch
(default of 10,000 should be suitable for most use cases).
threads
Number of threads to use for parallel processing.
write_log
Logical, indicating whether to write progress logs.
logfile
Path to the log file where progress will be logged.
exclude_ind
Optional vector of individual IDs to exclude from the analysis.
If provided, the function will remove these individuals from the genotype matrix
before applying the custom function. Default is NULL, meaning no individuals are excluded.