GET genetree/id/:id

Retrieves a gene tree dump for a gene tree stable identifier

Parameters

Required

NameTypeDescriptionDefaultExample Values
id String A genetree ID - WBGT00000000021204

Optional

NameTypeDescriptionDefaultExample 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 -

Example Requests

/rest-19/genetree/id/WBGT00000000021204?content-type=application/json


 {
  "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
}
  1. use strict;
  2. use warnings;
  3.  
  4. use HTTP::Tiny;
  5.  
  6. my $http = HTTP::Tiny->new();
  7.  
  8. my $server = 'https://parasite.wormbase.org';
  9. my $ext = '/rest-19/genetree/id/WBGT00000000021204?';
  10. my $response = $http->get($server.$ext, {
  11. headers => { 'Content-type' => 'application/json' }
  12. });
  13.  
  14. die "Failed!\n" unless $response->{success};
  15.  
  16.  
  17. use JSON;
  18. use Data::Dumper;
  19. if(length $response->{content}) {
  20. my $hash = decode_json($response->{content});
  21. local $Data::Dumper::Terse = 1;
  22. local $Data::Dumper::Indent = 1;
  23. print Dumper $hash;
  24. print "\n";
  25. }
  26.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "application/json", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12. decoded = r.json()
  13. print repr(decoded)
  14.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "application/json", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12. decoded = r.json()
  13. print(repr(decoded))
  14.  
  1. require 'net/http'
  2. require 'uri'
  3.  
  4. server='https://parasite.wormbase.org'
  5. path = '/rest-19/genetree/id/WBGT00000000021204?'
  6.  
  7. url = URI.parse(server)
  8. http = Net::HTTP.new(url.host, url.port)
  9.  
  10. request = Net::HTTP::Get.new(path, {'Content-Type' => 'application/json'})
  11.  
  12. response = http.request(request)
  13.  
  14. if response.code != "200"
  15. puts "Invalid response: #{response.code}"
  16. puts response.body
  17. exit
  18. end
  19.  
  20.  
  21. require 'rubygems'
  22. require 'json'
  23. require 'yaml'
  24.  
  25. result = JSON.parse(response.body)
  26. puts YAML::dump(result)
  27.  
  1. import java.net.URL;
  2. import java.net.URLConnection;
  3. import java.net.HttpURLConnection;
  4. import java.io.BufferedReader;
  5. import java.io.InputStream;
  6. import java.io.InputStreamReader;
  7. import java.io.IOException;
  8. import java.io.Reader;
  9.  
  10.  
  11. public class EnsemblRest {
  12.  
  13. public static void main(String[] args) throws Exception {
  14. String server = "https://parasite.wormbase.org";
  15. String ext = "/rest-19/genetree/id/WBGT00000000021204?";
  16. URL url = new URL(server + ext);
  17.  
  18. URLConnection connection = url.openConnection();
  19. HttpURLConnection httpConnection = (HttpURLConnection)connection;
  20. httpConnection.setRequestProperty("Content-Type", "application/json");
  21.  
  22. InputStream response = connection.getInputStream();
  23. int responseCode = httpConnection.getResponseCode();
  24.  
  25. if(responseCode != 200) {
  26. throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
  27. }
  28.  
  29. String output;
  30. Reader reader = null;
  31. try {
  32. reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
  33. StringBuilder builder = new StringBuilder();
  34. char[] buffer = new char[8192];
  35. int read;
  36. while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
  37. builder.append(buffer, 0, read);
  38. }
  39. output = builder.toString();
  40. }
  41. finally {
  42. if (reader != null) try {
  43. reader.close();
  44. } catch (IOException logOrIgnore) {
  45. logOrIgnore.printStackTrace();
  46. }
  47. }
  48.  
  49. System.out.println(output);
  50. }
  51. }
  52.  
  1.  
  2. curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?' -H 'Content-type:application/json'
  3.  
  1. wget -q --header='Content-type:application/json' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?' -O -
  2.  

