pyEnsemblRest
 All Classes Namespaces Files Functions Variables Properties
ensembl._pyrest_server.RestServer Class Reference

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
 

Detailed Description

RestServer is a class that knows how to communicate with the Ensembl REST servers.

Definition at line 38 of file _pyrest_server.py.

Constructor & Destructor Documentation

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.

Member Function Documentation

def ensembl._pyrest_server.RestServer.__build_rest_answer (   self,
  new_object,
  allowed_formats,
  optional_params,
  accessor,
  url,
  kwargs = {} 
)
private

Definition at line 102 of file _pyrest_server.py.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

def ensembl._pyrest_server.RestServer.__get_json_answer (   self,
  url,
  content_type = None 
)
private

Definition at line 72 of file _pyrest_server.py.

+ Here is the caller graph for this function:

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.

+ Here is the call graph for this function:

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:

  • id (String) An ontology term identifier

Optional parameters:

  • ontology (String) Filter by ontology. Used to disambiguate terms which are shared between ontologies such as GO and EFO

Definition at line 746 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • compara (String) Name of the compara database to use. Multiple comparas may exist on a server when accessing Ensembl Genomes data.
  • class (String) The class of the method to query for. Regular expression patterns are supported.

Definition at line 528 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An ontology term identifier

Optional parameters:

  • ontology (String) Filter by ontology. Used to disambiguate terms which are shared between ontologies such as GO and EFO
  • subset (String) Filter terms by the specified subset
  • closest_term (Boolean) If true return only the closest terms to the specified term
  • zero_distance (Boolean) Return terms with a distance of 0

Definition at line 771 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID

Optional parameters:

  • species (String) Species name/alias.
  • object_type (String) Filter by feature type
  • db_type (String) Restrict the search to a database other than the default. Useful if you need to use a DB other than core
  • feature (Enum(gene, transcript, cds, exon, repeat, simple, misc, variation, somatic_variation, structural_variation, somatic_structural_variation, constrained, regulatory, segmentation, motif, chipseq, array_probe)) The type of feature to retrieve. Multiple values are accepted.
  • species_set (String) Filter by species set for retrieving constrained elements.
  • logic_name (String) Limit retrieval of genes, transcripts and exons by a given name of an analysis.
  • so_term (String) Sequence Ontology term to narrow down the possible variations returned.
  • misc_set (String) Miscellaneous set which groups together feature entries. Consult the DB or returned data sets to discover what is available.
  • biotype (String) The functional classification of the gene or transcript to fetch. Cannot be used in conjunction with logic_name when querying transcripts.

Definition at line 825 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias.
  • region (String) Query region. A maximum of 5Mb is allowed to be requested at any one time

Optional parameters:

  • db_type (String) Specify the database type to retrieve features from if not using the core database. We automatically choose the correct type of DB for variation, comparative and regulation features.
  • feature (Enum(gene, transcript, cds, exon, repeat, simple, misc, variation, somatic_variation, structural_variation, somatic_structural_variation, constrained, regulatory, segmentation, motif, chipseq, array_probe)) The type of feature to retrieve. Multiple values are accepted.
  • species_set (String) The species set name for retrieving constrained elements.
  • logic_name (String) Limit retrieval of genes, transcripts and exons by the name of analysis.
  • so_term (String) Sequence Ontology term to restrict the variations found. Its descendants are also included in the search.
  • cell_type (String) Cell type name in Ensembl's Regulatory Build, required for segmentation feature, optional for regulatory elements.
  • misc_set (String) Miscellaneous set which groups together feature entries. Consult the DB or returned data sets to discover what is available.
  • biotype (String) Functional classification of the gene or transcript to fetch. Cannot be used in conjunction with logic_name when querying transcripts.
  • trim_upstream (Boolean) Do not return features which overlap upstream end of the region.
  • trim_downstream (Boolean) Do not return features which overlap the downstream end of the region.

