Retrieves a gene tree dump for a gene tree stable identifier
Name | Type | Description | Default | Example Values |
---|---|---|---|---|
id | String | A genetree ID | - |
WBGT00000000021204 |
Name | Type | Description | Default | Example Values |
---|---|---|---|---|
aligned | Boolean | Return the aligned string if true. Otherwise, return the original sequence (no insertions) | 0 | - |
callback | String | Name of the callback subroutine to be returned by the requested JSONP response. Required ONLY when using JSONP as the serialisation method. Please see the user guide. | - |
randomlygeneratedname |
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. | simple | - |
sequence | Enum(none, cdna, protein) | The type of sequence to bring back. Setting it to none results in no sequence being returned | protein | - |
{
"tree": {
"confidence": {},
"taxonomy": {
"scientific_name": "Platyhelminthes",
"common_name": "Flatworms",
"id": 6157
},
"children": [
{
"id": {
"source": "EnsEMBL",
"accession": "FBUS_08435"
},
"sequence": {
"location": "F_buski-1.0_Cont2708:38495-44227",
"id": [
{
"source": "EnsEMBL",
"accession": "FBUS_08435"
}
],
"mol_seq": {
"seq": "MDEVIFYDTSSEKKPIFTPFWAVELQGGEGAAREIANKYGFIYIGEIMPGIYHFKQARLSKRSIYHSIYYHDQLVEDPKVSLSLKSK",
"is_aligned": 0
}
},
"confidence": {},
"taxonomy": {
"scientific_name": "Fasciolopsis buski strain HT",
"common_name": "Fasciolopsis buski (PRJNA284521)",
"id": 27845
},
"branch_length": 0
},
{
"id": {
"accession": "SSLN_0000562601",
"source": "EnsEMBL"
},
"sequence": {
"location": "SSLN_scaffold0001089:1615-10543",
"id": [
{
"accession": "SSLN_0000562601-mRNA-1",
"source": "EnsEMBL"
}
],
"mol_seq": {
"is_aligned": 0,
"seq": "MSEYRHSLIEMQKNTSHYYRPPPRRFTPYWAAEIQGGEEVAKEIAKKYRFVYLGQILPGVYYFRHLRVVKRSAHMNTYYQRQLFLDPHVTVIVVTDAAAIIINNTNNNLITFLVIVPSA"
}
},
"branch_length": 0,
"confidence": {},
"taxonomy": {
"scientific_name": "Schistocephalus solidus strain NST_G2",
"common_name": "Schistocephalus solidus (PRJEB527)",
"id": 70667
}
}
],
"branch_length": 0,
"events": {
"type": "speciation"
}
},
"id": "WBGT00000000021204",
"type": "gene tree",
"rooted": 1
}
- use strict;
- use warnings;
- use HTTP::Tiny;
- my $http = HTTP::Tiny->new();
- my $server = 'https://parasite.wormbase.org';
- my $ext = '/rest-19/genetree/id/WBGT00000000021204?';
- my $response = $http->get($server.$ext, {
- headers => { 'Content-type' => 'application/json' }
- });
- die "Failed!\n" unless $response->{success};
- use JSON;
- use Data::Dumper;
- if(length $response->{content}) {
- my $hash = decode_json($response->{content});
- local $Data::Dumper::Terse = 1;
- local $Data::Dumper::Indent = 1;
- print Dumper $hash;
- print "\n";
- }
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?"
- r = requests.get(server+ext, headers={ "Content-Type" : "application/json", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- decoded = r.json()
- print repr(decoded)
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?"
- r = requests.get(server+ext, headers={ "Content-Type" : "application/json", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- decoded = r.json()
- print(repr(decoded))
- require 'net/http'
- require 'uri'
- server='https://parasite.wormbase.org'
- path = '/rest-19/genetree/id/WBGT00000000021204?'
- url = URI.parse(server)
- http = Net::HTTP.new(url.host, url.port)
- request = Net::HTTP::Get.new(path, {'Content-Type' => 'application/json'})
- response = http.request(request)
- if response.code != "200"
- puts "Invalid response: #{response.code}"
- puts response.body
- exit
- end
- require 'rubygems'
- require 'json'
- require 'yaml'
- result = JSON.parse(response.body)
- puts YAML::dump(result)
- import java.net.URL;
- import java.net.URLConnection;
- import java.net.HttpURLConnection;
- import java.io.BufferedReader;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.IOException;
- import java.io.Reader;
- public class EnsemblRest {
- public static void main(String[] args) throws Exception {
- String server = "https://parasite.wormbase.org";
- String ext = "/rest-19/genetree/id/WBGT00000000021204?";
- URL url = new URL(server + ext);
- URLConnection connection = url.openConnection();
- HttpURLConnection httpConnection = (HttpURLConnection)connection;
- httpConnection.setRequestProperty("Content-Type", "application/json");
- InputStream response = connection.getInputStream();
- int responseCode = httpConnection.getResponseCode();
- if(responseCode != 200) {
- throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
- }
- String output;
- Reader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
- StringBuilder builder = new StringBuilder();
- char[] buffer = new char[8192];
- int read;
- while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
- builder.append(buffer, 0, read);
- }
- output = builder.toString();
- }
- finally {
- if (reader != null) try {
- reader.close();
- } catch (IOException logOrIgnore) {
- logOrIgnore.printStackTrace();
- }
- }
- System.out.println(output);
- }
- }
- curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?' -H 'Content-type:application/json'
- wget -q --header='Content-type:application/json' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?' -O -
(SSLN_0000562601-mRNA-1:0,FBUS_08435:0);
- use strict;
- use warnings;
- use HTTP::Tiny;
- my $http = HTTP::Tiny->new();
- my $server = 'https://parasite.wormbase.org';
- my $ext = '/rest-19/genetree/id/WBGT00000000021204?nh_format=simple';
- my $response = $http->get($server.$ext, {
- headers => { 'Content-type' => 'text/x-nh' }
- });
- die "Failed!\n" unless $response->{success};
- print "$response->{status} $response->{reason}\n";
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?nh_format=simple"
- r = requests.get(server+ext, headers={ "Content-Type" : "text/x-nh", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- print r.text
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?nh_format=simple"
- r = requests.get(server+ext, headers={ "Content-Type" : "text/x-nh", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- print(r.text)
- require 'net/http'
- require 'uri'
- server='https://parasite.wormbase.org'
- path = '/rest-19/genetree/id/WBGT00000000021204?nh_format=simple'
- url = URI.parse(server)
- http = Net::HTTP.new(url.host, url.port)
- request = Net::HTTP::Get.new(path, {'Content-Type' => 'text/x-nh'})
- response = http.request(request)
- if response.code != "200"
- puts "Invalid response: #{response.code}"
- puts response.body
- exit
- end
- puts response.body
- import java.net.URL;
- import java.net.URLConnection;
- import java.net.HttpURLConnection;
- import java.io.BufferedReader;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.IOException;
- import java.io.Reader;
- public class EnsemblRest {
- public static void main(String[] args) throws Exception {
- String server = "https://parasite.wormbase.org";
- String ext = "/rest-19/genetree/id/WBGT00000000021204?nh_format=simple";
- URL url = new URL(server + ext);
- URLConnection connection = url.openConnection();
- HttpURLConnection httpConnection = (HttpURLConnection)connection;
- httpConnection.setRequestProperty("Content-Type", "text/x-nh");
- InputStream response = connection.getInputStream();
- int responseCode = httpConnection.getResponseCode();
- if(responseCode != 200) {
- throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
- }
- String output;
- Reader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
- StringBuilder builder = new StringBuilder();
- char[] buffer = new char[8192];
- int read;
- while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
- builder.append(buffer, 0, read);
- }
- output = builder.toString();
- }
- finally {
- if (reader != null) try {
- reader.close();
- } catch (IOException logOrIgnore) {
- logOrIgnore.printStackTrace();
- }
- }
- System.out.println(output);
- }
- }
- curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?nh_format=simple' -H 'Content-type:text/x-nh'
- wget -q --header='Content-type:text/x-nh' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?nh_format=simple' -O -
<?xml version="1.0" encoding="UTF-8"?><phyloxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phyloxml.org" xsi:schemaLocation="http://www.phyloxml.org http://www.phyloxml.org/1.10/phyloxml.xsd">
<phylogeny type="gene tree" rooted="true">
<clade branch_length="0">
<taxonomy>
<id>6157</id>
<scientific_name>Platyhelminthes</scientific_name>
<common_name>Flatworms</common_name>
</taxonomy>
<clade branch_length="0">
<name>SSLN_0000562601</name>
<taxonomy>
<id>70667</id>
<scientific_name>Schistocephalus solidus strain NST_G2</scientific_name>
<common_name>Schistocephalus solidus (PRJEB527)</common_name>
</taxonomy>
<sequence>
<accession source="Ensembl">SSLN_0000562601-mRNA-1</accession>
<location>SSLN_scaffold0001089:1615-10543</location>
<mol_seq is_aligned="0">MSEYRHSLIEMQKNTSHYYRPPPRRFTPYWAAEIQGGEEVAKEIAKKYRFVYLGQILPGVYYFRHLRVVKRSAHMNTYYQRQLFLDPHVTVIVVTDAAAIIINNTNNNLITFLVIVPSA</mol_seq>
</sequence>
<property datatype="xsd:string" ref="Compara:genome_db_name" applies_to="clade">schistocephalus_solidus_prjeb527</property>
</clade>
<clade branch_length="0">
<name>FBUS_08435</name>
<taxonomy>
<id>27845</id>
<scientific_name>Fasciolopsis buski strain HT</scientific_name>
<common_name>Fasciolopsis buski (PRJNA284521)</common_name>
</taxonomy>
<sequence>
<accession source="Ensembl">FBUS_08435</accession>
<location>F_buski-1.0_Cont2708:38495-44227</location>
<mol_seq is_aligned="0">MDEVIFYDTSSEKKPIFTPFWAVELQGGEGAAREIANKYGFIYIGEIMPGIYHFKQARLSKRSIYHSIYYHDQLVEDPKVSLSLKSK</mol_seq>
</sequence>
<property datatype="xsd:string" ref="Compara:genome_db_name" applies_to="clade">fasciolopsis_buski_prjna284521</property>
</clade>
</clade>
<property datatype="xsd:string" ref="Compara:gene_tree_stable_id" applies_to="phylogeny">WBGT00000000021204</property>
</phylogeny>
</phyloxml>
- use strict;
- use warnings;
- use HTTP::Tiny;
- my $http = HTTP::Tiny->new();
- my $server = 'https://parasite.wormbase.org';
- my $ext = '/rest-19/genetree/id/WBGT00000000021204?';
- my $response = $http->get($server.$ext, {
- headers => { 'Content-type' => 'text/x-phyloxml+xml' }
- });
- die "Failed!\n" unless $response->{success};
- print "$response->{status} $response->{reason}\n";
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?"
- r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- print r.text
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?"
- r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- print(r.text)
- require 'net/http'
- require 'uri'
- server='https://parasite.wormbase.org'
- path = '/rest-19/genetree/id/WBGT00000000021204?'
- url = URI.parse(server)
- http = Net::HTTP.new(url.host, url.port)
- request = Net::HTTP::Get.new(path, {'Content-Type' => 'text/x-phyloxml+xml'})
- response = http.request(request)
- if response.code != "200"
- puts "Invalid response: #{response.code}"
- puts response.body
- exit
- end
- puts response.body
- import java.net.URL;
- import java.net.URLConnection;
- import java.net.HttpURLConnection;
- import java.io.BufferedReader;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.IOException;
- import java.io.Reader;
- public class EnsemblRest {
- public static void main(String[] args) throws Exception {
- String server = "https://parasite.wormbase.org";
- String ext = "/rest-19/genetree/id/WBGT00000000021204?";
- URL url = new URL(server + ext);
- URLConnection connection = url.openConnection();
- HttpURLConnection httpConnection = (HttpURLConnection)connection;
- httpConnection.setRequestProperty("Content-Type", "text/x-phyloxml+xml");
- InputStream response = connection.getInputStream();
- int responseCode = httpConnection.getResponseCode();
- if(responseCode != 200) {
- throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
- }
- String output;
- Reader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
- StringBuilder builder = new StringBuilder();
- char[] buffer = new char[8192];
- int read;
- while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
- builder.append(buffer, 0, read);
- }
- output = builder.toString();
- }
- finally {
- if (reader != null) try {
- reader.close();
- } catch (IOException logOrIgnore) {
- logOrIgnore.printStackTrace();
- }
- }
- System.out.println(output);
- }
- }
- curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?' -H 'Content-type:text/x-phyloxml+xml'
- wget -q --header='Content-type:text/x-phyloxml+xml' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?' -O -
<?xml version="1.0" encoding="UTF-8"?><phyloxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phyloxml.org" xsi:schemaLocation="http://www.phyloxml.org http://www.phyloxml.org/1.10/phyloxml.xsd">
<phylogeny rooted="true" type="gene tree">
<clade branch_length="0">
<taxonomy>
<id>6157</id>
<scientific_name>Platyhelminthes</scientific_name>
<common_name>Flatworms</common_name>
</taxonomy>
<clade branch_length="0">
<name>SSLN_0000562601</name>
<taxonomy>
<id>70667</id>
<scientific_name>Schistocephalus solidus strain NST_G2</scientific_name>
<common_name>Schistocephalus solidus (PRJEB527)</common_name>
</taxonomy>
<sequence>
<accession source="Ensembl">SSLN_0000562601-mRNA-1</accession>
<location>SSLN_scaffold0001089:1615-10543</location>
<mol_seq is_aligned="1">ATGTCGGAATATCGTCACTCTCTTATTGAAATGCAGAAAAACACTTCACATTATTATCGTCCGCCACCACGCCGCTTTACACCATACTGGGCTGCTGAGATCCAAGGTGGTGAAGAGGTTGCCAAAGAAATTGCAAAGAAGTACAGGTTCGTATACCTAGGACAGATACTACCAGGTGTCTACTACTTCAGGCATCTGCGAGTCGTCAAACGCTCCGCCCATATGAACACATACTACCAACGCCAACTCTTTCTTGATCCCCACGTTACTGTCATCGTTGTCACCGACGCCGCCGCCATCATCATCAACAACACCAACAACAACCTCATCACCTTCCTAGTCATCGTTCCCAGTGCT</mol_seq>
</sequence>
<property datatype="xsd:string" ref="Compara:genome_db_name" applies_to="clade">schistocephalus_solidus_prjeb527</property>
</clade>
<clade branch_length="0">
<name>FBUS_08435</name>
<taxonomy>
<id>27845</id>
<scientific_name>Fasciolopsis buski strain HT</scientific_name>
<common_name>Fasciolopsis buski (PRJNA284521)</common_name>
</taxonomy>
<sequence>
<accession source="Ensembl">FBUS_08435</accession>
<location>F_buski-1.0_Cont2708:38495-44227</location>
<mol_seq is_aligned="1">ATGGACGAAGTG------------------ATTTTTTATGATACCTCTAGCGAGAAGAAGCCA---------ATTTTTACACCATTTTGGGCAGTGGAACTCCAGGGAGGAGAAGGAGCTGCGCGCGAGATCGCCAACAAATATGGATTCATCTATATCGGCGAGATCATGCCTGGGATCTACCATTTTAAGCAAGCTCGCCTTTCAAAGCGTTCCATATACCACAGTATATATTATCATGATCAGTTGGTGGAGGACCCGAAAGTGAGTTTATCATTG---------------------------------------------------------------------AAATCGAAA</mol_seq>
</sequence>
<property datatype="xsd:string" ref="Compara:genome_db_name" applies_to="clade">fasciolopsis_buski_prjna284521</property>
</clade>
</clade>
<property datatype="xsd:string" ref="Compara:gene_tree_stable_id" applies_to="phylogeny">WBGT00000000021204</property>
</phylogeny>
</phyloxml>
- use strict;
- use warnings;
- use HTTP::Tiny;
- my $http = HTTP::Tiny->new();
- my $server = 'https://parasite.wormbase.org';
- my $ext = '/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna';
- my $response = $http->get($server.$ext, {
- headers => { 'Content-type' => 'text/x-phyloxml+xml' }
- });
- die "Failed!\n" unless $response->{success};
- print "$response->{status} $response->{reason}\n";
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna"
- r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- print r.text
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna"
- r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- print(r.text)
- require 'net/http'
- require 'uri'
- server='https://parasite.wormbase.org'
- path = '/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna'
- url = URI.parse(server)
- http = Net::HTTP.new(url.host, url.port)
- request = Net::HTTP::Get.new(path, {'Content-Type' => 'text/x-phyloxml+xml'})
- response = http.request(request)
- if response.code != "200"
- puts "Invalid response: #{response.code}"
- puts response.body
- exit
- end
- puts response.body
- import java.net.URL;
- import java.net.URLConnection;
- import java.net.HttpURLConnection;
- import java.io.BufferedReader;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.IOException;
- import java.io.Reader;
- public class EnsemblRest {
- public static void main(String[] args) throws Exception {
- String server = "https://parasite.wormbase.org";
- String ext = "/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna";
- URL url = new URL(server + ext);
- URLConnection connection = url.openConnection();
- HttpURLConnection httpConnection = (HttpURLConnection)connection;
- httpConnection.setRequestProperty("Content-Type", "text/x-phyloxml+xml");
- InputStream response = connection.getInputStream();
- int responseCode = httpConnection.getResponseCode();
- if(responseCode != 200) {
- throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
- }
- String output;
- Reader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
- StringBuilder builder = new StringBuilder();
- char[] buffer = new char[8192];
- int read;
- while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
- builder.append(buffer, 0, read);
- }
- output = builder.toString();
- }
- finally {
- if (reader != null) try {
- reader.close();
- } catch (IOException logOrIgnore) {
- logOrIgnore.printStackTrace();
- }
- }
- System.out.println(output);
- }
- }
- curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna' -H 'Content-type:text/x-phyloxml+xml'
- wget -q --header='Content-type:text/x-phyloxml+xml' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna' -O -
<?xml version="1.0" encoding="UTF-8"?><phyloxml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.phyloxml.org" xsi:schemaLocation="http://www.phyloxml.org http://www.phyloxml.org/1.10/phyloxml.xsd">
<phylogeny rooted="true" type="gene tree">
<clade branch_length="0">
<taxonomy>
<id>6157</id>
<scientific_name>Platyhelminthes</scientific_name>
<common_name>Flatworms</common_name>
</taxonomy>
<clade branch_length="0">
<name>FBUS_08435</name>
<taxonomy>
<id>27845</id>
<scientific_name>Fasciolopsis buski strain HT</scientific_name>
<common_name>Fasciolopsis buski (PRJNA284521)</common_name>
</taxonomy>
<sequence>
<accession source="Ensembl">FBUS_08435</accession>
<location>F_buski-1.0_Cont2708:38495-44227</location>
</sequence>
<property datatype="xsd:string" ref="Compara:genome_db_name" applies_to="clade">fasciolopsis_buski_prjna284521</property>
</clade>
<clade branch_length="0">
<name>SSLN_0000562601</name>
<taxonomy>
<id>70667</id>
<scientific_name>Schistocephalus solidus strain NST_G2</scientific_name>
<common_name>Schistocephalus solidus (PRJEB527)</common_name>
</taxonomy>
<sequence>
<accession source="Ensembl">SSLN_0000562601-mRNA-1</accession>
<location>SSLN_scaffold0001089:1615-10543</location>
</sequence>
<property datatype="xsd:string" ref="Compara:genome_db_name" applies_to="clade">schistocephalus_solidus_prjeb527</property>
</clade>
</clade>
<property datatype="xsd:string" ref="Compara:gene_tree_stable_id" applies_to="phylogeny">WBGT00000000021204</property>
</phylogeny>
</phyloxml>
- use strict;
- use warnings;
- use HTTP::Tiny;
- my $http = HTTP::Tiny->new();
- my $server = 'https://parasite.wormbase.org';
- my $ext = '/rest-19/genetree/id/WBGT00000000021204?sequence=none';
- my $response = $http->get($server.$ext, {
- headers => { 'Content-type' => 'text/x-phyloxml+xml' }
- });
- die "Failed!\n" unless $response->{success};
- print "$response->{status} $response->{reason}\n";
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?sequence=none"
- r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- print r.text
- import requests, sys
- server = "https://parasite.wormbase.org"
- ext = "/rest-19/genetree/id/WBGT00000000021204?sequence=none"
- r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
- if not r.ok:
- r.raise_for_status()
- sys.exit()
- print(r.text)
- require 'net/http'
- require 'uri'
- server='https://parasite.wormbase.org'
- path = '/rest-19/genetree/id/WBGT00000000021204?sequence=none'
- url = URI.parse(server)
- http = Net::HTTP.new(url.host, url.port)
- request = Net::HTTP::Get.new(path, {'Content-Type' => 'text/x-phyloxml+xml'})
- response = http.request(request)
- if response.code != "200"
- puts "Invalid response: #{response.code}"
- puts response.body
- exit
- end
- puts response.body
- import java.net.URL;
- import java.net.URLConnection;
- import java.net.HttpURLConnection;
- import java.io.BufferedReader;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.IOException;
- import java.io.Reader;
- public class EnsemblRest {
- public static void main(String[] args) throws Exception {
- String server = "https://parasite.wormbase.org";
- String ext = "/rest-19/genetree/id/WBGT00000000021204?sequence=none";
- URL url = new URL(server + ext);
- URLConnection connection = url.openConnection();
- HttpURLConnection httpConnection = (HttpURLConnection)connection;
- httpConnection.setRequestProperty("Content-Type", "text/x-phyloxml+xml");
- InputStream response = connection.getInputStream();
- int responseCode = httpConnection.getResponseCode();
- if(responseCode != 200) {
- throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
- }
- String output;
- Reader reader = null;
- try {
- reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
- StringBuilder builder = new StringBuilder();
- char[] buffer = new char[8192];
- int read;
- while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
- builder.append(buffer, 0, read);
- }
- output = builder.toString();
- }
- finally {
- if (reader != null) try {
- reader.close();
- } catch (IOException logOrIgnore) {
- logOrIgnore.printStackTrace();
- }
- }
- System.out.println(output);
- }
- }
- curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?sequence=none' -H 'Content-type:text/x-phyloxml+xml'
- wget -q --header='Content-type:text/x-phyloxml+xml' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?sequence=none' -O -
Methods | GET |
Response formats | phyloxml nh json jsonp |