Exemplo n.º 1
0
 def testPhenotypesSearchDescriptionWildcard(self):
     request = protocol.SearchPhenotypesRequest()
     request.phenotype_association_set_id = \
         self.getPhenotypeAssociationSetId()
     request.description = ".*sensitivity.*"
     postUrl = '/phenotypes/search'
     response = self.sendSearchRequest(
         postUrl,
         request,
         protocol.SearchPhenotypesResponse)
     self.assertEqual(7, len(response.phenotypes))
Exemplo n.º 2
0
 def testPhenotypesSearchOntologyTerm(self):
     request = protocol.SearchPhenotypesRequest()
     request.phenotype_association_set_id = \
         self.getPhenotypeAssociationSetId()
     request.type.term_id = "http://ohsu.edu/cgd/5c895709"
     postUrl = '/phenotypes/search'
     response = self.sendSearchRequest(
         postUrl,
         request,
         protocol.SearchPhenotypesResponse)
     self.assertGreater(len(response.phenotypes), 0)
Exemplo n.º 3
0
 def testSearchPhenotype(self):
     request = protocol.SearchPhenotypesRequest()
     request.phenotype_association_set_id = \
         self.phenotype_association_set_id
     request.id = self.phenotype_ids[0]
     request.page_size = self.pageSize
     self.httpClient.search_phenotype(
         phenotype_association_set_id=self.phenotype_association_set_id,
         phenotype_id=self.phenotype_ids[0])
     self.httpClient._run_search_request.assert_called_once_with(
         request, "phenotypes", protocol.SearchPhenotypesResponse)
Exemplo n.º 4
0
 def testPhenotypesSearchDescription(self):
     request = protocol.SearchPhenotypesRequest()
     request.phenotype_association_set_id = \
         self.getPhenotypeAssociationSetId()
     request.description = \
             "Papillary thyroid carcinoma with sensitivity to therapy"  # noqa
     postUrl = '/phenotypes/search'
     response = self.sendSearchRequest(
         postUrl,
         request,
         protocol.SearchPhenotypesResponse)
     self.assertGreater(len(response.phenotypes), 0)
Exemplo n.º 5
0
 def testPhenotypesSearchById(self):
     request = protocol.SearchPhenotypesRequest()
     request.phenotype_association_set_id = \
         self.getPhenotypeAssociationSetId()
     # setup phenotype query
     request.id = "http://ohsu.edu/cgd/30ebfd1a"
     postUrl = '/phenotypes/search'
     response = self.sendSearchRequest(
         postUrl,
         request,
         protocol.SearchPhenotypesResponse)
     self.assertEqual(request.id, response.phenotypes[0].id)
Exemplo n.º 6
0
 def testPhenotypesSearchMultipleTerms(self):
     request = protocol.SearchPhenotypesRequest()
     request.phenotype_association_set_id = \
         self.getPhenotypeAssociationSetId()
     request.description = "Melanoma, NOS with response to therapy"
     request.age_of_onset.term_id = \
         "http://purl.obolibrary.org/obo/HP_0003581"
     postUrl = '/phenotypes/search'
     response = self.sendSearchRequest(
         postUrl,
         request,
         protocol.SearchPhenotypesResponse)
     self.assertGreater(len(response.phenotypes), 0)
Exemplo n.º 7
0
 def testPhenotypeSearchQualifiersSensitivityPATO_0000396(self):
     request = protocol.SearchPhenotypesRequest()
     request.phenotype_association_set_id = \
         self.getPhenotypeAssociationSetId()
     ontologyterm = protocol.OntologyTerm()
     ontologyterm.term_id = "http://purl.obolibrary.org/obo/PATO_0000396"
     request.qualifiers.extend([ontologyterm])
     postUrl = '/phenotypes/search'
     response = self.sendSearchRequest(
         postUrl,
         request,
         protocol.SearchPhenotypesResponse)
     self.assertGreater(len(response.phenotypes), 0)
Exemplo n.º 8
0
 def sendPhenotypesSearch(self):
     request = protocol.SearchPhenotypesRequest()
     request.phenotype_association_set_id = self.phenotypeAssociationSetId
     return self.sendPostRequest('/phenotypes/search', request)