# Begin by activating the InterMineR library # Syntax: library(LIBRARY_NAME_HERE) # Syntax: listMines()["MINE _NAME_HERE"] # Print the value to make sure it's what we expect # Syntax: initInterMine(mine=MINE_URL_HERE) or, if you're accessing a personal list, you'll also need your API token: # initInterMine(mine=MINE_URL_HERE, "YOUR_TOKEN_HERE") # First, we'll retrieve the widgets available from HumanMine and store it in a variable called `humanWidgets`. # This will tell us what types of enrichment are available. # # Syntax: getWidgets(im) # Print out the widgets so we can see what there is humanWidgets # We'll put the widget list `humanWidgets` in to a data frame, so it's easy to filter. # # Syntax: as.data.frame(LIST_NAME_HERE) humanWidgetsDataFrame <- #put data frame code here # Syntax: subset(YOU_DATA_FRAME, COLUMN1 == 'VALUE1' & COLUMN2 == 'VALUE2' ) # We're using the widget `go_enrichment_for_gene` against the list name # `PL_GenomicsEngland_GenePanel:Genetic_Epilepsy_Syndromes` # #Syntax: # # GOEnrichmentResult <- doEnrichment( # im = YOUR_CHOSEN_INTERMINE_HERE # list = LIST_NAME_SAVE_ON_YOUR_CHOSEN_INTERMINE, # widget = "go_enrichment_for_gene" # Or whichever widget you're using # organism = "Homo sapiens" # optional if results from more than one organism are retrieved # ) GOEnrichmentResult <- doEnrichment( # Put enrichment details here ) # Print the results GOEnrichmentResult # We'll be using the setQuery method here # # Syntax: # setQuery( # select = c("VIEW.NAME1", "VIEW.NAME2", .... ), # where = setConstraints( # paths = c("CONSTRAINT.PATH.A", "CONSTRAINT.PATH.B"), # operators = c("CONSTRAINT.OPERATOR.A", "CONSTRAINT.OPERATOR.B"), # values = list("CONSTRAINT.VALUE.A","CONSTRAINT.VALUE.B") # ) #) queryEpilepsy <- setQuery( # fill out your view and constraints here ) # Run the query using the syntax `runQuery(im, QUERY_HERE)` queryEpilepsyResults <- # Add run query details here # print the results: # load GeneAnswers package. Remember the syntax is `library(LIBRARYNAME)` # convert InterMineR Gene Ontology Enrichment analysis results to GeneAnswers object # Syntax: # convertToGeneAnswers( # enrichmentResult = AN_INTERMINE_ENRICHMENT_RESULT, # geneInput = data.frame(GeneID = ORIGINAL_LIST_OF_IDS_WE_ENRICHED_ON, # stringsAsFactors = FALSE), # geneInputType = "TYPE_OF_IDS_PROVIDED" (e.g. "Gene.primaryIdentifier" or "Gene.symbol"), # categoryType = "GO" # could also be null for a user-provided annotation list #) queryEpilepsyForGeneAnswers <- convertToGeneAnswers( # Put the arguments here ) # Run the summary on the Gene Answers object we made in the previous code cell. # The variable name we used was `queryEpilepsyForGeneAnswers` geneAnswersConceptNet(queryEpilepsyForGeneAnswers, # This is the Gene Answers object we created colorValueColumn=NULL, # Default colours centroidSize='correctedPvalue', # the column used to size graph nodes output='fixed', # don't spawn a new pop-up window geneSymbol = TRUE) # Show gene symbols as labels geneAnswersConceptRelation(queryEpilepsyForGeneAnswers, # This is the Gene Answers object we created directed=TRUE, # show arrows to indicate the direction of relationship output="fixed", # don't spawn a new pop-up window netMode='connection') buildNet(getGeneInput(queryEpilepsyForGeneAnswers)[,1], # queryEpilepsyForGeneAnswers idType='GeneInteraction', layers=3, output="fixed", # don't spawn a new pop-up window filterGraphIDs=getGeneInput(queryEpilepsyForGeneAnswers)[,1], filterLayer=2, # How many layers deep to look for interactors. Try changing it to 3! netMode='connection') geneAnswersHeatmap(queryEpilepsyForGeneAnswers, catTerm=TRUE, geneSymbol=TRUE, cex.axis = 0.75)