Question: How can I gene names from gene IDs (Arabidopsis)?
4.7 years ago by
Daniel • 3.8k
Daniel • 3.8k wrote:
Alternatively, you can do it via the API which they give templates for. Here is one I bodged from their script for pulling ontologies in bulk rather than one at a time:
$ thalemine_query genelist.txt #!/usr/bin/env python import sys # This is an automatically generated script to run your query # to use it you will require the intermine python client. # To install the client, run the following command from a terminal: # # sudo easy_install intermine # # For further documentation you can visit: # http://intermine.readthedocs.org/en/latest/web-services/ # The following two lines will be needed in every python script: from intermine.webservice import Service service = Service("https://apps.araport.org:443/thalemine/service") # Read file with list of genes for searching. gene_list_file = sys.argv gene_list = open(gene_list_file, "rU") # Get a new query on the class (table) you will be querying: for gene in gene_list: gene = '"' + gene.rstrip() + '"' print gene query = service.new_query("Gene") # The view specifies the output columns query.add_view( "primaryIdentifier", "symbol", "name", "pathways.identifier", "pathways.name" ) # Uncomment and edit the line below (the default) to select a custom sort order: # query.add_sort_order("Gene.primaryIdentifier", "ASC") # You can edit the constraint values below query.add_constraint("Gene", "LOOKUP", gene , "A. thaliana", code = "A") # Uncomment and edit the code below to specify your own custom logic: # query.set_logic("A") for row in query.rows(): print row["primaryIdentifier"], row["symbol"], row["name"], row["pathways.identifier"], \ row["pathways.name"]
ADD COMMENT • link
Please log in to add an answer.
Powered by Biostar version 2.3.0
Traffic: 763 users visited in the last hour