phenoscaperb 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +38 -0
- data/.travis.yml +8 -0
- data/CHANGELOG.md +3 -0
- data/CONDUCT.md +25 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +71 -0
- data/LICENSE +7 -0
- data/README.md +153 -0
- data/Rakefile +42 -0
- data/bin/ph +46 -0
- data/lib/phenoscaperb.rb +33 -0
- data/lib/phenoscaperb/Genes.rb +83 -0
- data/lib/phenoscaperb/Ontotrace.rb +46 -0
- data/lib/phenoscaperb/Studies.rb +102 -0
- data/lib/phenoscaperb/Taxa.rb +115 -0
- data/lib/phenoscaperb/Terms.rb +200 -0
- data/lib/phenoscaperb/constants.rb +8 -0
- data/lib/phenoscaperb/error.rb +22 -0
- data/lib/phenoscaperb/faraday.rb +71 -0
- data/lib/phenoscaperb/helpers/configuration.rb +26 -0
- data/lib/phenoscaperb/request.rb +74 -0
- data/lib/phenoscaperb/utils.rb +43 -0
- data/lib/phenoscaperb/version.rb +3 -0
- data/phenoscaperb.gemspec +40 -0
- metadata +318 -0
@@ -0,0 +1,83 @@
|
|
1
|
+
require "faraday"
|
2
|
+
require 'faraday_middleware'
|
3
|
+
require "multi_json"
|
4
|
+
require "phenoscaperb/error"
|
5
|
+
require "phenoscaperb/request"
|
6
|
+
require "phenoscaperb/constants"
|
7
|
+
require 'phenoscaperb/helpers/configuration'
|
8
|
+
require 'phenoscaperb/faraday'
|
9
|
+
require 'phenoscaperb/utils'
|
10
|
+
|
11
|
+
##
|
12
|
+
# Phenoscape::Genes
|
13
|
+
#
|
14
|
+
# Class to perform HTTP requests to the Phenoscape API
|
15
|
+
module Phenoscape
|
16
|
+
module Genes
|
17
|
+
##
|
18
|
+
# Return detail info for a given gene
|
19
|
+
#
|
20
|
+
# @!macro phenoscape_params
|
21
|
+
# @!macro phenoscape_options
|
22
|
+
# @param iri [String] a gene IRI
|
23
|
+
# @return [Hash] A hash
|
24
|
+
#
|
25
|
+
# @example
|
26
|
+
# require 'phenoscaperb'
|
27
|
+
#
|
28
|
+
# ge = Phenoscape::Genes
|
29
|
+
# ge.gene(iri: "http://www.informatics.jax.org/marker/MGI:104842")
|
30
|
+
def self.gene(iri:, verbose: nil, options: nil)
|
31
|
+
|
32
|
+
arguments = { iri: iri }.tostrings
|
33
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
34
|
+
Request.new("gene", opts, verbose, options, nil).perform
|
35
|
+
end
|
36
|
+
|
37
|
+
# Search for genes by gene symbol.
|
38
|
+
#
|
39
|
+
# @!macro phenoscape_params
|
40
|
+
# @!macro phenoscape_options
|
41
|
+
# @param text [String] the input text to search
|
42
|
+
# @param taxon [String] NCBI IRI for taxon
|
43
|
+
# @return [Hash] A hash
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
# require 'phenoscaperb'
|
47
|
+
#
|
48
|
+
# ge = Phenoscape::Genes
|
49
|
+
# ge.search(text: "coil")
|
50
|
+
def self.search(text:, taxon: nil, verbose: nil, options: nil)
|
51
|
+
|
52
|
+
arguments = { text: text, taxon: taxon }.tostrings
|
53
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
54
|
+
Request.new("gene/search", opts, verbose, options, nil).perform
|
55
|
+
end
|
56
|
+
|
57
|
+
# Search for classes from a particular ontology.
|
58
|
+
#
|
59
|
+
# @!macro phenoscape_params
|
60
|
+
# @!macro phenoscape_options
|
61
|
+
# @param iri [String] anatomical entity IRI
|
62
|
+
# @param quality [String] uality IRI
|
63
|
+
# @param parts [boolean] whether to include phenotypes of parts of the entity. default: false
|
64
|
+
# @param historical_homologs [boolean] whether to include historical homologs of the entity in the query. default: false
|
65
|
+
# @return [Hash] A hash
|
66
|
+
#
|
67
|
+
# @example
|
68
|
+
# require 'phenoscaperb'
|
69
|
+
#
|
70
|
+
# ge = Phenoscape::Genes
|
71
|
+
# ge.affecting_entity_phenotype(iri: "http://purl.obolibrary.org/obo/UBERON_0003097")
|
72
|
+
def self.affecting_entity_phenotype(iri:, quality: nil, parts: nil, historical_homologs: nil,
|
73
|
+
serial_homologs: nil, limit: nil, offset: nil, total: nil, verbose: nil, options: nil)
|
74
|
+
|
75
|
+
arguments = { iri: iri, quality: quality, parts: parts,
|
76
|
+
historical_homologs: historical_homologs, serial_homologs: serial_homologs,
|
77
|
+
limit: limit, offset: offset, total: total }.tostrings
|
78
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
79
|
+
Request.new("gene/affecting_entity_phenotype", opts, verbose, options, nil).perform
|
80
|
+
end
|
81
|
+
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require "faraday"
|
2
|
+
require 'faraday_middleware'
|
3
|
+
require "multi_json"
|
4
|
+
require "xml/to/hash"
|
5
|
+
require "phenoscaperb/error"
|
6
|
+
require "phenoscaperb/request"
|
7
|
+
require "phenoscaperb/constants"
|
8
|
+
require 'phenoscaperb/helpers/configuration'
|
9
|
+
require 'phenoscaperb/faraday'
|
10
|
+
require 'phenoscaperb/utils'
|
11
|
+
|
12
|
+
##
|
13
|
+
# Phenoscape::Ontotrace
|
14
|
+
#
|
15
|
+
# Module to perform HTTP requests to the Phenoscape Ontotrace API
|
16
|
+
module Phenoscape
|
17
|
+
module Ontotrace
|
18
|
+
##
|
19
|
+
# Generate matrix of inferred presence/absence associations for anatomical structures subsumed by the provided entity class expression, for any taxa within the provided taxon class expression. Returns a NeXML-format evolutionary character matrix.
|
20
|
+
#
|
21
|
+
# @!macro phenoscape_params
|
22
|
+
# @!macro phenoscape_options
|
23
|
+
# @param taxon [String] Taxonomic class expression in OWL Manchester syntax
|
24
|
+
# @param entity [String] Anatomical class expression in OWL Manchester syntax
|
25
|
+
# @param variable_only [boolean] whether to restrict the matrix to characters with both ‘present’ and ‘absent’ values in the matrix. default: true
|
26
|
+
# @param ret [String] what to return, one of hash (default), text (raw xml [nexml] as text), or noko (class 'Nokogiri::XML::Document')
|
27
|
+
# @return [Hash] A hash
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
# require 'phenoscaperb'
|
31
|
+
#
|
32
|
+
# onto = Phenoscape::Ontotrace
|
33
|
+
# onto.ontotrace(taxon: "<http://purl.obolibrary.org/obo/VTO_0058051>", entity: "<http://purl.obolibrary.org/obo/BFO_0000050>")
|
34
|
+
# onto.ontotrace(taxon: "<http://purl.obolibrary.org/obo/VTO_0058051>", entity: "<http://purl.obolibrary.org/obo/BFO_0000050>", variable_only: false)
|
35
|
+
#.
|
36
|
+
#. # this one times out
|
37
|
+
# # onto.ontotrace(taxon: "http://purl.obolibrary.org/obo/VTO_0033622", entity: "http://purl.obolibrary.org/obo/UBERON_0003097")
|
38
|
+
def self.ontotrace(taxon:, entity:, variable_only: nil, ret: "hash", verbose: nil, options: nil)
|
39
|
+
|
40
|
+
arguments = { taxon: taxon, entity: entity, variable_only: variable_only }.tostrings
|
41
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
42
|
+
Request.new("ontotrace", opts, verbose, options, ret, "application/xml").perform
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require "faraday"
|
2
|
+
require 'faraday_middleware'
|
3
|
+
require "multi_json"
|
4
|
+
require "phenoscaperb/error"
|
5
|
+
require "phenoscaperb/request"
|
6
|
+
require "phenoscaperb/constants"
|
7
|
+
require 'phenoscaperb/helpers/configuration'
|
8
|
+
require 'phenoscaperb/faraday'
|
9
|
+
require 'phenoscaperb/utils'
|
10
|
+
|
11
|
+
##
|
12
|
+
# Phenoscape::Studies
|
13
|
+
#
|
14
|
+
# Class to perform HTTP requests to the Phenoscape API
|
15
|
+
module Phenoscape
|
16
|
+
module Studies
|
17
|
+
##
|
18
|
+
# Return studies containing taxa which are members of the optional input taxon expression and are have annotated phenotypes which are relevant to the optional input entity expression.
|
19
|
+
#
|
20
|
+
# @!macro phenoscape_params
|
21
|
+
# @!macro phenoscape_options
|
22
|
+
# @param taxon [String] Taxonomic class expression in OWL Manchester syntax
|
23
|
+
# @param entity [String] Anatomical class expression in OWL Manchester syntax
|
24
|
+
# @return [Hash] A hash
|
25
|
+
#
|
26
|
+
# @example
|
27
|
+
# require 'phenoscaperb'
|
28
|
+
#
|
29
|
+
# st = Phenoscape::Studies
|
30
|
+
# st.query(taxon: "<http://purl.obolibrary.org/obo/VTO_0037519>", entity: "<http://purl.obolibrary.org/obo/UBERON_0001703>")
|
31
|
+
def self.query(taxon:, entity:, verbose: nil, options: nil)
|
32
|
+
|
33
|
+
arguments = { taxon: taxon, entity: entity }.tostrings
|
34
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
35
|
+
Request.new("study/query", opts, verbose, options, nil).perform
|
36
|
+
end
|
37
|
+
|
38
|
+
# Taxa annotated within a study
|
39
|
+
#
|
40
|
+
# @!macro phenoscape_params
|
41
|
+
# @!macro phenoscape_options
|
42
|
+
# @param iri [String] the study IRI
|
43
|
+
# @param limit [Integer] maximum results to return
|
44
|
+
# @param offset [Integer] index of results to begin returning
|
45
|
+
# @param total [boolean] whether to return the total result count rather than the results
|
46
|
+
# @return [Hash] A hash
|
47
|
+
#
|
48
|
+
# @example
|
49
|
+
# require 'phenoscaperb'
|
50
|
+
#
|
51
|
+
# tax = Phenoscape::Studies
|
52
|
+
# st.taxa(iri: "http://www.pfeilbook.com/07pala/pdf/2_48d15.pdf")
|
53
|
+
def self.taxa(iri:, limit: 20, offset: 0, total: false, verbose: nil, options: nil)
|
54
|
+
|
55
|
+
arguments = { iri: iri, limit: limit, offset: offset, total: total }.tostrings
|
56
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
57
|
+
Request.new("study/taxa", opts, verbose, options, nil).perform
|
58
|
+
end
|
59
|
+
|
60
|
+
# Character states and their phenotypes annotated within a study
|
61
|
+
#
|
62
|
+
# @!macro phenoscape_params
|
63
|
+
# @!macro phenoscape_options
|
64
|
+
# @param iri [String] the study IRI
|
65
|
+
# @param limit [Integer] maximum results to return
|
66
|
+
# @param offset [Integer] index of results to begin returning
|
67
|
+
# @param total [boolean] whether to return the total result count rather than the results
|
68
|
+
# @return [Hash] A hash
|
69
|
+
#
|
70
|
+
# @example
|
71
|
+
# require 'phenoscaperb'
|
72
|
+
#
|
73
|
+
# tax = Phenoscape::Studies
|
74
|
+
# st.phenotypes(iri: "http://www.pfeilbook.com/07pala/pdf/2_48d15.pdf")
|
75
|
+
def self.phenotypes(iri:, limit: 20, offset: 0, total: false, verbose: nil, options: nil)
|
76
|
+
|
77
|
+
arguments = { iri: iri, limit: limit, offset: offset, total: total }.tostrings
|
78
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
79
|
+
Request.new("study/phenotypes", opts, verbose, options, nil).perform
|
80
|
+
end
|
81
|
+
|
82
|
+
# Return a data matrix in NeXML format containing the data for a given study.
|
83
|
+
#
|
84
|
+
# @!macro phenoscape_params
|
85
|
+
# @!macro phenoscape_options
|
86
|
+
# @param iri [String] the study IRI
|
87
|
+
# @return [Hash] A hash
|
88
|
+
#
|
89
|
+
# @example
|
90
|
+
# require 'phenoscaperb'
|
91
|
+
#
|
92
|
+
# tax = Phenoscape::Studies
|
93
|
+
# st.matrix(iri: "http://www.pfeilbook.com/07pala/pdf/2_48d15.pdf")
|
94
|
+
def self.matrix(iri:, ret: "hash", verbose: nil, options: nil)
|
95
|
+
|
96
|
+
arguments = { iri: iri }.tostrings
|
97
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
98
|
+
Request.new("study/matrix", opts, verbose, options, ret, "text/plain").perform
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,115 @@
|
|
1
|
+
require "faraday"
|
2
|
+
require 'faraday_middleware'
|
3
|
+
require "multi_json"
|
4
|
+
require "phenoscaperb/error"
|
5
|
+
require "phenoscaperb/request"
|
6
|
+
require "phenoscaperb/constants"
|
7
|
+
require 'phenoscaperb/helpers/configuration'
|
8
|
+
require 'phenoscaperb/faraday'
|
9
|
+
require 'phenoscaperb/utils'
|
10
|
+
|
11
|
+
##
|
12
|
+
# Phenoscape::Taxa
|
13
|
+
#
|
14
|
+
# Class to perform HTTP requests to the Phenoscape API
|
15
|
+
module Phenoscape
|
16
|
+
module Taxa
|
17
|
+
##
|
18
|
+
# Return detail info for a given taxon. Currently this is the label, extinction status, and an optional rank.
|
19
|
+
#
|
20
|
+
# @!macro phenoscape_params
|
21
|
+
# @!macro phenoscape_options
|
22
|
+
# @param iri [String] a taxon IRI
|
23
|
+
# @return [Hash] A hash
|
24
|
+
#
|
25
|
+
# @example
|
26
|
+
# require 'phenoscaperb'
|
27
|
+
#
|
28
|
+
# tax = Phenoscape::Taxa
|
29
|
+
# tax.taxon(iri: "http://purl.obolibrary.org/obo/VTO_0067193")
|
30
|
+
def self.taxon(iri:, verbose: nil, options: nil)
|
31
|
+
|
32
|
+
arguments = { iri: iri }.tostrings
|
33
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
34
|
+
Request.new("taxon", opts, verbose, options, nil).perform
|
35
|
+
end
|
36
|
+
|
37
|
+
# Retrieve all taxa with a given taxonomic rank, within the given super-taxon. Ranks are term IRIs from the taxonomic rank ontology such as order, family, genus, species.
|
38
|
+
#
|
39
|
+
# @!macro phenoscape_params
|
40
|
+
# @!macro phenoscape_options
|
41
|
+
# @param rank [String] a rank IRI
|
42
|
+
# @param in_taxon [String] a taxon IRI
|
43
|
+
# @return [Hash] A hash
|
44
|
+
#
|
45
|
+
# @example
|
46
|
+
# require 'phenoscaperb'
|
47
|
+
#
|
48
|
+
# tax = Phenoscape::Taxa
|
49
|
+
# tax.taxon_with_rank(rank: "http://purl.obolibrary.org/obo/TAXRANK_0000003", in_taxon: "http://purl.obolibrary.org/obo/VTO_0000009")
|
50
|
+
def self.taxon_with_rank(rank:, in_taxon:, verbose: nil, options: nil)
|
51
|
+
|
52
|
+
arguments = { rank: rank, in_taxon: in_taxon }.tostrings
|
53
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
54
|
+
Request.new("taxon/with_rank", opts, verbose, options, nil).perform
|
55
|
+
end
|
56
|
+
|
57
|
+
# Retrieve taxa with annotated phenotypes related to the given anatomical entity or quality.
|
58
|
+
#
|
59
|
+
# @!macro phenoscape_params
|
60
|
+
# @!macro phenoscape_options
|
61
|
+
# @param entity [String] Anatomical class expression in OWL Manchester syntax
|
62
|
+
# @param quality [String] Quality class expression in OWL Manchester syntax
|
63
|
+
# @param in_taxon [String] A taxon group to limit the results
|
64
|
+
# @param parts [boolean] whether to include phenotypes of parts of the entity. default: false
|
65
|
+
# @param historical_homologs [boolean] whether to include historical homologs of the entity in the query. default: false
|
66
|
+
# @param serial_homologs [boolean] whether to include serial homologs of the entity in the query. default: false
|
67
|
+
# @param total [boolean] whether to return the total result count rather than the results. default: false
|
68
|
+
# @return [Hash] A hash
|
69
|
+
#
|
70
|
+
# @example
|
71
|
+
# require 'phenoscaperb'
|
72
|
+
#
|
73
|
+
# tax = Phenoscape::Taxa
|
74
|
+
# tax.with_phenotype(entity: "<http://purl.obolibrary.org/obo/UBERON_0008897>", quality: "<http://purl.obolibrary.org/obo/PATO_0000052>", in_taxon: "http://purl.obolibrary.org/obo/VTO_0059975")
|
75
|
+
# tax.with_phenotype(entity: "<http://purl.obolibrary.org/obo/UBERON_0008897>", quality: "<http://purl.obolibrary.org/obo/PATO_0000052>", in_taxon: "http://purl.obolibrary.org/obo/VTO_0059975", total: true)
|
76
|
+
def self.with_phenotype(entity: nil, quality: nil, in_taxon: nil, parts: false, historical_homologs: false,
|
77
|
+
serial_homologs: false, limit: 20, offset: 0, total: false, verbose: nil, options: nil)
|
78
|
+
|
79
|
+
arguments = { entity: entity, quality: quality, in_taxon: in_taxon, parts: parts,
|
80
|
+
historical_homologs: historical_homologs, serial_homologs: serial_homologs,
|
81
|
+
limit: limit, offset: offset, total: total }.tostrings
|
82
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
83
|
+
Request.new("taxon/with_phenotype", opts, verbose, options, nil).perform
|
84
|
+
end
|
85
|
+
|
86
|
+
# Retrieve taxa annotations
|
87
|
+
#
|
88
|
+
# @!macro phenoscape_params
|
89
|
+
# @!macro phenoscape_options
|
90
|
+
# @param entity [String] Anatomical class expression
|
91
|
+
# @param quality [String] Quality class expression
|
92
|
+
# @param in_taxon [String] A taxon group to limit the results
|
93
|
+
# @param parts [boolean] whether to include phenotypes of parts of the entity. default: false
|
94
|
+
# @param historical_homologs [boolean] whether to include historical homologs of the entity in the query. default: false
|
95
|
+
# @param serial_homologs [boolean] whether to include serial homologs of the entity in the query. default: false
|
96
|
+
# @param total [boolean] whether to return the total result count rather than the results. default: false
|
97
|
+
# @return [Hash] A hash
|
98
|
+
#
|
99
|
+
# @example
|
100
|
+
# require 'phenoscaperb'
|
101
|
+
#
|
102
|
+
# tax = Phenoscape::Taxa
|
103
|
+
# tax.annotations(entity: "http://purl.obolibrary.org/obo/UBERON_0001703", quality: "http://purl.obolibrary.org/obo/PATO_0000052", in_taxon: "http://purl.obolibrary.org/obo/VTO_0037519", parts: true, historical_homologs: false, serial_homologs: false, limit: 20, offset: 0, total: true)
|
104
|
+
def self.annotations(entity: nil, quality: nil, in_taxon: nil, parts: false, historical_homologs: false,
|
105
|
+
serial_homologs: false, limit: 20, offset: 0, total: false, verbose: nil, options: nil)
|
106
|
+
|
107
|
+
arguments = { entity: entity, quality: quality, in_taxon: in_taxon, parts: parts,
|
108
|
+
historical_homologs: historical_homologs, serial_homologs: serial_homologs,
|
109
|
+
limit: limit, offset: offset, total: total }.tostrings
|
110
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
111
|
+
Request.new("taxon/annotations", opts, verbose, options, nil).perform
|
112
|
+
end
|
113
|
+
|
114
|
+
end
|
115
|
+
end
|
@@ -0,0 +1,200 @@
|
|
1
|
+
require "faraday"
|
2
|
+
require 'faraday_middleware'
|
3
|
+
require "multi_json"
|
4
|
+
require "phenoscaperb/error"
|
5
|
+
require "phenoscaperb/request"
|
6
|
+
require "phenoscaperb/constants"
|
7
|
+
require 'phenoscaperb/helpers/configuration'
|
8
|
+
require 'phenoscaperb/faraday'
|
9
|
+
require 'phenoscaperb/utils'
|
10
|
+
|
11
|
+
##
|
12
|
+
# Phenoscape::Terms
|
13
|
+
#
|
14
|
+
# Class to perform HTTP requests to the Phenoscape API
|
15
|
+
module Phenoscape
|
16
|
+
module Terms
|
17
|
+
##
|
18
|
+
# Return detail info for a given term. Currently this is the label and an optional definition.
|
19
|
+
#
|
20
|
+
# @!macro phenoscape_params
|
21
|
+
# @!macro phenoscape_options
|
22
|
+
# @param iri [String] a term IRI
|
23
|
+
# @return [Hash] A hash
|
24
|
+
#
|
25
|
+
# @example
|
26
|
+
# require 'phenoscaperb'
|
27
|
+
#
|
28
|
+
# tm = Phenoscape::Terms
|
29
|
+
# tm.term(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")
|
30
|
+
def self.term(iri:, verbose: nil, options: nil)
|
31
|
+
|
32
|
+
arguments = { iri: iri }.tostrings
|
33
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
34
|
+
Request.new("term", opts, verbose, options, nil).perform
|
35
|
+
end
|
36
|
+
|
37
|
+
# Search for terms in the KB by text match on a property value.
|
38
|
+
#
|
39
|
+
# @!macro phenoscape_params
|
40
|
+
# @!macro phenoscape_options
|
41
|
+
# @param string [String] the input text to search
|
42
|
+
# @param type [String] the type of term to search for, e.g. http://www.w3.org/2002/07/owl#Class
|
43
|
+
# @param property [String] relation between term and text
|
44
|
+
# @return [Hash] A hash
|
45
|
+
#
|
46
|
+
# @example
|
47
|
+
# require 'phenoscaperb'
|
48
|
+
#
|
49
|
+
# tm = Phenoscape::Terms
|
50
|
+
# tm.search(text: "fin")
|
51
|
+
def self.search(text:, type: nil, property: nil, verbose: nil, options: nil)
|
52
|
+
|
53
|
+
arguments = { text: text, type: type, property: property }.tostrings
|
54
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
55
|
+
Request.new("term/search", opts, verbose, options, nil).perform
|
56
|
+
end
|
57
|
+
|
58
|
+
# Search for classes from a particular ontology.
|
59
|
+
#
|
60
|
+
# @!macro phenoscape_params
|
61
|
+
# @!macro phenoscape_options
|
62
|
+
# @param text [String] the input text to search
|
63
|
+
# @param definedBy [String] the ontology identifier IRI in which the search terms are defined, e.g. http://purl.obolibrary.org/obo/uberon.owl
|
64
|
+
# @param limit [integer] limit records
|
65
|
+
# @return [Hash] A hash
|
66
|
+
#
|
67
|
+
# @example
|
68
|
+
# require 'phenoscaperb'
|
69
|
+
#
|
70
|
+
# tm = Phenoscape::Terms
|
71
|
+
# tm.search_classes(text: "fin", definedBy: "??")
|
72
|
+
def self.search_classes(text:, definedBy:, limit: nil, verbose: nil, options: nil)
|
73
|
+
|
74
|
+
arguments = { text: text, definedBy: definedBy, limit: limit }.tostrings
|
75
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
76
|
+
Request.new("term/search_classes", opts, verbose, options, nil).perform
|
77
|
+
end
|
78
|
+
|
79
|
+
# Retrieve a label for a given term IRI.
|
80
|
+
#
|
81
|
+
# @!macro phenoscape_params
|
82
|
+
# @!macro phenoscape_options
|
83
|
+
# @param iri [String] a taxon IRI
|
84
|
+
# @return [Hash] A hash
|
85
|
+
#
|
86
|
+
# @example
|
87
|
+
# require 'phenoscaperb'
|
88
|
+
#
|
89
|
+
# tm = Phenoscape::Terms
|
90
|
+
# tm.label(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")
|
91
|
+
def self.label(iri:, verbose: nil, options: nil)
|
92
|
+
|
93
|
+
arguments = { iri: iri }.tostrings
|
94
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
95
|
+
Request.new("term/label", opts, verbose, options, nil).perform
|
96
|
+
end
|
97
|
+
|
98
|
+
# Retrieve a label for each term IRI in a list
|
99
|
+
#
|
100
|
+
# @!macro phenoscape_params
|
101
|
+
# @!macro phenoscape_options
|
102
|
+
# @param iris [String] one or more taxon IRIs
|
103
|
+
# @return [Hash] A hash
|
104
|
+
#
|
105
|
+
# @example
|
106
|
+
# require 'phenoscaperb'
|
107
|
+
#
|
108
|
+
# tm = Phenoscape::Terms
|
109
|
+
# tm.labels(iris: [
|
110
|
+
# "http://purl.obolibrary.org/obo/UBERON_0011618"
|
111
|
+
# ])
|
112
|
+
def self.labels(iris:, verbose: nil, options: nil)
|
113
|
+
|
114
|
+
arguments = { iris: iris }.tostrings
|
115
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
116
|
+
Request.new("term/labels", opts, verbose, options, nil).perform
|
117
|
+
end
|
118
|
+
|
119
|
+
# Return direct superclasses, direct subclasses, and equivalent classes of a given term
|
120
|
+
#
|
121
|
+
# @!macro phenoscape_params
|
122
|
+
# @!macro phenoscape_options
|
123
|
+
# @param iri [String] one or more taxon IRIs
|
124
|
+
# @return [Hash] A hash
|
125
|
+
#
|
126
|
+
# @example
|
127
|
+
# require 'phenoscaperb'
|
128
|
+
#
|
129
|
+
# tm = Phenoscape::Terms
|
130
|
+
# tm.classification(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")
|
131
|
+
def self.classification(iri:, verbose: nil, options: nil)
|
132
|
+
|
133
|
+
arguments = { iri: iri }.tostrings
|
134
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
135
|
+
Request.new("term/classification", opts, verbose, options, nil).perform
|
136
|
+
end
|
137
|
+
|
138
|
+
# Return all ancestor superclasses of a given term
|
139
|
+
#
|
140
|
+
# @!macro phenoscape_params
|
141
|
+
# @!macro phenoscape_options
|
142
|
+
# @param iri [String] one or more taxon IRIs
|
143
|
+
# @return [Hash] A hash
|
144
|
+
#
|
145
|
+
# @example
|
146
|
+
# require 'phenoscaperb'
|
147
|
+
#
|
148
|
+
# tm = Phenoscape::Terms
|
149
|
+
# tm.all_ancestors(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")
|
150
|
+
def self.all_ancestors(iri:, verbose: nil, options: nil)
|
151
|
+
|
152
|
+
arguments = { iri: iri }.tostrings
|
153
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
154
|
+
Request.new("term/all_ancestors", opts, verbose, options, nil).perform
|
155
|
+
end
|
156
|
+
|
157
|
+
# Return all descendant subclasses of a given term
|
158
|
+
#
|
159
|
+
# @!macro phenoscape_params
|
160
|
+
# @!macro phenoscape_options
|
161
|
+
# @param iri [String] one or more taxon IRIs
|
162
|
+
# @return [Hash] A hash
|
163
|
+
#
|
164
|
+
# @example
|
165
|
+
# require 'phenoscaperb'
|
166
|
+
#
|
167
|
+
# tm = Phenoscape::Terms
|
168
|
+
# tm.all_descendants(iri: "http://purl.obolibrary.org/obo/UBERON_0011618")
|
169
|
+
def self.all_descendants(iri:, verbose: nil, options: nil)
|
170
|
+
|
171
|
+
arguments = { iri: iri }.tostrings
|
172
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
173
|
+
Request.new("term/all_descendants", opts, verbose, options, nil).perform
|
174
|
+
end
|
175
|
+
|
176
|
+
# Return all descendant subclasses of a given term
|
177
|
+
#
|
178
|
+
# @!macro phenoscape_params
|
179
|
+
# @!macro phenoscape_options
|
180
|
+
# @param iris [String] one or more taxon IRIs
|
181
|
+
# @param definedBy [String] the ontology identifier IRI in which the search terms are defined, e.g. http://purl.obolibrary.org/obo/uberon.owl
|
182
|
+
# @return [Hash] A hash
|
183
|
+
#
|
184
|
+
# @example
|
185
|
+
# require 'phenoscaperb'
|
186
|
+
#
|
187
|
+
# tm = Phenoscape::Terms
|
188
|
+
# tm.least_common_subsumers(
|
189
|
+
# iris: "http://purl.obolibrary.org/obo/UBERON_0011618",
|
190
|
+
#. definedBy: "??"
|
191
|
+
# )
|
192
|
+
def self.least_common_subsumers(iris:, definedBy:, verbose: nil, options: nil)
|
193
|
+
|
194
|
+
arguments = { iris: iris, definedBy: definedBy }.tostrings
|
195
|
+
opts = arguments.delete_if { |k, v| v.nil? }
|
196
|
+
Request.new("term/least_common_subsumers", opts, verbose, options, nil).perform
|
197
|
+
end
|
198
|
+
|
199
|
+
end
|
200
|
+
end
|