Definition at line 864 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID

Optional parameters:

  • species (String) Species name/alias.
  • db_type (String) Restrict the search to a database other than the default. Useful if you need to use a DB other than core
  • feature (Enum(transcript_variation, protein_feature, residue_overlap, translation_exon, somatic_transcript_variation)) Specify the type of features requested for the translation.
  • type (String) Type of data to filter by. By default, all features are returned. Can specify a domain or consequence type.
  • so_term (String) Sequence Ontology term to restrict the variations found. Its descendants are also included in the search.

Definition at line 891 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias

Definition at line 475 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID

Definition at line 146 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias

Optional parameters:

  • bands (Boolean(0,1)) If set to 1, include karyotype band information. Only display if band information is available

Definition at line 165 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • region_name (String) The (top level) sequence region name.

Optional parameters:

  • bands (Boolean(0,1)) If set to 1, include karyotype band information. Only display if band information is available

Definition at line 186 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias

Definition at line 491 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias

Optional parameters:

  • filter (String) Restrict external DB searches to a single source or pattern. SQL-LIKE patterns are supported.

Definition at line 510 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID

Optional parameters:

  • type (Enum(genomic,cds,cdna,protein)) Type of sequence. Defaults to genomic where applicable, i.e. not translations. cdna refers to the spliced transcript sequence with UTR; cds refers to the spliced transcript sequence without UTR.
  • species (String) Species name/alias
  • object_type (String) Filter by feature type
  • db_type (String) Restrict the search to a database other than the default. Useful if you need to use a DB other than core
  • format (Enum(fasta)) Format of the data
  • mask (Enum(hard,soft)) Request the sequence masked for repeat sequences. Hard will mask all repeats as N's and soft will mask repeats as lowercased characters. Only available when using genomic sequence type.
  • mask_feature (Boolean) Mask features on the sequence. If sequence is genomic, mask introns. If sequence is cDNA, mask UTRs. Incompatible with the 'mask' option
  • expand_5prime (Int) Expand the sequence upstream of the sequence by this many basepairs. Only available when using genomic sequence type.
  • expand_3prime (Int) Expand the sequence downstream of the sequence by this many basepairs. Only available when using genomic sequence type.
  • multiple_sequences (Boolean) Allow the service to return more than 1 sequence per identifier. This is useful when querying for a gene but using a type such as protein.

Definition at line 946 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl genetree ID

Optional parameters:

  • compara (String) Name of the compara database to use. Multiple comparas can exist on a server if you are accessing Ensembl Genomes data
  • aligned (Boolean) Return the aligned string if true. Otherwise, return the original sequence (no insertions)
  • sequence (Enum(none, cdna, protein)) The type of sequence to bring back. Setting it to none results in no sequence being returned
  • nh_format (Enum(full, display_label_composite, simple, species, species_short_name, ncbi_taxon, ncbi_name, njtree, phylip)) The format of a NH (New Hampshire) request.

Definition at line 211 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID

Optional parameters:

  • species (String) Species name/alias
  • db_type (String) Restrict the search to a database other than the default. Useful if you need to use a DB other than core
  • object_type (String) Filter by feature type
  • compara (String) Name of the compara database to use. Multiple comparas can exist on a server if you are accessing Ensembl Genomes data
  • aligned (Boolean) Return the aligned string if true. Otherwise, return the original sequence (no insertions)
  • sequence (Enum(none, cdna, protein)) The type of sequence to bring back. Setting it to none results in no sequence being returned
  • nh_format (Enum(full, display_label_composite, simple, species, species_short_name, ncbi_taxon, ncbi_name, njtree, phylip)) The format of a NH (New Hampshire) request.

Definition at line 242 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • symbol (String) Symbol or display name of a gene

