Learn R Programming

beadarrayMSV (version 1.0.3)

createAlleleSet: Create AlleleSetIllumina or MultiSet objects

Description

An "AlleleSetIllumina" (or "MultiSet") object is created, either by transforming a "BeadSetIllumina" object into an "AlleleSetIllumina" object, by reading from text-files containing pre-processed data, or by merging existing objects

Usage

createAlleleSet(BSData, beadInfo, normOpts, includeAB = FALSE)

createAlleleSetFromFiles(dataFiles, markers, arrays, phenoInfo = NULL, beadInfo = NULL, sep = "", quote = "")

createMultiSetFromFiles(dataFiles, markers, arrays, phenoInfo = NULL, beadInfo = NULL, sep = "", quote = "")

assignToAlleleSet(BSRed, BSAdd) BSData{ "BeadSetIllumina" object } beadInfo{ Data-frame containing an entry for each marker, and the columns Name, SNP, ILMN.Strand, Address, Address2, and Norm.ID, as exported from Illumina's GenomeStudio Genotyping Module (or relatives). May also contain columns relating to genotype calls (see callGenotypes) } normOpts{ List containing at least the elements dist and pNorm (see setNormOptions) } includeAB{ If TRUE, the Cartesian signal arrays A and B are returned as assayData entries in the new "AlleleSetIllumina" object } dataFiles{ Character vector containing filenames where the different data-tables are saved (see makeFilenames) } markers{ Index to markers in the dataFiles files } arrays{ Index to arrays/samples in the dataFiles files } phenoInfo{ Data-table with phenotype data. Argument is ignored if phFile is provided in dataFiles } sep{ Field delimiter in text-files (see read.table) } quote{ Quote-marks used for character strings (see read.table) } BSRed{ "AlleleSetIllumina" object } BSAdd{ "AlleleSetIllumina" object with data to include in BSRed }

A "BeadSetIllumina" object contains bead-type information, whereas an "AlleleSetIllumina" object contains marker information (for each Infinum I marker, there are two bead-types). The function createAlleleSet takes a "BeadSetIllumina" object as input and merges the R and G intensities into A and B intensities. The former relates to bead-types and the latter relates to markers as defined in beadInfo. The required polar coordinate intensities intensity and theta are estimated based on A and B, and depend on the distance measures defined in normOpts. The angles theta are scaled such that {0, 90} degrees are represented by {0, 1}, and intensity vs. theta for single markers are usually plotted on Cartesian axes for genotype calling.

If data-files are available for all required assayData, phenoData, and featureData elements, an "AlleleSetIllumina" or a "MultiSet" object may be constructed with create-AlleleSetFromFiles or createMultiSetFromFiles, respectively. The former has three required assayData elements whereas the latter has none. Sometimes, and in particular after manual genotype calling, there is a need to update an "AlleleSetIllumina" object with new information. The function assignToAlleleSet adds any data in BSAdd to BSRed, overwriting previous data if there is a conflict Object of class "AlleleSetIllumina" or "MultiSet" [object Object] AlleleSetIllumina, MultiSet, writeAlleleSet, makeFilenames #Read raw data files into BeadSetIllumina object rPath <- system.file("extdata", package="beadarrayMSV") BSDataRaw <- readBeadSummaryOutput(path=rPath,recursive=TRUE)

#Find indexes to sub-bead pools beadInfo <- read.table(paste(rPath,'beadData.txt',sep='/'),sep='\t', header=TRUE,as.is=TRUE) rownames(beadInfo) <- make.names(beadInfo$Name) normInd <- getNormInd(beadInfo,featureNames(BSDataRaw))

#Pre-process BSData normOpts <- setNormOptions(minSize=10) plotPreprocessing(BSDataRaw,normInd,normOpts,plotArray=1) BSData <- preprocessBeadSet(BSDataRaw,normInd,normOpts) print(BSData) print(fData(BSData)[1:10,]) print(fvarMetadata(BSData))

#Convert to AlleleSetIllumina-object BSRed <- createAlleleSet(BSData,beadInfo,normOpts) print(BSRed) print(fData(BSRed)[1:10,]) print(fvarMetadata(BSRed))

#Read pre-processed data directly into AlleleSetIllumina object dataFiles <- makeFilenames('testdata',normOpts,rPath) beadFile <- paste(rPath,'beadData_testdata.txt',sep='/') beadInfo2 <- read.table(beadFile,sep='\t',header=TRUE,as.is=TRUE) BSRed <- createAlleleSetFromFiles(dataFiles[1:4],beadInfo=beadInfo2) print(varLabels(BSRed))

Arguments