ListManager-methods: Methods for managing and doing operations with...

Description Methods Author(s) See Also Examples

Description

ListManager constitutes a class used to store the information required for managing lists contents and performing operations. The methods that enable to treat with lists and do operations are described below:

Methods

Class-specific methods:

get_list(ListManager-class, list_name):

Return a list from the service by name, if it exists. \itemlist_name the name of an existing list

delete_lists(ListManager-class, lists):

Deletes the lists passed as the second argument. Only deletes lists that belong to the user. The second argument need to be of the form c("list_name_1","list_name_2","list_name_3"). \itemlists a list containing the names of the lists to be deleted.

create_list(ListManager-class, content, list_type, name = NULL, description = NULL, organism = NULL)):

Creates a new list by uploading a set of identifiers. \itemcontent the result of a query obtained with runQuery or a lists of identifiers. \itemlist_type the type of objects to include in the list. \itemname the name for the new list. If none is provided one will be generated. \itemdescription a description for the list (free text). \itemorganism the name of the organism.

intersect(ListManager-class, lists, name = NULL, description = NULL, tags = list()):

Creates new lists which contain only those items which are members of all the source lists. \itemlists the source lists to be intersected. \itemname the name for the new list. If none is provided one will be generated. \itemdescription a description for the list (free text). \itemtags a set of strings to use as tags.

union(ListManager-class, lists, name = NULL, description = NULL, tags = list()):

Creates new lists which contain all the members contained in the set of input lists. \itemlists the source lists to be unified. \itemname the name for the new list. If none is provided one will be generated. \itemdescription a description for the list (free text). \itemtags a set of strings to use as tags.

difference(ListManager-class, lists, name = NULL, description = NULL, tags = list()):

Creates new lists which only contain members which are not shared by an even number of lists. \itemlists the source lists. \itemname the name for the new list. If none is provided one will be generated. \itemdescription a description for the list (free text). \itemtags a set of strings to use as tags.

subtract(ListManager-class, lefts, rights, name = NULL, description = NULL, tags = list()):

Creates new lists which contain only those elements which are present in one set of lists, and none of those elements which are present in another set of lists. This is what is typically thought of as subtraction, or more technically, the asymmetric difference of two sets. \itemlefts the source lists. \itemrights the substraction lists. \itemname the name for the new list. If none is provided one will be generated. \itemdescription a description for the list (free text). \itemtags a set of strings to use as tags.

Author(s)

InterMine Team

See Also

ListManager-class, webservice-methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#the example code has been hashed out as an API token is required.
# get ListManager class
#im <- initInterMine(listMines()["HumanMine"],"YOUR TOKEN")
#im.human.list <- list_manager(im)
#class(im.human.list)

# create "diabetesGenes" list, and another one without specifying the name 
#query1Diabetes <- setQuery( 
#  select = c("Gene.primaryIdentifier", "Gene.symbol"),
#  where = setConstraints(
#    paths = c("Gene.organism.name", "Gene.diseases.name"),
#    operators = c("=", "CONTAINS"),
#    values = list("Homo sapiens","diabetes")
#  )
#)
#query1DiabetesResults <- runQuery(im, query1Diabetes)
#create_list(im.human.list,content = query1DiabetesResults, list_type = "Gene", name = "diabetesGenes")

#query2UpInPancreasConstraint = setConstraints(
#  paths = c("Gene", 
#            "Gene.proteinAtlasExpression.level", 
#            "Gene.proteinAtlasExpression.level", 
#            "Gene.proteinAtlasExpression.tissue.name"),
#  operators = c("IN", rep("=", 3)),
#  values = list("PL_Pax6_Targets", "Medium", "High", "Pancreas")
#)
#query2UpInPancreas = newQuery(
#  view = c("Gene.primaryIdentifier",
#           "Gene.symbol",
#           "Gene.proteinAtlasExpression.cellType",
#           "Gene.proteinAtlasExpression.level",
#           "Gene.proteinAtlasExpression.tissue.name"
#  ),
#  constraintLogic = "A and (B or C) and D"
#)
#query2UpInPancreas$where <- query2UpInPancreasConstraint
#query2UpInPancreasResults <-  runQuery(im = im, qry = query2UpInPancreas)
#ids_query2UpInPancreasResults <- list(query2UpInPancreasResults["Gene.primaryIdentifier"])
#create_list(im.human.list,ids_query2UpInPancreasResults,list_type="Gene") 
#this will create a list with the default name "my_list"

# example of intersect
#intersect(im.human.list, c("diabetesGenes","my_list"),"intersect_list")

#example of union
#union(im.human.list, c("diabetesGenes","my_list"), "union_list")

#example of difference
#difference(im.human.list,c("diabetesGenes","my_list"),"diff_list")

#example of subtract
#subtract(im.human.list,lefts = c("diabetesGenes"), rights = c("my_list"),"subtr_list")

# get "my_list" list
#resp <- get_list(im.human.list, "my_list")

#delete "my_list" and "diabetesGenes" lists
#delete_lists(im.human.list, c("my_list", "diabetesGenes"))
#trying to delete a list not created by the user gives an error
#delete_lists(im.human.list, c("PL_DiabesityGWAS_pval-4"))
#

intermine/rintermine documentation built on May 12, 2021, 2:45 a.m.