Skip to content

Instantly share code, notes, and snippets.

@msuprun
Created June 20, 2015 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msuprun/09319809bd70faf8e2f8 to your computer and use it in GitHub Desktop.
Save msuprun/09319809bd70faf8e2f8 to your computer and use it in GitHub Desktop.
R combining / merging EspressionSets
# using Merge
lists <- list(eset,eset3)
eset_both <- inSilicoMerging::merge(lists, method='NONE')
# using combine
eset_both2 <- combine(eset, eset3)
# Manually
neweset<-ExpressionSet(assayData=cbind(exprs(eset),exprs(eset3)[featureNames(eset),]))
phenoData(neweset)<-new("AnnotatedDataFrame",rbind(pData(eset),pData(eset3))[sampleNames(neweset),])
# Compare results
sum(exprs(eset_both)[featureNames(neweset),sampleNames(neweset)]!=exprs(neweset))/length(featureNames(neweset))
sum(exprs(eset_both2)[featureNames(neweset),sampleNames(neweset)]!=exprs(neweset))/length(featureNames(neweset))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment