function tst_comp_refs()
    ## Create plink files of the 3 groups of data
    smpl = "dat/v4r"
    wdir = "$smpl/tmp"
    
    @info "Merging v4 genotypes into plink format"
    #-- Note: I substitued original ID names with integers, as they are not important here.
    dir = "$smpl/18k_v4"
    lmp = "$smpl/map/V4_used/18k_v4.map"
    tgt = "$wdir/v4"
    make_bed(dir, lmp, tgt)
    
    @info "Merging v2 genotypes into plink format"
    dir = "$smpl/18k_v2"
    lmp = "$smpl/map/V4_used/18k_v2.map"
    tgt = "$wdir/v2"
    make_bed(dir, lmp, tgt)
    
    @info "Merging 8k genotypes into plink format"
    dir = "$smpl/8k"
    lmp = "$smpl/map/V4_used/8k_rudi.map"
    tgt = "$wdir/8k"
    make_bed(dir, lmp, tgt)
    
    ## QC of these 3 groups of plink files.
    #--- attention: if the smpl is too small, then many loci may be removed
    #---   change QC criteria, or use larger smpl
    QC("$wdir/v4", "$wdir/v4-qc")
    QC("$wdir/v2", "$wdir/v2-qc")
    QC("$wdir/8k", "$wdir/8k-qc")
    
    ## Make references
    ### v4
    make_ref("$wdir/v4-qc", "$wdir/v4-ref")
    ### v2
    make_ref("$wdir/v2-qc", "$wdir/v2-ref")
    
    ## Do the comparison and report results
    comp_refs("$wdir/v4-ref", "$wdir/v2-ref", "$wdir/8k-qc")
end
