コード例 #1
0
 def gsoc_search_display_id(self, part_shop, collection, display_id):
     query = sbol2.SearchQuery()
     query[sbol2.SBOL_COLLECTION] = collection
     query[sbol2.SBOL_DISPLAY_ID] = display_id
     # GSOC is always looking for DNA Region
     query[sbol2.SBOL_TYPES] = sbol2.BIOPAX_DNA
     return part_shop.search(query)
コード例 #2
0
 def gsoc_search_title(self, part_shop, collection, title):
     query = sbol2.SearchQuery()
     query[sbol2.SBOL_COLLECTION] = collection
     query[sbol2.SBOL_NAME] = title
     # GSOC is always looking for DNA Region
     query[sbol2.SBOL_TYPES] = sbol2.BIOPAX_DNA
     return part_shop.search(query)
コード例 #3
0
 def test_gsoc_count_5(self):
     part_shop = sbol2.PartShop(GSOC_SBH_URL)
     query = sbol2.SearchQuery()
     collection = 'https://synbiohub.org/public/bsu/bsu_collection/1'
     query[sbol2.SBOL_COLLECTION] = collection
     query[sbol2.SBOL_NAME] = 'accA'
     # GSOC is always looking for DNA Region
     query[sbol2.SBOL_TYPES] = sbol2.BIOPAX_DNA
     count = part_shop.searchCount(query)
     self.assertEqual(1, count)
コード例 #4
0
 def test_gsoc_example_1_display_id(self):
     # See issue #240
     collection = 'https://synbiohub.org/public/igem/igem_collection/1'
     display_id = 'BBa_E0040'
     query = sbol2.SearchQuery()
     query[sbol2.SBOL_COLLECTION] = collection
     query[sbol2.SBOL_DISPLAY_ID] = display_id
     # GSOC is always looking for DNA Region
     query[sbol2.SBOL_TYPES] = sbol2.BIOPAX_DNA
     part_shop = sbol2.PartShop(GSOC_SBH_URL)
     response = part_shop.search(query)
     # At least one item in return should be the
     # expected return: https://synbiohub.org/public/igem/BBa_E0040/1
     identities = [r.identity for r in response]
     self.assertIn('https://synbiohub.org/public/igem/BBa_E0040/1',
                   identities)
     #
     # All items in response should have name == GFP exactly.
     display_ids = [r.displayId == display_id for r in response]
     self.assertTrue(all(display_ids))
コード例 #5
0
 def test_search_query1(self):
     query = sbol2.SearchQuery()
     query[sbol2.SBOL_TYPES] = sbol2.BIOPAX_DNA
     self.assertIn(sbol2.SBOL_TYPES, query.properties)
     self.assertEqual(sbol2.BIOPAX_DNA, query[sbol2.SBOL_TYPES])