/rest-19/genetree/id/WBGT00000000021204?nh_format=simple;content-type=text/x-nh


 (SSLN_0000562601-mRNA-1:0,FBUS_08435:0);
  1. use strict;
  2. use warnings;
  3.  
  4. use HTTP::Tiny;
  5.  
  6. my $http = HTTP::Tiny->new();
  7.  
  8. my $server = 'https://parasite.wormbase.org';
  9. my $ext = '/rest-19/genetree/id/WBGT00000000021204?nh_format=simple';
  10. my $response = $http->get($server.$ext, {
  11. headers => { 'Content-type' => 'text/x-nh' }
  12. });
  13.  
  14. die "Failed!\n" unless $response->{success};
  15.  
  16.  
  17. print "$response->{status} $response->{reason}\n";
  18.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?nh_format=simple"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "text/x-nh", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12.  
  13. print r.text
  14.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?nh_format=simple"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "text/x-nh", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12.  
  13. print(r.text)
  14.  
  1. require 'net/http'
  2. require 'uri'
  3.  
  4. server='https://parasite.wormbase.org'
  5. path = '/rest-19/genetree/id/WBGT00000000021204?nh_format=simple'
  6.  
  7. url = URI.parse(server)
  8. http = Net::HTTP.new(url.host, url.port)
  9.  
  10. request = Net::HTTP::Get.new(path, {'Content-Type' => 'text/x-nh'})
  11.  
  12. response = http.request(request)
  13.  
  14. if response.code != "200"
  15. puts "Invalid response: #{response.code}"
  16. puts response.body
  17. exit
  18. end
  19.  
  20.  
  21. puts response.body
  22.  
  1. import java.net.URL;
  2. import java.net.URLConnection;
  3. import java.net.HttpURLConnection;
  4. import java.io.BufferedReader;
  5. import java.io.InputStream;
  6. import java.io.InputStreamReader;
  7. import java.io.IOException;
  8. import java.io.Reader;
  9.  
  10.  
  11. public class EnsemblRest {
  12.  
  13. public static void main(String[] args) throws Exception {
  14. String server = "https://parasite.wormbase.org";
  15. String ext = "/rest-19/genetree/id/WBGT00000000021204?nh_format=simple";
  16. URL url = new URL(server + ext);
  17.  
  18. URLConnection connection = url.openConnection();
  19. HttpURLConnection httpConnection = (HttpURLConnection)connection;
  20. httpConnection.setRequestProperty("Content-Type", "text/x-nh");
  21.  
  22. InputStream response = connection.getInputStream();
  23. int responseCode = httpConnection.getResponseCode();
  24.  
  25. if(responseCode != 200) {
  26. throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
  27. }
  28.  
  29. String output;
  30. Reader reader = null;
  31. try {
  32. reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
  33. StringBuilder builder = new StringBuilder();
  34. char[] buffer = new char[8192];
  35. int read;
  36. while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
  37. builder.append(buffer, 0, read);
  38. }
  39. output = builder.toString();
  40. }
  41. finally {
  42. if (reader != null) try {
  43. reader.close();
  44. } catch (IOException logOrIgnore) {
  45. logOrIgnore.printStackTrace();
  46. }
  47. }
  48.  
  49. System.out.println(output);
  50. }
  51. }
  52.  
  1.  
  2. curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?nh_format=simple' -H 'Content-type:text/x-nh'
  3.  
  1. wget -q --header='Content-type:text/x-nh' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?nh_format=simple' -O -
  2.  

/rest-19/genetree/id/WBGT00000000021204?content-type=text/x-phyloxml%2Bxml


