pyEnsemblRest
|
RestServer is a class that knows how to communicate with the Ensembl REST servers. More...
Public Member Functions | |
def | __init__ |
Constructor for the RestServer class. More... | |
def | getArchiveEntry |
Uses the given identifier to return the archived sequence. More... | |
def | getAssemblyInfo |
List the currently available assemblies for a species. More... | |
def | getAssemblyInfoRegion |
Returns information about the specified toplevel sequence region for the given species. More... | |
def | getGeneTreeById |
Retrieves a gene tree dump for a gene tree stable identifier. More... | |
def | getGeneTreeByMemberId |
Retrieves a gene tree that contains the stable identifier. More... | |
def | getGeneTreeByMemberSymbol |
Retrieves a gene tree containing the gene identified by a symbol. More... | |
def | getHomologyByGeneSymbol |
Retrieves homology information (orthologs) by symbol. More... | |
def | getHomologyByGeneStableID |
Retrieves homology information (orthologs) by Ensembl gene id. More... | |
def | getGenomicAlignmentByRegion |
Retrieves genomic alignments as separate blocks based on a region and species. More... | |
def | ping |
Checks if the service is alive. More... | |
def | listSpecies |
Lists all available species, their aliases, available adaptor groups and data release. More... | |
def | listComparaDatabases |
Lists all available comparative genomics databases and their data release. More... | |
def | ensembl_version |
Shows the current version of the Ensembl API used by the REST server. More... | |
def | rest_version |
Shows the current version of the Ensembl REST API. More... | |
def | listAvailableReleases |
Shows the data releases available on this REST server. More... | |
def | getAnalysisList |
List the names of analyses involved in generating Ensembl data. More... | |
def | getBiotypesBySpecies |
List the functional classifications of gene models that Ensembl associates with a particular species. More... | |
def | getExternalDatabasesBySpecies |
Lists all available external sources for a species. More... | |
def | getAllComparaMethods |
List all compara analyses available (an analysis defines the type of comparative data). More... | |
def | getSpeciesSetByComparaMethod |
List all collections of species analysed with the specified compara method. More... | |
def | lookupIdentifier |
Find the species and database for a single identifier. More... | |
def | lookupGeneSymbol |
Find the species and database for a symbol in a linked external database. More... | |
def | mapCoordinatesBetweenAssemblies |
Convert the co-ordinates of one assembly to another. More... | |
def | mapCDNACoordinatesToGenome |
Convert from cDNA coordinates to genomic coordinates. More... | |
def | mapCDSCoordinatesToGenome |
Convert from CDS coordinates to genomic coordinates. More... | |
def | mapProteinCoordinatesToGenome |
Convert from protein (translation) coordinates to genomic coordinates. More... | |
def | getOntologyByID |
Search for an ontological term by its namespaced identifier. More... | |
def | getOntologyByName |
Search for a list of ontological terms by their name. More... | |
def | getAllAncestorsOfOntologyID |
Reconstruct the entire ancestry of a term from is_a and part_of relationships. More... | |
def | getAllDescendantsOfOntologyID |
Find all the terms descended from a given term. More... | |
def | getOntologyAncestorChart |
Reconstruct the entire ancestry of a term from is_a and part_of relationships. More... | |
def | getAllFeaturesOnFeatureID |
Retrieves features (e.g. More... | |
def | getAllFeaturesOnRegion |
Retrieves multiple types of features for a given region. More... | |
def | getAllFeaturesOnTranslation |
Retrieve features related to a specific Translation as described by its stable ID (e.g. More... | |
def | getRegulatoryFeatureByID |
Returns a RegulatoryFeature given its stable ID (e.g. More... | |
def | getFeatureSequenceByID |
Request multiple types of sequence by stable identifier. More... | |
def | getSequenceOfRegion |
Returns the genomic sequence of the specified region of the given species. More... | |
def | getTaxonomyEntryByID |
Search for a taxonomic term by its identifier or name. More... | |
def | getTaxonomyClassificationByID |
Return the taxonomic classification of a taxon node. More... | |
def | getTaxonomyEntryByName |
Search for a taxonomic id by a non-scientific name. More... | |
def | getVariationByID |
Uses a variation identifier (e.g. More... | |
def | getVariantConsequencesByRegionAllele |
Fetch variant consequences. More... | |
def | getVariantConsequencesByVariationID |
Fetch variant consequences based on a variation identifier. More... | |
def | getVariantConsequencesByHGVS |
Fetch variant consequences based on a HGVS notation. More... | |
Public Attributes | |
server_url | |
http | |
last_headers | |
Private Member Functions | |
def | __get_json_answer |
def | __build_rest_answer |
Static Private Attributes | |
dictionary | __content_types |
dictionary | __return_codes |
RestServer is a class that knows how to communicate with the Ensembl REST servers.
Definition at line 38 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.__init__ | ( | self, | |
server_url | |||
) |
Constructor for the RestServer class.
server_url is the URL of the server.
Definition at line 66 of file _pyrest_server.py.
|
private |
Definition at line 102 of file _pyrest_server.py.
|
private |
def ensembl._pyrest_server.RestServer.ensembl_version | ( | self, | |
kwargs | |||
) |
Shows the current version of the Ensembl API used by the REST server.
Return type: None Valid formats: json, xml HTTP endpoint: info/software
Definition at line 433 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getAllAncestorsOfOntologyID | ( | self, | |
id, | |||
kwargs | |||
) |
Reconstruct the entire ancestry of a term from is_a and part_of relationships.
Return type: ensembl.info.OntologyTerm Valid formats: json, xml, yaml HTTP endpoint: ontology/ancestors/:id
Required parameters:
Optional parameters:
Definition at line 746 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getAllComparaMethods | ( | self, | |
kwargs | |||
) |
List all compara analyses available (an analysis defines the type of comparative data).
Return type: None Valid formats: json, json, yaml, xml HTTP endpoint: info/compara/methods
Optional parameters:
Definition at line 528 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getAllDescendantsOfOntologyID | ( | self, | |
id, | |||
kwargs | |||
) |
Find all the terms descended from a given term.
By default searches are conducted within the namespace of the given identifier
Return type: ensembl.info.OntologyTerm Valid formats: json, xml HTTP endpoint: ontology/descendants/:id
Required parameters:
Optional parameters:
Definition at line 771 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getAllFeaturesOnFeatureID | ( | self, | |
id, | |||
kwargs | |||
) |
Retrieves features (e.g.
genes, transcripts, variations etc.) that overlap a region defined by the given identifier.
Return type: ensembl.genome.feature_wrapper Valid formats: json, xml, gff3, bed HTTP endpoint: overlap/id/:id
Required parameters:
Optional parameters:
Definition at line 825 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getAllFeaturesOnRegion | ( | self, | |
species, | |||
region, | |||
kwargs | |||
) |
Retrieves multiple types of features for a given region.
Return type: ensembl.genome.feature_wrapper Valid formats: json, xml, gff3, bed HTTP endpoint: overlap/region/:species/:region
Required parameters:
Optional parameters:
Definition at line 864 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getAllFeaturesOnTranslation | ( | self, | |
id, | |||
kwargs | |||
) |
Retrieve features related to a specific Translation as described by its stable ID (e.g.
domains, variations).
Return type: ensembl.genome.feature_wrapper Valid formats: json, xml HTTP endpoint: overlap/translation/:id
Required parameters:
Optional parameters:
Definition at line 891 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getAnalysisList | ( | self, | |
species, | |||
kwargs | |||
) |
List the names of analyses involved in generating Ensembl data.
Return type: None Valid formats: json, xml HTTP endpoint: info/analysis/:species
Required parameters:
Definition at line 475 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getArchiveEntry | ( | self, | |
id, | |||
kwargs | |||
) |
Uses the given identifier to return the archived sequence.
Return type: ensembl.info.ArchiveEntry Valid formats: json, xml HTTP endpoint: archive/id/:id
Required parameters:
Definition at line 146 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getAssemblyInfo | ( | self, | |
species, | |||
kwargs | |||
) |
List the currently available assemblies for a species.
Return type: ensembl.info.Assembly Valid formats: json, xml HTTP endpoint: info/assembly/:species
Required parameters:
Optional parameters:
Definition at line 165 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getAssemblyInfoRegion | ( | self, | |
species, | |||
region_name, | |||
kwargs | |||
) |
Returns information about the specified toplevel sequence region for the given species.
Return type: ensembl.info.SeqRegion Valid formats: json, xml HTTP endpoint: info/assembly/:species/:region_name
Required parameters:
Optional parameters:
Definition at line 186 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getBiotypesBySpecies | ( | self, | |
species, | |||
kwargs | |||
) |
List the functional classifications of gene models that Ensembl associates with a particular species.
Useful for restricting the type of genes/transcripts retrieved by other endpoints.
Return type: ensembl.info.Biotype Valid formats: json, xml HTTP endpoint: info/biotypes/:species
Required parameters:
Definition at line 491 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getExternalDatabasesBySpecies | ( | self, | |
species, | |||
kwargs | |||
) |
Lists all available external sources for a species.
Return type: ensembl.info.ExternalDatabase Valid formats: json, xml HTTP endpoint: info/external_dbs/:species
Required parameters:
Optional parameters:
Definition at line 510 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getFeatureSequenceByID | ( | self, | |
id, | |||
kwargs | |||
) |
Request multiple types of sequence by stable identifier.
Return type: ensembl.genome.Sequence Valid formats: fasta, json, text, yaml HTTP endpoint: sequence/id/:id
Required parameters:
Optional parameters:
Definition at line 946 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getGeneTreeById | ( | self, | |
id, | |||
kwargs | |||
) |
Retrieves a gene tree dump for a gene tree stable identifier.
Return type: ensembl.compara.GeneTree Valid formats: phyloxml, nh, json HTTP endpoint: genetree/id/:id
Required parameters:
Optional parameters:
Definition at line 211 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getGeneTreeByMemberId | ( | self, | |
id, | |||
kwargs | |||
) |
Retrieves a gene tree that contains the stable identifier.
Return type: ensembl.compara.GeneTree Valid formats: phyloxml, nh, json HTTP endpoint: genetree/member/id/:id
Required parameters:
Optional parameters:
Definition at line 242 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getGeneTreeByMemberSymbol | ( | self, | |
species, | |||
symbol, | |||
kwargs | |||
) |
Retrieves a gene tree containing the gene identified by a symbol.
Return type: ensembl.compara.GeneTree Valid formats: phyloxml, nh, json HTTP endpoint: genetree/member/symbol/:species/:symbol
Required parameters:
Optional parameters:
Definition at line 275 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getGenomicAlignmentByRegion | ( | self, | |
species, | |||
region, | |||
kwargs | |||
) |
Retrieves genomic alignments as separate blocks based on a region and species.
Return type: ensembl.compara.GenomicAlignment Valid formats: json, xml, phyloxml HTTP endpoint: alignment/region/:species/:region
Required parameters:
Optional parameters:
Definition at line 378 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getHomologyByGeneStableID | ( | self, | |
id, | |||
kwargs | |||
) |
Retrieves homology information (orthologs) by Ensembl gene id.
Return type: ensembl.compara.HomologyGroup Valid formats: json, xml, orthoxml HTTP endpoint: homology/id/:id
Required parameters:
Optional parameters:
Definition at line 343 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getHomologyByGeneSymbol | ( | self, | |
species, | |||
symbol, | |||
kwargs | |||
) |
Retrieves homology information (orthologs) by symbol.
Return type: ensembl.compara.HomologyGroup Valid formats: json, xml, orthoxml HTTP endpoint: homology/symbol/:species/:symbol
Required parameters:
Optional parameters:
Definition at line 310 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getOntologyAncestorChart | ( | self, | |
id, | |||
kwargs | |||
) |
Reconstruct the entire ancestry of a term from is_a and part_of relationships.
Return type: Dictionary of String -> ensembl.info.OntologyEntry Valid formats: json, xml HTTP endpoint: ontology/ancestors/chart/:id
Required parameters:
Optional parameters:
Definition at line 790 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getOntologyByID | ( | self, | |
id, | |||
kwargs | |||
) |
Search for an ontological term by its namespaced identifier.
Return type: ensembl.info.OntologyTerm Valid formats: json, xml, yaml HTTP endpoint: ontology/id/:id
Required parameters:
Optional parameters:
Definition at line 704 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getOntologyByName | ( | self, | |
name, | |||
kwargs | |||
) |
Search for a list of ontological terms by their name.
Return type: ensembl.info.OntologyTerm Valid formats: json, xml, yaml HTTP endpoint: ontology/name/:name
Required parameters:
Optional parameters:
Definition at line 727 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getRegulatoryFeatureByID | ( | self, | |
species, | |||
id, | |||
kwargs | |||
) |
Returns a RegulatoryFeature given its stable ID (e.g.
ENSR00001348195)
Return type: ensembl.funcgen.RegulatoryFeature Valid formats: json, xml HTTP endpoint: regulatory/:species/:id
Required parameters:
Definition at line 909 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getSequenceOfRegion | ( | self, | |
species, | |||
region, | |||
kwargs | |||
) |
Returns the genomic sequence of the specified region of the given species.
Return type: ensembl.genome.Sequence Valid formats: fasta, json, text, yaml HTTP endpoint: sequence/region/:species/:region
Required parameters:
Optional parameters:
Definition at line 979 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getSpeciesSetByComparaMethod | ( | self, | |
method, | |||
kwargs | |||
) |
List all collections of species analysed with the specified compara method.
Return type: ensembl.compara.MethodLinkSpeciesSet Valid formats: json, yaml, xml HTTP endpoint: info/compara/species_sets/:method
Required parameters:
Optional parameters:
Definition at line 547 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getTaxonomyClassificationByID | ( | self, | |
id, | |||
kwargs | |||
) |
Return the taxonomic classification of a taxon node.
Return type: ensembl.compara.NCBITaxon Valid formats: json, xml, yaml HTTP endpoint: taxonomy/classification/:id
Required parameters:
Definition at line 1014 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getTaxonomyEntryByID | ( | self, | |
id, | |||
kwargs | |||
) |
Search for a taxonomic term by its identifier or name.
Return type: ensembl.compara.NCBITaxon Valid formats: json, xml, yaml HTTP endpoint: taxonomy/id/:id
Required parameters:
Optional parameters:
Definition at line 998 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getTaxonomyEntryByName | ( | self, | |
name, | |||
kwargs | |||
) |
Search for a taxonomic id by a non-scientific name.
Return type: ensembl.compara.NCBITaxon Valid formats: json, xml, yaml HTTP endpoint: taxonomy/name/:name
Required parameters:
Definition at line 1030 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getVariantConsequencesByHGVS | ( | self, | |
species, | |||
hgvs_notation, | |||
kwargs | |||
) |
Fetch variant consequences based on a HGVS notation.
Return type: ensembl.variation.VEPResult Valid formats: json, xml HTTP endpoint: vep/:species/hgvs/:hgvs_notation
Required parameters:
Optional parameters:
Definition at line 1158 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getVariantConsequencesByRegionAllele | ( | self, | |
species, | |||
region, | |||
allele, | |||
kwargs | |||
) |
Fetch variant consequences.
Return type: ensembl.variation.VEPResult Valid formats: json, xml HTTP endpoint: vep/:species/region/:region/:allele/
Required parameters:
Optional parameters:
Definition at line 1092 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getVariantConsequencesByVariationID | ( | self, | |
species, | |||
id, | |||
kwargs | |||
) |
Fetch variant consequences based on a variation identifier.
Return type: ensembl.variation.VEPResult Valid formats: json, xml HTTP endpoint: vep/:species/id/:id
Required parameters:
Optional parameters:
Definition at line 1125 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.getVariationByID | ( | self, | |
species, | |||
id, | |||
kwargs | |||
) |
Uses a variation identifier (e.g.
rsID) to return the variation features
Return type: ensembl.variation.Variation Valid formats: json, xml HTTP endpoint: variation/:species/:id
Required parameters:
Optional parameters:
Definition at line 1057 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.listAvailableReleases | ( | self, | |
kwargs | |||
) |
Shows the data releases available on this REST server.
May return more than one release (unfrequent non-standard Ensembl configuration).
Return type: None Valid formats: json, xml HTTP endpoint: info/data
Definition at line 459 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.listComparaDatabases | ( | self, | |
kwargs | |||
) |
Lists all available comparative genomics databases and their data release.
Return type: None Valid formats: json, xml HTTP endpoint: info/comparas
Definition at line 420 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.listSpecies | ( | self, | |
kwargs | |||
) |
Lists all available species, their aliases, available adaptor groups and data release.
Return type: ensembl.info.Species Valid formats: json, xml HTTP endpoint: info/species
Optional parameters:
Definition at line 407 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.lookupGeneSymbol | ( | self, | |
species, | |||
symbol, | |||
kwargs | |||
) |
Find the species and database for a symbol in a linked external database.
Return type: ensembl.genome.feature_wrapper Valid formats: json, xml HTTP endpoint: lookup/symbol/:species/:symbol
Required parameters:
Optional parameters:
Definition at line 595 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.lookupIdentifier | ( | self, | |
id, | |||
kwargs | |||
) |
Find the species and database for a single identifier.
Return type: ensembl.genome.feature_wrapper Valid formats: json, xml HTTP endpoint: lookup/id/:id
Required parameters:
Optional parameters:
Definition at line 572 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.mapCDNACoordinatesToGenome | ( | self, | |
id, | |||
region, | |||
kwargs | |||
) |
Convert from cDNA coordinates to genomic coordinates.
Output reflects forward orientation coordinates as returned from the Ensembl API.
Return type: ensembl.genome.Location Valid formats: json, xml HTTP endpoint: map/cdna/:id/:region
Required parameters:
Optional parameters:
Definition at line 641 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.mapCDSCoordinatesToGenome | ( | self, | |
id, | |||
region, | |||
kwargs | |||
) |
Convert from CDS coordinates to genomic coordinates.
Output reflects forward orientation coordinates as returned from the Ensembl API.
Return type: ensembl.genome.Location Valid formats: json, xml HTTP endpoint: map/cds/:id/:region
Required parameters:
Optional parameters:
Definition at line 662 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.mapCoordinatesBetweenAssemblies | ( | self, | |
species, | |||
asm_one, | |||
region, | |||
asm_two, | |||
kwargs | |||
) |
Convert the co-ordinates of one assembly to another.
Return type: ensembl.genome.CoordMapping Valid formats: json, xml HTTP endpoint: map/:species/:asm_one/:region/:asm_two
Required parameters:
Optional parameters:
Definition at line 620 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.mapProteinCoordinatesToGenome | ( | self, | |
id, | |||
region, | |||
kwargs | |||
) |
Convert from protein (translation) coordinates to genomic coordinates.
Output reflects forward orientation coordinates as returned from the Ensembl API.
Return type: ensembl.genome.Location Valid formats: json, xml HTTP endpoint: map/translation/:id/:region
Required parameters:
Optional parameters:
Definition at line 683 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.ping | ( | self, | |
kwargs | |||
) |
Checks if the service is alive.
Return type: None Valid formats: json, xml HTTP endpoint: info/ping
Definition at line 391 of file _pyrest_server.py.
def ensembl._pyrest_server.RestServer.rest_version | ( | self, | |
kwargs | |||
) |
Shows the current version of the Ensembl REST API.
Return type: None Valid formats: json, xml HTTP endpoint: info/rest
Definition at line 446 of file _pyrest_server.py.
|
staticprivate |
Definition at line 41 of file _pyrest_server.py.
|
staticprivate |
Definition at line 53 of file _pyrest_server.py.
ensembl._pyrest_server.RestServer.http |
Definition at line 68 of file _pyrest_server.py.
ensembl._pyrest_server.RestServer.last_headers |
Definition at line 69 of file _pyrest_server.py.
ensembl._pyrest_server.RestServer.server_url |
Definition at line 67 of file _pyrest_server.py.