ObjectCreator: ObjectCreator

View source: R/ObjectCreator.R

ObjectCreatorR Documentation

ObjectCreator

Description

Manually create a PathwayObject

Usage

ObjectCreator(Pathways, Molecules, Groups, Source, Type, structure, sep,
  organism = NA)

Arguments

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.

Value

a pathwayobject

Examples

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 = ",")





TranslationalBioinformaticsUnit/GeneSetCluster documentation built on Feb. 2, 2023, 4:06 a.m.