View source: R/ObjectCreator.R
ObjectCreator | R Documentation |
Manually create a PathwayObject
ObjectCreator(Pathways, Molecules, Groups, Source, Type, structure, sep, organism = NA)
Pathways |
A vector with Gene-Set labels. |
Molecules |
A vector with strings of genes within each Gene-Set. Each string is seperated using the seperator supplied. |
Groups |
A vector with group names of the different gene set experiments |
Source |
Tool used to generate gene sets.. |
Type |
For IPA data if Canonical pathways or Functional Anotations were supplied. |
structure |
The structure of the genes. is it SYMBOLS, ENSEMBL, NCBI etc. Used for converting when there is mutiple structure in the object. |
sep |
A seperator, A character used within in the string to seperate genes |
organism |
the package name for the human or mouse data, used for converting the gene structure. name of the package, currently org.Hs.eg.db and org.Mm.eg.db supported. |
a pathwayobject
Test.object <- matrix(data = NA, nrow = 50, ncol = 3) colnames(Test.object) <- c("Pathways", "Genes", "Group") Test.object[,"Pathways"] <- paste("Pathway", 1:nrow(Test.object), sep = "_") Test.object[1:25,"Group"] <- "Group1" Test.object[26:50,"Group"] <- "Group2" #Create a random amount of genes per pathway random.gene <- function() { genenames <- paste("Gene", 1:200, sep = "_")#this gives 200 gene names genes <- round(runif(n = runif(n = 1,min = 7,max = 20), min = 1, max = 200), digits = 0) #This gives between 7 and 20 random whole numbers genes <- unique(genes)#remove duplicate numbers genes <- genenames[genes]#get random genesnames return(genes) } for(i in 1:nrow(Test.object)) { Test.object[i, "Genes"] <- paste(random.gene(), collapse=",") } Test.object1 <- ObjectCreator(Pathways = Test.object[,1], Molecules = Test.object[,2], Groups = Test.object[,3], Source = "Random",#we randomly generated this data Type = "Test", structure = "SYMBOL", sep = ",")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.