Optional parameters:

  • db_type (String) Restrict the search to a database other than the default. Useful if you need to use a DB other than core
  • external_db (String) Filter by external database
  • object_type (String) Filter by feature type
  • compara (String) Name of the compara database to use. Multiple comparas can exist on a server if you are accessing Ensembl Genomes data
  • aligned (Boolean) Return the aligned string if true. Otherwise, return the original sequence (no insertions)
  • sequence (Enum(none, cdna, protein)) The type of sequence to bring back. Setting it to none results in no sequence being returned
  • nh_format (Enum(full, display_label_composite, simple, species, species_short_name, ncbi_taxon, ncbi_name, njtree, phylip)) The format of a NH (New Hampshire) request.

Definition at line 275 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • region (String) Query region. A maximum of 10Mb is allowed to be requested at any one time

Optional parameters:

  • compara (String) Name of the compara database to use. Multiple comparas can exist on a server if you are accessing Ensembl Genomes data
  • aligned (Boolean) Return the aligned string if true. Otherwise, return the original sequence (no insertions)
  • mask (Enum(hard,soft)) Request the sequence masked for repeat sequences. Hard will mask all repeats as N's and soft will mask repeats as lowercased characters.
  • species_set_group (String) The species set group name of the multiple alignment. Should not be used with the species_set parameter. Use /info/compara/species_sets/:method with one of the methods listed above to obtain a valid list of group names.
  • species_set (String) The set of species used to define the pairwise alignment (multiple values). Should not be used with the species_set_group parameter. Use /info/compara/species_sets/:method with one of the methods listed above to obtain a valid list of species sets. Any valid alias may be used.
  • method (Enum(EPO, EPO_LOW_COVERAGE, PECAN, LASTZ_NET, BLASTZ_NET, TRANSLATED_BLAT_NET)) The alignment method
  • display_species_set (String) Subset of species in the alignment to be displayed (multiple values). All the species in the alignment will be displayed if this is not set. Any valid alias may be used.
  • compact (Boolean) Applicable to EPO_LOW_COVERAGE alignments. If true, concatenate the low coverage species sequences together to create a single sequence. Otherwise, separates out all sequences.

Definition at line 378 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID

Optional parameters:

  • species (String) Species name/alias
  • compara (String) Name of the compara database to use. Multiple comparas can exist on a server if you are accessing Ensembl Genomes data
  • format (Enum(full, condensed)) Layout of the response
  • type (Enum(orthologues, paralogues, projections, all)) The type of homology to return from this call. Projections are orthology calls defined between alternative assemblies and the genes shared between them. Useful if you need only one type of homology back from the service
  • target_species (String) Filter by species. Supports all species aliases
  • target_taxon (Integer) Filter by taxon
  • aligned (Boolean) Return the aligned string if true. Otherwise, return the original sequence (no insertions)
  • sequence (Enum(none, cdna, protein)) The type of sequence to bring back. Setting it to none results in no sequence being returned

Definition at line 343 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • symbol (String) Symbol or display name of a gene

Optional parameters:

  • compara (String) Name of the compara database to use. Multiple comparas can exist on a server if you are accessing Ensembl Genomes data
  • external_db (String) Filter by external database
  • format (Enum(full,condensed)) Layout of the response
  • type (Enum(orthologues, paralogues, projections, all)) The type of homology to return from this call. Projections are orthology calls defined between alternative assemblies and the genes shared between them. Useful if you need only one type of homology back from the service
  • target_species (String) Filter by species. Supports all species aliases
  • target_taxon (Integer) Filter by taxon
  • aligned (Boolean) Return the aligned string if true. Otherwise, return the original sequence (no insertions)
  • sequence (Enum(none, cdna, protein)) The type of sequence to bring back. Setting it to none results in no sequence being returned

Definition at line 310 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An ontology term identifier

Optional parameters:

  • ontology (String) Filter by ontology. Used to disambiguate terms which are shared between ontologies such as GO and EFO

Definition at line 790 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An ontology term identifier

