add_snps {MultiDataSet} | R Documentation

## Method to add a slot of SNPs to `MultiDataSet`.

### Description

This method adds or overwrites the slot `"snps"` of an `MultiDataSet` with the content of the given `SnpSet`. The fData of the `SnpSet` must contain the columns chromosome and position.

### Usage

    add_snps(object, snpSet, ...)

### Arguments

`object` | `MultiDataSet` that will be filled.
`snpSet` | `SnpSet` to be used to fill the slot.
`...` | Arguments to be passed to `add_eset`.

### Value

A new `MultiDataSet` with the slot `"snps"` filled.

### Examples

    multi <- createMultiDataSet()
    geno <- matrix(c(3,1,2,1), ncol = 2)
    colnames(geno) <- c("VAL0156", "VAL0372")
    rownames(geno) <- c("rs3115860", "SNP1-1628854")
    map <- AnnotatedDataFrame(data.frame(chromosome = c("chr1", "chr2"), position = c(12414, 1234321),
         stringsAsFactors = FALSE))
    rownames(map) <- rownames(geno)
    snpSet <- new("SnpSet", call = geno, featureData = map)
    pheno <- data.frame(id = c("VAL0156", "VAL0372"))
    rownames(pheno) <- c("VAL0156", "VAL0372")
    pData(snpSet) <- pheno
    multi <- add_snps(multi, snpSet)

[Package MultiDataSet version 1.14.0 Index]