add_snps: Method to add a slot of SNPs to 'MultiDataSet'.

Description Usage Arguments Value Examples

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

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

MultiDataSet documentation built on Jan. 31, 2021, 2:01 a.m.