Add list manipulation features
Unless I've missed it, there doesn't appear to be any inbuilt way to handles lists, e.g.
- fetch a list by name
- save a list
- Perform list ops like difference, subtract, intersect, etc.
- delete lists
- get a list of lists
Referring to http://intermine.org/intermine-ws-python/intermine.lists.html#module-intermine.lists.listmanager might help to selec useful methods and gain parity for our packages
Fetching list contents can be worked around with a query like this:
# Fetch a public Gene list from HumanMine
# Create a new query
Pax6List = newQuery(
#here we're choosing which columns of data we'd like to see
view = c("Gene.primaryIdentifier",
"Gene.symbol"))
# constrain genes to be in our (pre-existing) list
listConstraint = setConstraints(
paths = c("Gene"),
operators = c("IN"),
values = list("PL_Pax6_Targets")
)
# add constraint to the query
Pax6List$where <- listConstraint
# Now we have the query set up the way we want, let's actually *run* the query!
pax <- runQuery(im = im, qry = Pax6List)
#preview the data
head(pax)
I've added the Hacktoberfest label to this issue - in order to implement methods that manipulate lists you'll probably want to look at the python package mentioned above, as well as these python tutorials: https://github.com/intermine/intermine-ws-python-docs/ (especially tutorial 8)
Other resources that are likely to be useful:
- In order to save / manipulate lists, you'll need to be authenticated - make sure to accept a token as an argument. You'll need to create an account on a live InterMine to test this - perhaps try flymine.org.
- User docs for working with InterMine lists are here: https://flymine.readthedocs.io/en/latest/lists/index.html
- InterMine has interactive API docs: http://iodocs.apps.intermine.org/
- Further InterMine docs are here: https://intermine.readthedocs.io/en/latest/web-services/ and here: http://intermine.org/developers/
if you want to pick up this task
- Take a look at the InterMine contributing guidelines
- Comment on this issue stating that you intend to work on the task
- When you're ready, add your work to the repo and create a pull request.
What to do if you need help
Mention @yochannah, tweet @yoyehudi, pop by to say hi on chat or if needed email [email protected]. Don't forget we're usually only available during uk office hours and will not be able to respond at other times :)
@celions is currently working on this task 🚀