R/AllClasses.R

# create class definitions
setClass("SeqVarGDSClass", contains="gds.class")
# setClass("SeqVarNodeNewInfoClass", slots = c(
#         gdsn = "gdsn.class", number = "integer", type = "character"
#     ))


# test the validity of objects
setValidity("SeqVarGDSClass",
    function(object)
    {
        if (!inherits(object, "gds.class"))
            return("object should inherited from 'gds.class'.")

        n <- index.gdsn(object, "description", silent=TRUE)
        if (is.null(n))
            return("Description variable must exist!")

        var.names <- ls.gdsn(object)
        if (!all(c("sample.id", "variant.id", "position",
            "chromosome", "allele", "genotype") %in% var.names))
        {
            return("sample.id, variant.id, position, chromosome, allele, and genotype are required variables.")
        }
        TRUE
    }
)

Try the SeqArray package in your browser

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

SeqArray documentation built on Nov. 8, 2020, 5:08 p.m.