Skip to content

Instantly share code, notes, and snippets.

@saliksyed
Last active November 1, 2018 14:19
Show Gist options
  • Save saliksyed/990f669a3cebcfdd82e57ef0d7aa586f to your computer and use it in GitHub Desktop.
Save saliksyed/990f669a3cebcfdd82e57ef0d7aa586f to your computer and use it in GitHub Desktop.
Improving the API interface
class Pathway:
def __init__(self, api):
self.api = api
def datasets(self):
""" Returns the list of all pathway datasets available"""
pass
def getPathways(self, datasets=[Dataset.KEGG]):
""" Returns the list of all pathways available, optionally filtering by dataset"""
pass
def getPathwaysWithGenesInQuery(self, geneQuery=None, datasets=[Dataset.KEGG]):
""" Returns the list of pathways that contains genes within geneQuery"""
pass
def getGenesInPathway(self, pathway):
""" Returns the list of genes in the specified pathway """
pass
class Variant:
def __init__(self, api):
self.api = api
def datasets(self):
""" Returns the list of all variant datasets available"""
pass
def tags(self, datasets=[Dataset.EXAC]):
""" Returns the variant tags available, optionally filtered by datasets"""
pass
def gwasDatasets(self):
""" Returns the GWAS datasets that are available"""
pass
def eqtlDatasets(self):
""" Returns the eQTL datasets that are available"""
pass
def getEQTLs(self, biosample=None, genesQuery=None, datasets=[Dataset.GTEX]):
""" Returns the eQTLs contained within datasets, filtered by optional biosamples and optionally affecting genes within geneQuery"""
pass
def getVariantsForGenesInQuery(self, geneQuery=None, variantTags=None, datasets=[Dataset.EXAC, Dataset.CLINVAR, Dataset.DBSNP]):
""" Returns the variants contained within datasets, filtered by variantTags and affecting genes within geneQuery"""
pass
def getVariantsForAnnotationsInQuery(self, annotationQuery=None, variantTags=None, datasets=[Dataset.EXAC, Dataset.CLINVAR, Dataset.DBSNP]):
""" Returns the variants contained within datasets, filtered by variantTags and affecting annotations within annotationQuery"""
pass
class GenomicRegion:
def __init__(self):
pass
def addInterval(self, contig, start, end):
pass
def removeInterval(self, contig, start, end):
pass
def getIntervals(self):
pass
def setIntervals(self, intervals):
pass
def createFromBED(self, path):
pass
def commit(self):
pass
def getQuery(self):
pass
class Annotation:
def __init__(self, api):
self.api = api
def datasets(self):
""" Returns the list of annotation datasets available e.g ENCODE, ENSEMBL, ROADMAP """
pass
def biosamples(self, datasets=[Dataset.ENCODE]):
""" Returns the list of biosamples available """
pass
def targets(self, biosamples=None, annotationTypes=None, datasets=[Dataset.ENCODE]):
""" Returns the list of targets available """
pass
def annotationTypes(self, biosamples=None, datasets=[Dataset.ENCODE]):
""" Returns the list of annotation types available """
pass
def getAnnotations(self, annotationTypes=None, biosamples=None, nnotationTargets=None, datasets=[Dataset.ENCODE]):
""" Returns a query for the specified annotation types"""
pass
def getGenes(self, names):
""" helper method that fetches a single gene or list of genes"""
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment