Module: Sylfy::CBioPortal::REST
- Defined in:
- lib/sylfy/service/cbioportal.rb
Constant Summary collapse
- BASEURI =
URI.parse('http://www.cbioportal.org')
- HTTP =
BASEURI = URI.parse(‘www.cbioportal.org/public-portal/webservice.do?’)
Net::HTTP.new(BASEURI.host, BASEURI.port)
Class Method Summary collapse
-
.getCancerStudies ⇒ array of Hash
internal method supporting all ENSEMBLREST service.
-
.getCaseLists(cancer_study_id) ⇒ array of Hash
internal method supporting all ENSEMBLREST service.
-
.getClinicalData(case_set_id) ⇒ array of Hash
internal method supporting all ENSEMBLREST service.
-
.getGeneticProfiles(cancer_study_id) ⇒ array of Hash
internal method supporting all ENSEMBLREST service.
-
.getMutationData(case_set_id, genetic_profile_id, gene_list) ⇒ array of Hash
internal method supporting all ENSEMBLREST service.
-
.getProfileData(case_set_id, genetic_profile_id, gene_list) ⇒ array of Hash
internal method supporting all ENSEMBLREST service.
-
.getTypesOfCancer ⇒ array of Hash
internal method supporting all ENSEMBLREST service.
-
.service(get_path, csv_opts = {}) ⇒ array of Hash
internal method supporting all ENSEMBLREST service.
Class Method Details
.getCancerStudies ⇒ array of Hash
internal method supporting all ENSEMBLREST service
65 66 67 68 |
# File 'lib/sylfy/service/cbioportal.rb', line 65 def getCancerStudies() get_path = "/public-portal/webservice.do?cmd=getCancerStudies" return Sylfy::CBioPortal::REST.service(get_path) end |
.getCaseLists(cancer_study_id) ⇒ array of Hash
internal method supporting all ENSEMBLREST service
87 88 89 90 |
# File 'lib/sylfy/service/cbioportal.rb', line 87 def getCaseLists(cancer_study_id) get_path = "/public-portal/webservice.do?cmd=getCaseLists&cancer_study_id=#{cancer_study_id}" return Sylfy::CBioPortal::REST.service(get_path) end |
.getClinicalData(case_set_id) ⇒ array of Hash
internal method supporting all ENSEMBLREST service
129 130 131 132 |
# File 'lib/sylfy/service/cbioportal.rb', line 129 def getClinicalData(case_set_id) get_path = "/public-portal/webservice.do?cmd=getClinicalData&case_set_id=#{case_set_id}" return Sylfy::CBioPortal::REST.service(get_path) end |
.getGeneticProfiles(cancer_study_id) ⇒ array of Hash
internal method supporting all ENSEMBLREST service
76 77 78 79 |
# File 'lib/sylfy/service/cbioportal.rb', line 76 def getGeneticProfiles(cancer_study_id) get_path = "/public-portal/webservice.do?cmd=getGeneticProfiles&cancer_study_id=#{cancer_study_id}" return Sylfy::CBioPortal::REST.service(get_path) end |
.getMutationData(case_set_id, genetic_profile_id, gene_list) ⇒ array of Hash
internal method supporting all ENSEMBLREST service
118 119 120 121 |
# File 'lib/sylfy/service/cbioportal.rb', line 118 def getMutationData(case_set_id, genetic_profile_id, gene_list) get_path = "/public-portal/webservice.do?cmd=getMutationData&case_set_id=#{case_set_id}&genetic_profile_id=#{genetic_profile_id}&gene_list=#{gene_list}" return Sylfy::CBioPortal::REST.service(get_path) end |
.getProfileData(case_set_id, genetic_profile_id, gene_list) ⇒ array of Hash
internal method supporting all ENSEMBLREST service
103 104 105 106 |
# File 'lib/sylfy/service/cbioportal.rb', line 103 def getProfileData(case_set_id, genetic_profile_id, gene_list) get_path = "/public-portal/webservice.do?cmd=getProfileData&case_set_id=#{case_set_id}&genetic_profile_id=#{genetic_profile_id}&gene_list=#{gene_list}" return Sylfy::CBioPortal::REST.service(get_path) end |
.getTypesOfCancer ⇒ array of Hash
internal method supporting all ENSEMBLREST service
50 51 52 53 |
# File 'lib/sylfy/service/cbioportal.rb', line 50 def getTypesOfCancer() get_path = "/public-portal/webservice.do?cmd=getTypesOfCancer" return Sylfy::CBioPortal::REST.service(get_path) end |
.service(get_path, csv_opts = {}) ⇒ array of Hash
internal method supporting all ENSEMBLREST service
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/sylfy/service/cbioportal.rb', line 29 def service(get_path, csv_opts = {}) request = Net::HTTP::Get.new(get_path) response = HTTP.request(request) if response.code != "200" raise Sylfy::Service::ParameterError, "Invalid response: #{response.code}" else return CSV.parse(response.body, {col_sep: "\t", skip_lines: /^#/, headers: true}.merge(csv_opts)) end end |