LDAK accepts many types of genetic data files (see File Formats). Here we explain how to remake data files. This can be used to convert between data formats (e.g., LDAK-KVIK and Elastic-Predict require that the data are saved in a binary format), to merge data (join two or more data files of the same format) and to reduce data (e.g, restrict to a subset of samples and/or predictors).
Always read the screen output, which suggests arguments and estimates memory usage.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
The main argument determines the output data format:
Use --make-bed <outfile> to save data in Binary PLINK format.
Use --make-sp <outfile> to save data in (original) SP format.
Use --make-sped <outfile> to save data in old binary SP format.
Use --make-speed <outfile> to save data in new binary SP format.
Use --make-gen <outfile> to save data in gen format.
See Genetic Data Formats for details of each format.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
With each of these arguments, you must provide input genetic data. If you have only one input dataset, you should use --bfile <datastem>, --bgen <datafile>, --gen <datastem>, --sp <datastem>, --sped <datastem> or --speed <datastem>. If you have multiple genetic datasets (of the same format), you should use --mbfile <datalist>, --mgen <datalist>, --msp <datalist>, --msped <datalist> or --mspeed <datalist> (note that it is not possible to provide multiple BGEN files, so you should first convert the individual BGEN files to an alternative format).
When providing multiple datasets, the file <datalist> will normally have three columns, providing the names of the files containing predictor values, the names of the files containing predictor annotations and the names of the files containing sample annotations. For example, if you wish to merge two datasets saved in Binary PLINK format with stems data1 and data2, then <datalist> should have two rows, containing "data1.bed data1.bim data1.fam", then "data2.bed data2.bim data2.fam". Note that if <datalist> has only one column, this should contain the stem of each dataset, and LDAK will add the default suffix to each.
Note that if converting genotype probabilities to hard genotypes (e.g., using --make-bed with --bgen), you must use either --threshold or --min-prob. For example, using --min-prob 0.9 will instruct LDAK to use the genotype with probability above 0.9 (if all three probabilities are below 0.9, the value will be set to NA). In general, we recommend using --threshold 0.9, in which case LDAK will first compute the expected genotype count (the "dosage"), then map this to the nearest integer (or the difference between the dosage and the nearest integer is more than 0.1).
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
You can use --min-maf <float>, --max-maf <float>, --min-var <float>. --min-obs <float> to filter predictors based on minor allele frequency, variance or proportion of non-missing values. Note that while --min-var <float> and --min-obs <float> can be used for all types of data, --min-maf <float> and --max-maf <float> can only be used with SNP data (all predictor values are within [0,2]). Additionally, if the input genetic data contain genotyping probabilities, you can use --min-info <float> to filter predictors based on information score (computed as the observed variance of the dosages divided by the expected variance assuming Hardy-Weinberg Equilibrium).
You can use --keep <keepfile> and/or --remove <removefile> to restrict to a subset of sample, and --extract <extractfile>, --exclude <excludefile>, --chr <integer> and/or --snp <predname> to restrict to a subset of predictors (for more details, see Data Filtering).
By default, SNP values will be stored as 0/1/2, indicating the number of A1 alleles (or NA if missing). If you use --encoding DOM, values will be stored as 0/2/2. If you use --encoding REC, values will be stored as 0/0/2. If you use --encoding HET, values will be stored as 0/2/0. If you use --encoding MINOR, LDAK will ensure A1 is the minor allele, while if you use --encoding MISS, the value indicates whether the genotype was NA or not.
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
Example:
Here we use the binary PLINK files human.bed, human.bim and human.fam from the Test Datasets
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
We can convert from binary PLINK format to SP format using
./ldak.out --make-sp human.sp --bfile human
The genetic data are now saved in the files human.sp.sp, human.sp.bim and human.sp.bim (note that human.sp.sp is a text file, so SP format can be used to view predictor values saved in binary formats)
We can convert from binary PLINK format to SPEED format using
./ldak.out --make-speed human.speed --bfile human
The genetic data are now saved in the files human.speed.speed, human.speed.bim and human.speed.bim.