<?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>
  1. use strict;
  2. use warnings;
  3.  
  4. use HTTP::Tiny;
  5.  
  6. my $http = HTTP::Tiny->new();
  7.  
  8. my $server = 'https://parasite.wormbase.org';
  9. my $ext = '/rest-19/genetree/id/WBGT00000000021204?';
  10. my $response = $http->get($server.$ext, {
  11. headers => { 'Content-type' => 'text/x-phyloxml+xml' }
  12. });
  13.  
  14. die "Failed!\n" unless $response->{success};
  15.  
  16.  
  17. print "$response->{status} $response->{reason}\n";
  18.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12.  
  13. print r.text
  14.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12.  
  13. print(r.text)
  14.  
  1. require 'net/http'
  2. require 'uri'
  3.  
  4. server='https://parasite.wormbase.org'
  5. path = '/rest-19/genetree/id/WBGT00000000021204?'
  6.  
  7. url = URI.parse(server)
  8. http = Net::HTTP.new(url.host, url.port)
  9.  
  10. request = Net::HTTP::Get.new(path, {'Content-Type' => 'text/x-phyloxml+xml'})
  11.  
  12. response = http.request(request)
  13.  
  14. if response.code != "200"
  15. puts "Invalid response: #{response.code}"
  16. puts response.body
  17. exit
  18. end
  19.  
  20.  
  21. puts response.body
  22.  
  1. import java.net.URL;
  2. import java.net.URLConnection;
  3. import java.net.HttpURLConnection;
  4. import java.io.BufferedReader;
  5. import java.io.InputStream;
  6. import java.io.InputStreamReader;
  7. import java.io.IOException;
  8. import java.io.Reader;
  9.  
  10.  
  11. public class EnsemblRest {
  12.  
  13. public static void main(String[] args) throws Exception {
  14. String server = "https://parasite.wormbase.org";
  15. String ext = "/rest-19/genetree/id/WBGT00000000021204?";
  16. URL url = new URL(server + ext);
  17.  
  18. URLConnection connection = url.openConnection();
  19. HttpURLConnection httpConnection = (HttpURLConnection)connection;
  20. httpConnection.setRequestProperty("Content-Type", "text/x-phyloxml+xml");
  21.  
  22. InputStream response = connection.getInputStream();
  23. int responseCode = httpConnection.getResponseCode();
  24.  
  25. if(responseCode != 200) {
  26. throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
  27. }
  28.  
  29. String output;
  30. Reader reader = null;
  31. try {
  32. reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
  33. StringBuilder builder = new StringBuilder();
  34. char[] buffer = new char[8192];
  35. int read;
  36. while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
  37. builder.append(buffer, 0, read);
  38. }
  39. output = builder.toString();
  40. }
  41. finally {
  42. if (reader != null) try {
  43. reader.close();
  44. } catch (IOException logOrIgnore) {
  45. logOrIgnore.printStackTrace();
  46. }
  47. }
  48.  
  49. System.out.println(output);
  50. }
  51. }
  52.  
  1.  
  2. curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?' -H 'Content-type:text/x-phyloxml+xml'
  3.  
  1. wget -q --header='Content-type:text/x-phyloxml+xml' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?' -O -
  2.  

/rest-19/genetree/id/WBGT00000000021204?sequence=cdna;aligned=1;content-type=text/x-phyloxml%2Bxml


<?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>
  1. use strict;
  2. use warnings;
  3.  
  4. use HTTP::Tiny;
  5.  
  6. my $http = HTTP::Tiny->new();
  7.  
  8. my $server = 'https://parasite.wormbase.org';
  9. my $ext = '/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna';
  10. my $response = $http->get($server.$ext, {
  11. headers => { 'Content-type' => 'text/x-phyloxml+xml' }
  12. });
  13.  
  14. die "Failed!\n" unless $response->{success};
  15.  
  16.  
  17. print "$response->{status} $response->{reason}\n";
  18.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12.  
  13. print r.text
  14.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12.  
  13. print(r.text)
  14.  
  1. require 'net/http'
  2. require 'uri'
  3.  
  4. server='https://parasite.wormbase.org'
  5. path = '/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna'
  6.  
  7. url = URI.parse(server)
  8. http = Net::HTTP.new(url.host, url.port)
  9.  
  10. request = Net::HTTP::Get.new(path, {'Content-Type' => 'text/x-phyloxml+xml'})
  11.  
  12. response = http.request(request)
  13.  
  14. if response.code != "200"
  15. puts "Invalid response: #{response.code}"
  16. puts response.body
  17. exit
  18. end
  19.  
  20.  
  21. puts response.body
  22.  
  1. import java.net.URL;
  2. import java.net.URLConnection;
  3. import java.net.HttpURLConnection;
  4. import java.io.BufferedReader;
  5. import java.io.InputStream;
  6. import java.io.InputStreamReader;
  7. import java.io.IOException;
  8. import java.io.Reader;
  9.  
  10.  
  11. public class EnsemblRest {
  12.  
  13. public static void main(String[] args) throws Exception {
  14. String server = "https://parasite.wormbase.org";
  15. String ext = "/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna";
  16. URL url = new URL(server + ext);
  17.  
  18. URLConnection connection = url.openConnection();
  19. HttpURLConnection httpConnection = (HttpURLConnection)connection;
  20. httpConnection.setRequestProperty("Content-Type", "text/x-phyloxml+xml");
  21.  
  22. InputStream response = connection.getInputStream();
  23. int responseCode = httpConnection.getResponseCode();
  24.  
  25. if(responseCode != 200) {
  26. throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
  27. }
  28.  
  29. String output;
  30. Reader reader = null;
  31. try {
  32. reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
  33. StringBuilder builder = new StringBuilder();
  34. char[] buffer = new char[8192];
  35. int read;
  36. while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
  37. builder.append(buffer, 0, read);
  38. }
  39. output = builder.toString();
  40. }
  41. finally {
  42. if (reader != null) try {
  43. reader.close();
  44. } catch (IOException logOrIgnore) {
  45. logOrIgnore.printStackTrace();
  46. }
  47. }
  48.  
  49. System.out.println(output);
  50. }
  51. }
  52.  
  1.  
  2. curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna' -H 'Content-type:text/x-phyloxml+xml'
  3.  
  1. wget -q --header='Content-type:text/x-phyloxml+xml' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?aligned=1;sequence=cdna' -O -
  2.  

