{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Intermine-Python: Tutorial 8: Accessing your saved Templates" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This very short tutorial will talk about how you can access your saved templates and lists if you have your login information (username and password). If you don't have an account, you can create one at http://www.flymine.org/" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Once, you have made an account, you can use the web service to create a query of your choice and save it as a template. This template can be used through the Python API or through the web service. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To login and access your templates through Python, you can provide your login information as shown below. Note that the code shown below is in comments because it needs to be specific to your account. Change the username and password to match yours, uncomment the code, and then run it. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from intermine.webservice import Service\n", "from intermine import query" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# service=Service(\"www.flymine.org/flymine/service\",username=\"Enter username\",password=\"Enter password\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "#template=service.get_template(\"Name of a saved template\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can then play around with this saved template like any of the existing templates on Flymine. " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To view the names of all the available templates you can view the templates dictionary and iterate through it. This can be done as follows. " ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "service = Service(\"https://www.flymine.org/flymine/service\")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Gene_RegionLocation\n", "AlleleClass_Allele\n", "FlyFish_Genes\n", "Organism_Sequence\n", "GOterm_GenesInsertions\n", "Gene_BDGP\n", "Pathway_Genes\n", "AllGene_Chromosome\n", "Gene_IntronChromosome\n", "RNA_seq_Genes\n", "protein_interactions\n", "Gene_GOAll\n", "Gene_Interactions2\n", "RNAiScreen_genes\n", "Gene_CDSs\n", "OrganismGO_GenePointMutation\n", "Gene_Publications\n", "Protein_GeneChromosomeLength\n", "protein_domains2\n", "GO_Gene\n", "Gene_Pathway\n", "All_Genes_In_Organism_To_Publications\n", "Organism_NaturalTransposableElements\n", "Organism_Protein\n", "Tissue_Flyatlas\n", "PhenotypeType_Alleles\n", "TranscriptionFactor_Genes\n", "ChromLocation_GeneTranscriptExon\n", "Gene_PointMutationLocation\n", "AnatomyTerm_Region\n", "Gene_Protein\n", "Gene_transposableElementsOverlappingExons\n", "Gene_OverlapppingGenes\n", "Transcriptionfactor_TFBindingSiteGene\n", "Gene_RNAi\n", "Gene_TimeCourseExpression\n", "CRM _AnatomyTerm\n", "protein_domain\n", "ChromLocation_Gene\n", "Chromosome_Gene\n", "Gene_GO\n", "Organism_transposableElementInsertionSites\n", "ChromLocation_CRM\n", "Gene_AdjacentGenes\n", "Organism_3UTR\n", "Gene_overlapping2\n", "Gene_Orth_seq\n", "Gene_disease\n", "Protein_PublicationAll\n", "Intron_regulatoryRegions\n", "Disease_gene2\n", "FlyRegBindingSite_TranscriptionFactor\n", "organism_allmiRNA\n", "Gene_FlyAtlas_TissueList\n", "Gene_RegulatoryRegion\n", "Gene_proteindomain\n", "ChromLocation_RegulatoryRegion\n", "Probe_Gene\n", "BDGP_Gene\n", "geneInteractiongene\n", "modENCODE_RNA_seq_Tissues\n", "Gene_AlleleStocks\n", "Publication_Genes\n", "Transcript_INDAC\n", "Pathway_GenesOrthol_new2\n", "Test_for_Julianne\n", "Gene_TranscriptExonLocation\n", "ChromLocation_TFBindingSiteLocationGeneFactor\n", "Gene_upstreamRegulatoryRegions\n", "GOterm_genesDrosDelDeletion\n", "Gene_Insertion\n", "Stage_FlyFishBDGP\n", "Organism_5UTR\n", "organismGenes_GOterms\n", "Intergenic_RegRegion\n", "Organism_GenesTranscriptsExonsIntrons\n", "ChromLocation_CRMOverlappingTFBindingsite\n", "Gene_enhancer\n", "Gene_AdjacentGene_FlyAtlas_upstream\n", "MeSH_Publication\n", "Gene_Location\n", "Gene_Probe\n", "Gene_ExonLocation2\n", "ChromLocation_GeneTranscriptINDAC\n", "Gene_RNA_seq\n", "Gene_INDAC\n", "PointMutation_Gene_Chromosome\n", "Clone_gene\n", "TimeCourseData_Gene\n", "Chromosome_IntergenicSequence\n", "Gene_AdjacentGene_FlyAtlas_downstream\n", "Gene_1CDSsequence\n", "Gene_DrosophilaOrthologues\n", "NaturalTransposableElement_InsertedElements\n", "Organism_Intergenic\n", "Gene_pathway_interactions\n", "Organism_NaturalTransposableElementsandSites\n", "GeneTissue_FlyAtlas\n", "Gene_TranscriptOrthologue\n", "Gene_FlyAtlas\n", "Mutagen_Allele\n", "AnatomyTerm_Alleles\n", "ECnumber_gene_protein\n", "miRNA_Targets\n", "Organism_GOtermsOrthologues\n", "Dataset_TF_BindingSites\n", "Chromosome_CRMOverlappingInsertion\n", "DrosDel_GeneLocation\n", "Genes_Publications\n", "miRNAtargetGene_miRNAgene\n", "ProbeSet_FlyAtlas\n", "ListPathway\n", "INDAC_GeneLocation\n", "Gene_transcriptionFactors\n", "Gene_FlyFish\n", "Gene_AdjacentGenesLocations\n", "Protein_GOterms_1\n", "Disease_gene_orthologue\n", "Protein_Publication\n", "InterPro_Domain_Family\n", "Gene_Alleles\n", "Gene_Orth\n", "organism_allGenes\n", "GO_GeneOrthologues\n", "Chromosome_GeneInsertionLocation\n", "Gene_BDGPFlyFish\n", "Protein_DomainGO\n" ] } ], "source": [ "templates=service.templates\n", "for name in templates.keys():\n", " print(name)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This dictionary contains all the information about all the available templates, including the exact name and description. If you now want to view the details about a particular template name, this can be done as shown below. " ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "''" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "templates[\"Gene_RNAi\"]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you don't feel comfortable with viewing this dictionary, you can also view the templates on: http://beta.flymine.org/beta/templates.do and https://www.flymine.org/flymine/templates.do You can scroll through the list of templates. If you find an interesting template, click on the template and click on the Python tab (in blue). This would show you how to call the template in Python using the exact name. " ] } ], "metadata": { "anaconda-cloud": {}, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.9" } }, "nbformat": 4, "nbformat_minor": 1 }