Skip to content

OptimalGeneSets

EwoudEwing edited this page Aug 26, 2019 · 1 revision

OptimalGeneSets

Usage

OptimalGeneSets(object = IPA.object2, method = "elbow", max_cluster= 24, cluster_method = "kmeans", main= "Kmeans for 24 clusters")

Arguments

Object A PathwayObject.

method Which method to determing optimal number of clusters. gap, elbow or silhouette.

max_cluster Max number of clusters to test.

cluster_method kmeans or hcut. Which clustering method is used.

main A string to be used as title in the plot.

Examples

require(GeneSetCluster)
IPA.files <- c(system.file("extdata", "MM10.IPA.KO.uGvsMac.Canonical_pathways.xls", package = "GeneSetCluster"),
               system.file("extdata", "MM10.IPA.WT.uGvsMac.Canonical_pathways.xls", package = "GeneSetCluster"),
               system.file("extdata", "MM10.IPA.KO.uGvsMac.Functional_annotations.xls", package = "GeneSetCluster"),
               system.file("extdata", "MM10.IPA.WT.uGvsMac.Functional_annotations.xls", package = "GeneSetCluster"))
canonical.files <- IPA.files[grep("Canonical", IPA.files)]

IPA.object1 <- LoadGeneSets(file_location = canonical.files, #where are  the files
                            groupnames= c("KO", "WT"),#Names of the groups 
                            P.cutoff = 1.3, #minumum cutoff if smaller than 1 it assumes normal pvalue, if larger than 1 it assumes a log10 palue
                            Mol.cutoff = 5,# amount of molecules interested in 
                            Source = "IPA",#How was the data generated
                            type = "Canonical_Pathways",#What is the experiment e.g. canonical pathways, functional anotation
                            structure = "SYMBOL",#structure of the molecules e.g. genenames, ensembl_ID etc 
                            seperator = ",")#How are the genes seperated
IPA.object2 <- CombineGeneSets(Object = IPA.object1)
IPA.object3 <- ClusterGeneSets(Object = IPA.object2, 
                               clusters = 7, 
                               method = "kmeans")

OptimalGeneSets(object = IPA.object2, method = "elbow", max_cluster= 24, cluster_method = "kmeans", main= "Kmeans for 24 clusters")

OptimalGeneSets using silhouette

OptimalGeneSets(object = IPA.object2, method = "silhouette", max_cluster= 24, cluster_method = "kmeans", main= "Kmeans for 24 clusters")

OptimalGeneSets using gap

OptimalGeneSets(object = IPA.object2, method = "gap", max_cluster= 24, cluster_method = "kmeans", main= "Kmeans for 24 clusters")

OptimalGeneSets using elbow

OptimalGeneSets(object = IPA.object2, method = "elbow", max_cluster= 24, cluster_method = "kmeans", main= "Kmeans for 24 clusters")

Clone this wiki locally