/rest-19/genetree/id/WBGT00000000021204?sequence=none;content-type=text/x-phyloxml%2Bxml


<?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>
  1. use strict;
  2. use warnings;
  3.  
  4. use HTTP::Tiny;
  5.  
  6. my $http = HTTP::Tiny->new();
  7.  
  8. my $server = 'https://parasite.wormbase.org';
  9. my $ext = '/rest-19/genetree/id/WBGT00000000021204?sequence=none';
  10. my $response = $http->get($server.$ext, {
  11. headers => { 'Content-type' => 'text/x-phyloxml+xml' }
  12. });
  13.  
  14. die "Failed!\n" unless $response->{success};
  15.  
  16.  
  17. print "$response->{status} $response->{reason}\n";
  18.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?sequence=none"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12.  
  13. print r.text
  14.  
  1. import requests, sys
  2.  
  3. server = "https://parasite.wormbase.org"
  4. ext = "/rest-19/genetree/id/WBGT00000000021204?sequence=none"
  5.  
  6. r = requests.get(server+ext, headers={ "Content-Type" : "text/x-phyloxml+xml", "Accept" : ""})
  7.  
  8. if not r.ok:
  9. r.raise_for_status()
  10. sys.exit()
  11.  
  12.  
  13. print(r.text)
  14.  
  1. require 'net/http'
  2. require 'uri'
  3.  
  4. server='https://parasite.wormbase.org'
  5. path = '/rest-19/genetree/id/WBGT00000000021204?sequence=none'
  6.  
  7. url = URI.parse(server)
  8. http = Net::HTTP.new(url.host, url.port)
  9.  
  10. request = Net::HTTP::Get.new(path, {'Content-Type' => 'text/x-phyloxml+xml'})
  11.  
  12. response = http.request(request)
  13.  
  14. if response.code != "200"
  15. puts "Invalid response: #{response.code}"
  16. puts response.body
  17. exit
  18. end
  19.  
  20.  
  21. puts response.body
  22.  
  1. import java.net.URL;
  2. import java.net.URLConnection;
  3. import java.net.HttpURLConnection;
  4. import java.io.BufferedReader;
  5. import java.io.InputStream;
  6. import java.io.InputStreamReader;
  7. import java.io.IOException;
  8. import java.io.Reader;
  9.  
  10.  
  11. public class EnsemblRest {
  12.  
  13. public static void main(String[] args) throws Exception {
  14. String server = "https://parasite.wormbase.org";
  15. String ext = "/rest-19/genetree/id/WBGT00000000021204?sequence=none";
  16. URL url = new URL(server + ext);
  17.  
  18. URLConnection connection = url.openConnection();
  19. HttpURLConnection httpConnection = (HttpURLConnection)connection;
  20. httpConnection.setRequestProperty("Content-Type", "text/x-phyloxml+xml");
  21.  
  22. InputStream response = connection.getInputStream();
  23. int responseCode = httpConnection.getResponseCode();
  24.  
  25. if(responseCode != 200) {
  26. throw new RuntimeException("Response code was not 200. Detected response was "+responseCode);
  27. }
  28.  
  29. String output;
  30. Reader reader = null;
  31. try {
  32. reader = new BufferedReader(new InputStreamReader(response, "UTF-8"));
  33. StringBuilder builder = new StringBuilder();
  34. char[] buffer = new char[8192];
  35. int read;
  36. while ((read = reader.read(buffer, 0, buffer.length)) > 0) {
  37. builder.append(buffer, 0, read);
  38. }
  39. output = builder.toString();
  40. }
  41. finally {
  42. if (reader != null) try {
  43. reader.close();
  44. } catch (IOException logOrIgnore) {
  45. logOrIgnore.printStackTrace();
  46. }
  47. }
  48.  
  49. System.out.println(output);
  50. }
  51. }
  52.  
  1.  
  2. curl 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?sequence=none' -H 'Content-type:text/x-phyloxml+xml'
  3.  
  1. wget -q --header='Content-type:text/x-phyloxml+xml' 'https://parasite.wormbase.org/rest-19/genetree/id/WBGT00000000021204?sequence=none' -O -
  2.  

Resource Information

MethodsGET
Response formatsphyloxml
nh
json
jsonp