Skip to main content

Table 14 R-code for distanceAny matching

From: Matching of array CGH and gene expression microarray features for the purpose of integrative genomic analyses

# match

> matchedIDs < − matchAnn2Ann(fData(CNdata)[,1], fData(CNdata)[,2],

fData(CNdata)[,3], fData(GEdata)[,1],

fData(GEdata)[,2], fData(GEdata)[,3],

method = “distance”)

> # add offset to distances (avoids infinitely large weights)

> matchedIDs < − lapply(matchedIDs, function(Z, offset){ Z[,3] < − Z[,3] + offset;

return(Z) }, offset = 1)

> # extract ids for object subsetting

> matchedIDsGE < − lapply(matchedIDs, function(Z){ return(Z[, -2, drop=FALSE]) })

> matchedIDsCN < − lapply(matchedIDs, function(Z){ return(Z[, -1, drop=FALSE]) })

> # generate matched objects

> GEdata < − ExpressionSet2weightedSubset(GEdata, matchedIDsGE, 1, 2, 3)

> CNdata < − cghCall2weightedSubset(CNdata, matchedIDsCN, 1, 2, 3)