Skip to content

Commit

Permalink
feat: Conflicting evidences in ACMG SV criteria (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
gromdimon authored Oct 12, 2023
1 parent 0b572f6 commit 061e03f
Show file tree
Hide file tree
Showing 7 changed files with 1,762 additions and 86 deletions.
42 changes: 21 additions & 21 deletions backend/app/api/internal/endpoints/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,27 @@ def default_acmg_rating() -> dict[str, bool]:
return {k: False for k in ACMG_RATING_KEYS}


class CustomHttpAdapter(requests.adapters.HTTPAdapter):
# "Transport adapter" that allows us to use custom ssl_context.

def __init__(self, ssl_context=None, **kwargs):
self.ssl_context = ssl_context
super().__init__(**kwargs)

def init_poolmanager(self, connections, maxsize, block=False):
self.poolmanager = urllib3.poolmanager.PoolManager(
num_pools=connections, maxsize=maxsize, block=block, ssl_context=self.ssl_context
)


def get_legacy_session():
ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
ctx.options |= 0x4 # OP_LEGACY_SERVER_CONNECT
session = requests.session()
session.mount("https://", CustomHttpAdapter(ctx))
return session


router = APIRouter()


Expand Down Expand Up @@ -105,27 +126,6 @@ async def acmg(request: Request):
return JSONResponse(acmg_rating)


class CustomHttpAdapter(requests.adapters.HTTPAdapter):
# "Transport adapter" that allows us to use custom ssl_context.

def __init__(self, ssl_context=None, **kwargs):
self.ssl_context = ssl_context
super().__init__(**kwargs)

def init_poolmanager(self, connections, maxsize, block=False):
self.poolmanager = urllib3.poolmanager.PoolManager(
num_pools=connections, maxsize=maxsize, block=block, ssl_context=self.ssl_context
)


def get_legacy_session():
ctx = ssl.create_default_context(ssl.Purpose.SERVER_AUTH)
ctx.options |= 0x4 # OP_LEGACY_SERVER_CONNECT
session = requests.session()
session.mount("https://", CustomHttpAdapter(ctx))
return session


@router.get("/cnv/acmg/{path:path}")
async def cnv_acmg(request: Request):
"""Implement searching for ACMG classification for CNVs."""
Expand Down
1 change: 1 addition & 0 deletions backend/env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ BACKEND_PREFIX_ANNONARS=http://localhost:3001
BACKEND_PREFIX_MEHARI=http://localhost:3002
BACKEND_PREFIX_VIGUNO=http://localhost:3003
BACKEND_PREFIX_NGINX=http://localhost:3004
BACKEND_PREFIX_DOTTY=http://localhost:3005

# Access to redis as it runs Docker Compose.
REDIS_URL=redis://localhost:3030
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/SvDetails/AcmgRating.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const switchCriteria = (
<h1 title="Automatically determined ACMG class (Richards et al., 2015)">
{{ calculateAcmgClass }} with score: {{ calculateAcmgScore }}
</h1>
<router-link to="/acmg-docs" target="_blank">
<router-link to="/acmg-sv-docs" target="_blank">
Further documentation <v-icon>mdi-open-in-new</v-icon>
</router-link>
</div>
Expand Down
Loading

0 comments on commit 061e03f

Please sign in to comment.