Optional parameters:

  • relation (String) The types of relationships to include in the output. Fetches all relations by default
  • simple (Boolean) If set the API will avoid the fetching of parent and child terms

Definition at line 704 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • name (String) An ontology name. SQL wildcards are supported

Optional parameters:

  • ontology (String) Filter by ontology. Used to disambiguate terms which are shared between ontologies such as GO and EFO
  • relation (String) The types of relationships to include in the output. Fetches all relations by default
  • simple (Boolean) If set the API will avoid the fetching of parent and child terms

Definition at line 727 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • id (String) RegulatoryFeature stable ID

Definition at line 909 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • region (String) Query region. A maximum of 10Mb is allowed to be requested at any one time

Optional parameters:

  • format (Enum(fasta)) Format of the data.
  • mask (Enum(hard,soft)) Request the sequence masked for repeat sequences. Hard will mask all repeats as N's and soft will mask repeats as lower cased characters. Only available when using genomic sequence type.
  • mask_feature (Boolean) Mask features on the sequence. If sequence is genomic, mask introns. If sequence is cDNA, mask UTRs. Incompatible with the 'mask' option
  • expand_5prime (Int) Expand the sequence upstream of the sequence by this many basepairs. Only available when using genomic sequence type.
  • expand_3prime (Int) Expand the sequence downstream of the sequence by this many basepairs. Only available when using genomic sequence type.
  • coord_system (String) Filter by coordinate system name
  • coord_system_version (String) Filter by coordinate system version

Definition at line 979 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • method (String) Filter by compara method. Use one the methods returned by /info/compara/methods endpoint.

Optional parameters:

  • compara (String) Name of the compara database to use. Multiple comparas may exist on a server when accessing Ensembl Genomes data.

Definition at line 547 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) A taxon identifier. Can be a NCBI taxon id or a name

Definition at line 1014 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) A taxon identifier. Can be a NCBI taxon id or a name

Optional parameters:

  • simple (Boolean) If set the API will avoid the fetching of parent and child terms

Definition at line 998 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • name (String) A non-scientific species name. Can include SQL wildcards

Definition at line 1030 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • hgvs_notation (String) HGVS notation. May be genomic (g), coding (c) or protein (p), with reference to chromosome name, gene name, transcript ID or protein ID.

Optional parameters:

  • hgvs (Boolean) Include HGVS nomenclature based on Ensembl stable identifiers
  • ccds (Boolean) Include CCDS transcript identifiers
  • numbers (Boolean) Include affected exon and intron positions within the transcript
  • domains (Boolean) Include names of overlapping protein domains
  • canonical (Boolean) Include a flag indicating the canonical transcript for a gene
  • protein (Boolean) Include Ensembl protein identifiers
  • xref_refseq (Boolean) Include aligned RefSeq mRNA identifiers for transcript. NB: theRefSeq and Ensembl transcripts aligned in this way MAY NOT, AND FREQUENTLY WILL NOT, match exactly in sequence, exon structure and protein product

Definition at line 1158 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • region (String) Query region. We only support the current assembly
  • allele (String) Variation allele

Optional parameters:

  • hgvs (Boolean) Include HGVS nomenclature based on Ensembl stable identifiers
  • ccds (Boolean) Include CCDS transcript identifiers
  • numbers (Boolean) Include affected exon and intron positions within the transcript
  • domains (Boolean) Include names of overlapping protein domains
  • canonical (Boolean) Include a flag indicating the canonical transcript for a gene
  • protein (Boolean) Include Ensembl protein identifiers
  • xref_refseq (Boolean) Include aligned RefSeq mRNA identifiers for transcript. NB: theRefSeq and Ensembl transcripts aligned in this way MAY NOT, AND FREQUENTLY WILL NOT, match exactly in sequence, exon structure and protein product

Definition at line 1092 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • id (String) Query ID. Supports dbSNP, COSMIC and HGMD identifiers

