R/kin2gds.R

Defines functions kin2gds mat2gds

Documented in kin2gds mat2gds

mat2gds <- function(mat, gdsfile) {
    ## if we have a Matrix object, coerce
    if (!is.matrix(mat)) mat <- as.matrix(mat)
    gds <- createfn.gds(gdsfile)
    add.gdsn(gds, "sample.id", colnames(mat))
    add.gdsn(gds, "kinship", mat)
    closefn.gds(gds)
}


kin2gds <- function(ibdobj, gdsfile) {
    gds <- createfn.gds(gdsfile)
    add.gdsn(gds, "sample.id", ibdobj$sample.id)
    add.gdsn(gds, "kinship", ibdobj$kinship)
    closefn.gds(gds)
}

Try the GENESIS package in your browser

Any scripts or data that you put into this service are public.

GENESIS documentation built on Jan. 30, 2021, 2:01 a.m.