Skip to content

Commit

Permalink
Updated the pairwise_macro_synteny_blocks service to use the redis pa…
Browse files Browse the repository at this point in the history
…ckage in place of the aioredis and redisearch packages.
  • Loading branch information
alancleary committed Jul 14, 2022
1 parent 3060d3d commit bd81a24
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 67 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# dependencies
import aioredis
import redis.asyncio as redis


async def connectToRedis(host='localhost', port=6379, db=0, password=None):
# connect to database
connection = await aioredis.Redis(host=host, port=port, db=db, password=password, decode_responses=True)
connection = await redis.Redis(host=host, port=port, db=db, password=password, decode_responses=True)
# ping to force connection, preventing errors downstream
await connection.ping()
return connection
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Python
from collections import defaultdict
from itertools import chain
# dependencies
from redis.commands.search import AsyncSearch
# module
from pairwise_macro_synteny_blocks.aioredisearch import Client
from pairwise_macro_synteny_blocks.metrics import METRICS


Expand Down Expand Up @@ -146,8 +147,7 @@ def _indexPairsToIndexBlocks(self, pairs, intermediate, matched):
async def process(self, query_chromosome, target, matched, intermediate, mask, metrics, chromosome_genes, chromosome_length):

# connect to the indexes
chromosome_index = Client('chromosomeIdx', conn=self.redis_connection)
gene_index = Client('geneIdx', conn=self.redis_connection)
chromosome_index = AsyncSearch(self.redis_connection, index_name='chromosomeIdx')

# check if the target chromosome exists
target_doc_id = f'chromosome:{target}'
Expand Down
5 changes: 1 addition & 4 deletions pairwise_macro_synteny_blocks/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ classifiers =
Operating System :: OS Independent
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Expand All @@ -31,12 +29,11 @@ project_urls =
packages = find:
python_requires = >=3.5,<4
install_requires =
aioredis >=2.0,<3
aiohttp >=3.7,<4
aiohttp-cors
grpcio >=1.39,<2
grpcio-tools >=1.39,<2
redisearch >=2,<3
redis >=4.3.4,<5
uvloop >=0.16,<1

[options.entry_points]
Expand Down

0 comments on commit bd81a24

Please sign in to comment.