Optional parameters:

  • hgvs (Boolean) Include HGVS nomenclature based on Ensembl stable identifiers
  • ccds (Boolean) Include CCDS transcript identifiers
  • numbers (Boolean) Include affected exon and intron positions within the transcript
  • domains (Boolean) Include names of overlapping protein domains
  • canonical (Boolean) Include a flag indicating the canonical transcript for a gene
  • protein (Boolean) Include Ensembl protein identifiers
  • xref_refseq (Boolean) Include aligned RefSeq mRNA identifiers for transcript. NB: theRefSeq and Ensembl transcripts aligned in this way MAY NOT, AND FREQUENTLY WILL NOT, match exactly in sequence, exon structure and protein product

Definition at line 1125 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • id (String) Variation id

Optional parameters:

  • genotypes (Boolean(0,1)) Include individual genotypes
  • phenotypes (Boolean(0,1)) Include phenotypes
  • pops (Boolean(0,1)) Include population allele frequencies
  • population_genotypes (Boolean(0,1)) Include population genotype frequencies

Definition at line 1057 of file _pyrest_server.py.

+ Here is the call graph for this function:

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.

+ Here is the call graph for this function:

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.

+ Here is the call graph for this function:

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:

  • division (String) Filter by Ensembl or Ensembl Genomes division.

Definition at line 407 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • symbol (String) A name or symbol from an annotation source has been linked to a genetic feature

Optional parameters:

  • format (Enum(full,condensed)) Specify the layout of the response
  • expand (Boolean(0,1)) Expands the search to include any connected features. e.g. If the object is a gene, its transcripts, translations and exons will be returned as well.

Definition at line 595 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID

Optional parameters:

  • species (String) Species name/alias
  • db_type (String) Restrict the search to a database other than the default. Useful if you need to use a DB other than core
  • format (Enum(full,condensed)) Specify the formats to emit from this endpoint
  • expand (Boolean(0,1)) Expands the search to include any connected features. e.g. If the object is a gene, its transcripts, translations and exons will be returned as well.

Definition at line 572 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID
  • region (String) Query region

Optional parameters:

  • species (String) Species name/alias

Definition at line 641 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID
  • region (String) Query region

Optional parameters:

  • species (String) Species name/alias

Definition at line 662 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • species (String) Species name/alias
  • asm_one (String) Version of the input assembly
  • region (String) Query region
  • asm_two (String) Version of the output assembly

Optional parameters:

  • coord_system (String) Name of the output coordinate system

Definition at line 620 of file _pyrest_server.py.

+ Here is the call graph for this function:

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:

  • id (String) An Ensembl stable ID
  • region (String) Query region

Optional parameters:

  • species (String) Species name/alias

Definition at line 683 of file _pyrest_server.py.

+ Here is the call graph for this function:

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.

+ Here is the call graph for this function:

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.

+ Here is the call graph for this function:

Member Data Documentation

dictionary ensembl._pyrest_server.RestServer.__content_types
staticprivate
Initial value:
1 = {
2  "bed": "text/x-bed",
3 "fasta": "text/x-fasta",
4 "gff3": "text/x-gff3",
5 "json": "application/json",
6 "nh": "text/x-nh",
7 "phyloxml": "text/x-phyloxml+xml",
8 "xml": "text/xml",
9 "yaml": "text/x-yaml",
10 "text": "text/plain"
11  }

Definition at line 41 of file _pyrest_server.py.

dictionary ensembl._pyrest_server.RestServer.__return_codes
staticprivate
Initial value:
1 = {
2  200: ("OK", "Request was a success"),
3 400: ("Bad Request", "Occurs during exceptional circumstances such as the service is unable to find an ID"),
4 404: ("Not Found", "Indicates a badly formatted request. Check your URL"),
5 429: ("Too Many Requests", "You have been rate-limited; wait and retry"),
6 503: ("Service Unavailable", "The service is temporarily down; retry after a pause")
7  }

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.


The documentation for this class was generated from the following file: