Reads the SNP_FILE of the BLUPF90 programs: one animal per line, the id, spaces, and a
fixed-width string of genotype codes, 0, 1 and 2 for the count of the counted allele and 5
for missing. The matrix comes back RAW, one byte per genotype with 5 kept as the missing
code, which every genotypes= argument reads as it is: a file of 280 000 animals and
44 000 markers is 12 GB this way and would be 98 GB as doubles. The file is read twice,
once to count and check the lines and once to fill the matrix, so nothing but the matrix
is held in memory. ids = keeps only those animals, in file order, for a subset that fits.
Examples
f <- tempfile()
writeLines(c(" a1 0125", " a2 2210"), f)
g <- read_blupf90_snp(f)
g$m
#> [,1] [,2] [,3] [,4]
#> [1,] 00 01 02 05
#> [2,] 02 02 01 00