Skip to content

Commit

Permalink
Production update (#374)
Browse files Browse the repository at this point in the history
* Documentation: Add documentation for the staging and production instance (#317)

* Add documentation for staging and prod

* Modify README.md

* code formatting

* Grammatical fixes

* Add Keycloak related info

* Merge outstanding dependency updates (#331)

* Bump mongoose from 6.2.11 to 6.4.6 in /server

Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.2.11 to 6.4.6.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](Automattic/mongoose@6.2.11...6.4.6)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump jose from 2.0.5 to 2.0.6 in /test-node

Bumps [jose](https://github.com/panva/jose) from 2.0.5 to 2.0.6.
- [Release notes](https://github.com/panva/jose/releases)
- [Changelog](https://github.com/panva/jose/blob/v2.0.6/CHANGELOG.md)
- [Commits](panva/jose@v2.0.5...v2.0.6)

---
updated-dependencies:
- dependency-name: jose
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump loader-utils from 1.4.0 to 1.4.2 in /react

Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.2.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.2/CHANGELOG.md)
- [Commits](webpack/loader-utils@v1.4.0...v1.4.2)

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump deep-object-diff from 1.1.7 to 1.1.9 in /react

Bumps [deep-object-diff](https://github.com/mattphillips/deep-object-diff) from 1.1.7 to 1.1.9.
- [Release notes](https://github.com/mattphillips/deep-object-diff/releases)
- [Commits](https://github.com/mattphillips/deep-object-diff/commits)

---
updated-dependencies:
- dependency-name: deep-object-diff
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump decode-uri-component from 0.2.0 to 0.2.2 in /react

Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump json5 from 1.0.1 to 1.0.2 in /server

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump json5 from 1.0.1 to 1.0.2 in /test-node

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump json5 from 1.0.1 to 1.0.2 in /react

Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](json5/json5@v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add gnomadHet column w/ number of heterozygotes (#334)

* Add gnomadHet calculation
- Add comments

* Change gnomadHet to use PrimaryAF
- Kept AF displayed as max between primary and secondary AF

* Update tests

* Add maleCount field to table rows (#335)

* Fix male count (#337)

* Add allele count column, remove gnomadHet and male count (#338)

* Replace gnomadHet with AC count

* Add AC column to frontend
- update tests

* Update typedefs

* Fix graphQL query, frontend query preparing

* Hide male count by default

* Comment out male count; redundant info

* React: Bump timeout from 90 sec to 900 sec (#339)

* Bump timeout from 90 sec to 900 sec
- Suggested by Matt, Magda (2023-03-13)

* Reduce to 5 minutes

* Revert "Reduce to 5 minutes"

This reverts commit 758f9b9.

* Fix comment

* CMH Integration  (#341)

* Fix typo in g4rdAdapter

* Add CMH adapter

* Add source prefixes; fix error messages

* Update docs

* Update staging server deploy with CMH vars

* Remove cmh env vars from docker prod (for now)

* Bump keycloak-connect from 17.0.0 to 21.0.1 in /server (#336)

Bumps [keycloak-connect](https://github.com/keycloak/keycloak-nodejs-connect) from 17.0.0 to 21.0.1.
- [Release notes](https://github.com/keycloak/keycloak-nodejs-connect/releases)
- [Commits](keycloak/keycloak-nodejs-connect@17.0.0...21.0.1)

---
updated-dependencies:
- dependency-name: keycloak-connect
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump undici from 5.9.1 to 5.19.1 in /server (#333)

Bumps [undici](https://github.com/nodejs/undici) from 5.9.1 to 5.19.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.9.1...v5.19.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Rearrange columns, add tooltips  (#342)

* Add source to duplicate variant check

* Move some columns to Case Details

* Add tooltips for all the columns

* Fix CMH assembly (#343)

* Change CMH adapter to GRCh38

* Fix liftOver if no dataForAnnotation

* Perform LiftOver for CMH query results (GRCh38 -> h37) (#353)

* Add CMHVariantIndelCoordinate type

* More comments

* Update mongo query to accomodate CMH format

* Fix "chrchr" mapping in liftOver

* Remove logger debugs

* Fix gnomad query to exclude CMH if none found
- Fix getCoordinates to not do "chrchr"

* Remove ref[0] == alt[0] query check

* Bump word-wrap from 1.2.3 to 1.2.4 in /server (#350)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump word-wrap from 1.2.3 to 1.2.4 in /test-node (#351)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump word-wrap from 1.2.3 to 1.2.4 in /react (#352)

Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](jonschlinkert/word-wrap@1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump semver from 5.7.1 to 5.7.2 in /test-node (#348)

Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](npm/node-semver@v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump semver from 6.3.0 to 6.3.1 in /server (#347)

Bumps [semver](https://github.com/npm/node-semver) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v6.3.1/CHANGELOG.md)
- [Commits](npm/node-semver@v6.3.0...v6.3.1)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump semver from 5.7.1 to 5.7.2 in /react (#346)

Bumps [semver](https://github.com/npm/node-semver) from 5.7.1 to 5.7.2.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/v5.7.2/CHANGELOG.md)
- [Commits](npm/node-semver@v5.7.1...v5.7.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump tough-cookie from 4.0.0 to 4.1.3 in /react (#345)

Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.0.0 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](salesforce/tough-cookie@v4.0.0...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump tough-cookie from 4.0.0 to 4.1.3 in /server (#344)

Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.0.0 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](salesforce/tough-cookie@v4.0.0...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump mongoose from 6.4.6 to 6.11.3 in /server (#349)

* Bump mongoose from 6.4.6 to 6.11.3 in /server

Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.4.6 to 6.11.3.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](Automattic/mongoose@6.4.6...6.11.3)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix deprecation warning for strictQuery setting

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Set ApolloServer cache to bounded (#354)

* Bump apollo-server-core from 3.10.1 to 3.12.1 in /server (#356)

Bumps [apollo-server-core](https://github.com/apollographql/apollo-server/tree/HEAD/packages/apollo-server-core) from 3.10.1 to 3.12.1.
- [Release notes](https://github.com/apollographql/apollo-server/releases)
- [Commits](https://github.com/apollographql/apollo-server/commits/apollo-server-core@3.12.1/packages/apollo-server-core)

---
updated-dependencies:
- dependency-name: apollo-server-core
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add check for hg38 before filtering gene hits (#357)

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server (#358)

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump undici from 5.19.1 to 5.26.3 in /server (#359)

* Bump undici from 5.19.1 to 5.26.3 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.19.1 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.19.1...v5.26.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server (#358)

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump undici from 5.19.1 to 5.26.3 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.19.1 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.19.1...v5.26.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump @babel/traverse from 7.17.9 to 7.23.2 in /server (#361)

* Bump @babel/traverse from 7.17.9 to 7.23.2 in /server

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.9 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server (#358)

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump undici from 5.19.1 to 5.26.3 in /server (#359)

* Bump undici from 5.19.1 to 5.26.3 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.19.1 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.19.1...v5.26.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server (#358)

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump @babel/traverse from 7.17.3 to 7.23.2 in /react (#360)

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump graphql from 16.3.0 to 16.8.1 in /server

Bumps [graphql](https://github.com/graphql/graphql-js) from 16.3.0 to 16.8.1.
- [Release notes](https://github.com/graphql/graphql-js/releases)
- [Commits](graphql/graphql-js@v16.3.0...v16.8.1)

---
updated-dependencies:
- dependency-name: graphql
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump undici from 5.19.1 to 5.26.3 in /server

Bumps [undici](https://github.com/nodejs/undici) from 5.19.1 to 5.26.3.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](nodejs/undici@v5.19.1...v5.26.3)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump @babel/traverse from 7.17.9 to 7.23.2 in /server

Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.9 to 7.23.2.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse)

---
updated-dependencies:
- dependency-name: "@babel/traverse"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Bump browserify-sign from 4.2.1 to 4.2.2 in /react (#363)

Bumps [browserify-sign](https://github.com/crypto-browserify/browserify-sign) from 4.2.1 to 4.2.2.
- [Changelog](https://github.com/browserify/browserify-sign/blob/main/CHANGELOG.md)
- [Commits](browserify/browserify-sign@v4.2.1...v4.2.2)

---
updated-dependencies:
- dependency-name: browserify-sign
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump chromedriver from 100.0.0 to 119.0.1 in /server (#364)

Bumps [chromedriver](https://github.com/giggio/node-chromedriver) from 100.0.0 to 119.0.1.
- [Commits](giggio/node-chromedriver@100.0.0...119.0.1)

---
updated-dependencies:
- dependency-name: chromedriver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump axios from 0.26.1 to 1.6.0 in /server (#365)

* Bump axios from 0.26.1 to 1.6.0 in /server

Bumps [axios](https://github.com/axios/axios) from 0.26.1 to 1.6.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v0.26.1...v1.6.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update jest config for new axios version

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mackenzie Ian Frew <mackenzie.frew@sickkids.ca>

* Add PT Pagination support for G4RD Staging (#366)

* Add fetchPhenotipsVariant for collecting paginated results

* Don't infinite loop

* Finish pagination support for G4RD

* Fix linting issues

* Formatting

* Fix test suite

* Server: fix pagination bugs with G4RD (#369)

* Fix searching for X, Y chromosomes by position

* Add "pagination" for patient queries

* Linting and formatting

* Use function to get auth token to prevent token expiry mid-query

* Better debug messages

* format

* Add retries to fetchPhenotipsVariants (#370)

- Add check for failed patient query to prevent uncaught exception

* Server: formatting

* Handle null params passed to transform func (#371)

* TEMPORARY: trace GC in staging/prod server (#372)

* TEMPORARY: Add heap profiler for staging/prod (#373)

* TEMPORARY: inspect-brk

* TEMPORARY: inspect-brk to localhost

* TEMPORARY: put inspect back to global

* TEMPORARY: revert to inspect, not inspect-brk

* TEMPORARY: make smaller heap to debug

* TEMPORARY: smaller heap limit

* Remove node debugging flags

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jenny <ziyixu686@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 12, 2024
1 parent 2446c2d commit c0630ed
Show file tree
Hide file tree
Showing 36 changed files with 2,521 additions and 655 deletions.
9 changes: 9 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,13 @@ G4RD_AUTH_METHOD=bearer
G4RD_TOKEN_URL=https://some-provider.example.com
G4RD_AUTH0_BASE_URL=https://some-subdomain.auth0.com

CMH_AZURE_CLIENT_ID=replacethis_id
CMH_AZURE_CLIENT_SECRET=replacethis_secret
CMH_TOKEN_URL=https://replacethis.fakeurl
CMH_RESOURCE=replacethis_id
CMH_SCOPE=https://replacethis.fakeurl/something
CMH_GRANT_TYPE=client_credentials
CMH_GENE42_SECRET=replacethis_secret
CMH_URL=https://replacethis.fakeurl

SERVER_SESSION_SECRET=secret
8 changes: 8 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ jobs:
G4RD_GRANT_TYPE: ${{ secrets.G4RD_GRANT_TYPE }}
G4RD_TOKEN_URL: ${{ secrets.G4RD_TOKEN_URL }}
G4RD_CLIENT_ID: ${{ secrets.G4RD_CLIENT_ID }}
CMH_AZURE_CLIENT_ID: ${{ secrets.CMH_AZURE_CLIENT_ID }}
CMH_AZURE_CLIENT_SECRET: ${{ secrets.CMH_AZURE_CLIENT_SECRET }}
CMH_TOKEN_URL: ${{ secrets.CMH_TOKEN_URL }}
CMH_RESOURCE: ${{ secrets.CMH_RESOURCE }}
CMH_SCOPE: ${{ secrets.CMH_SCOPE }}
CMH_GRANT_TYPE: ${{ secrets.CMH_GRANT_TYPE }}
CMH_GENE42_SECRET: ${{ secrets.CMH_GENE42_SECRET }}
CMH_URL: ${{ secrets.CMH_URL }}
KEYCLOAK_AUTH_URL: ${{ secrets.KEYCLOAK_AUTH_URL }}
KEYCLOAK_REALM: ${{ secrets.KEYCLOAK_REALM }}
KEYCLOAK_CLIENT_ID: ${{ secrets.KEYCLOAK_CLIENT_ID }}
Expand Down
107 changes: 1 addition & 106 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,4 @@

The One-Sided Matching Portal (OSMP) enables researchers to query patient variant and phenotype data from many different sources simultaneously. Acting as a hub connecting disparate data sources, the portal processes user queries, routes them to their respective endpoints with appropriate authorization, and amalgamates their results into a single, easily-searchable collection displayed in a user-friendly interface. By allowing researchers to search patient data from several research institutions with a single query, the OSMP can significantly speed up the process of rare disease “matching” across institutions and datasets.

## Front End

The front end is a React.js SPA bootstrapped with [create-react-app](https://github.com/facebook/create-react-app) and written in [Typescript](https://www.typescriptlang.org/). [Styled-components](https://styled-components.com/docs) is used for theming and styling. Additional component tooling provided by [storybook](https://storybook.js.org/).

### Building and editing the front end code

- from the root project directory copy the sample .env file and enter the appropriate values
- ```bash
cp .env.sample .env
```
- if this is your first time bringing up the app, install dependencies:
- ```bash
docker-compose run --rm react yarn install
```
- bring up the react app using [docker-compose](https://docs.docker.com/compose/):

- ```bash
docker-compose up react
```
- note that this will enable hot reloading.

- (optional) start the storybook server
- ```bash
docker-compose exec -i react yarn storybook
```

## Server

The back end is a node.js server built with [express](https://expressjs.com/), [Typescript](https://www.typescriptlang.org/), and [graphql](https://graphql.org/).

### Building and editing the back end code

- make sure the `.env` file exists (see above)
- if this is your first time bringing up the app, install dependencies:
- ```bash
docker-compose run --rm server yarn install
```
- bring up the server using [docker-compose](https://docs.docker.com/compose/):

- ```bash
docker-compose up server
```
- note that this will recompile the typescript and restart the server when changes are detected.

- to run the tests:
- ```bash
docker-compose run --rm server yarn test
```

### Connecting to Phenotips

The Phenotips staging instance's API endpoint is specified by the `G4RD_URL` env var. The OSMP server uses the OSMP machine account specified by `G4RD_USERNAME` and `G4RD_PASSWORD` to authenticate to the endpoint. The Phenotips staging site can be accessed in the browser by navigating to the URL specified by the `G4RD_URL` env var, using the OSMP machine account.
Phenotips API documentation can be found [here](https://help.phenotips.com/hc/en-us/articles/360048543632-Variant-Store-Add-on-REST-API).
### Building the remote test server
Apart from Phenotips, another data source for the staging instance is a Node/Express server that queries a MySQL database that has been populated wtih variants from the STAGER application database.
- make sure the `.env` file exists (see above)
- if this is your first time bringing up the app, install dependencies:
- ```bash
docker-compose run --rm test-node yarn install
```
- bring up the server using [docker-compose](https://docs.docker.com/compose/):
- ```bash
docker-compose up test-node
```
- to populate MySQL database with variants from STAGER, download this [script](https://sickkidsca.sharepoint.com/:u:/r/sites/thecenterforcomputationalmedicineworkspace/Shared%20Documents/SSMP/data/stager-local-20210716.sql?csf=1&web=1&e=fVzHIB) and run the script using one of these two options:
- MySQLWorkbench
- ```bash
docker exec -i <stager-mysql-container-name> mysql -u <env.TEST_DATA_DB_USER> --password="<env.TEST_DATA_DB_PASSWORD>" <env.TEST_DATA_DB> < <filepath>.sql
```
where the `.sql` script is on the host machine.
## Keycloak
The app uses [keycloak](https://www.keycloak.org/) as an identity provider and identity broker. Essentially, keycloak stores all user information and the app is a keycloak client. The implementation is currently in its earliest phases and documentation will be updated as the project evolves.
In the dev environment, the app uses keycloak's default h2 database for storage, though in production we'll want to use MySQL or Postgres. To set up the app client and a test user, you can use the following command on your host machine with the keycloak container running:
```bash
docker-compose exec keycloak /usr/local/bin/bootstrap-keycloak.sh
```
The keycloak admin portal can be accessed in the browser by navigating to localhost and the port specified by the `KEYCLOAK_PORT` env var, e.g., `localhost:9821`
## Mongo
Annotations can be imported into mongo using the following command. Note that that the headers should not be included in the csv and the order of the fields passed to the `fields` argument should match the order of the fields in the csv.
```bash
mongoimport --collection=annotations --type=csv \
--columnsHaveTypes \
--fields="pos.int32(),ref.string(),alt.string(),chrom.string(),nhomalt.int32(),an.int32(),af.double(),assembly.string()" \
--file=<filename>.csv \
--uri=mongodb://<env.MONGO_INITDB_ROOT_USERNAME>:<env.MONGO_INITDB_ROOT_PASSWORD>@mongo/<env.MONGO_INITDB_DATABASE>?authSource=admin
```
Then make sure to create the following indexes:
```
db.annotations.createIndexes([ {"pos": 1}, {"assembly":1}, {"alt": 1, "chrom": 1, "pos": 1, "ref": 1 } ])
```
The instructions for setting up the local development environment and a description of the staging and production instance can be found in the `docs` folder.
8 changes: 8 additions & 0 deletions docker-compose.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ services:
G4RD_GRANT_TYPE:
G4RD_TOKEN_URL:
G4RD_CLIENT_ID:
CMH_AZURE_CLIENT_ID:
CMH_AZURE_CLIENT_SECRET:
CMH_TOKEN_URL:
CMH_RESOURCE:
CMH_SCOPE:
CMH_GRANT_TYPE:
CMH_GENE42_SECRET:
CMH_URL:
KEYCLOAK_AUTH_URL:
KEYCLOAK_CLIENT_ID:
KEYCLOAK_REALM:
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ services:
G4RD_TOKEN_URL:
G4RD_URL:
G4RD_USERNAME:
CMH_AZURE_CLIENT_ID:
CMH_AZURE_CLIENT_SECRET:
CMH_TOKEN_URL:
CMH_RESOURCE:
CMH_SCOPE:
CMH_GRANT_TYPE:
CMH_GENE42_SECRET:
CMH_URL:
KEYCLOAK_AUTH_URL:
KEYCLOAK_REALM:
KEYCLOAK_CLIENT_ID: ${KEYCLOAK_SERVER_CLIENT_ID}
Expand Down
110 changes: 110 additions & 0 deletions docs/local-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Local Development Environment

## Front End

The front end is a React.js SPA bootstrapped with [create-react-app](https://github.com/facebook/create-react-app) and written in [Typescript](https://www.typescriptlang.org/). [Styled-components](https://styled-components.com/docs) is used for theming and styling. Additional component tooling is provided by [storybook](https://storybook.js.org/).

### Building and editing the front end code

- from the root project directory, copy the sample `.env` file and enter the appropriate values:
- ```bash
cp .env.sample .env
```
- if this is your first time bringing up the app, install the dependencies:
- ```bash
docker-compose run --rm react yarn install
```
- bring up the react app using [docker-compose](https://docs.docker.com/compose/):

- ```bash
docker-compose up react
```
- note that this will enable hot reloading.

- (optional) start the storybook server:
- ```bash
docker-compose exec -i react yarn storybook
```

## Server

The back end is a node.js server built with [express](https://expressjs.com/), [Typescript](https://www.typescriptlang.org/), and [graphql](https://graphql.org/).

### Building and editing the back end code

- make sure the `.env` file exists (see above)
- if this is your first time bringing up the app, install the dependencies:
- ```bash
docker-compose run --rm server yarn install
```
- bring up the server using [docker-compose](https://docs.docker.com/compose/):

- ```bash
docker-compose up server
```
- note that this will recompile the typescript and restart the server when changes are detected.

- to run the tests:
- ```bash
docker-compose run --rm server yarn test
```

### Connecting to Phenotips

The Phenotips staging instance's API endpoint is specified by the `G4RD_URL` env var. The OSMP server uses the OSMP machine account specified by `G4RD_USERNAME` and `G4RD_PASSWORD` to authenticate to the endpoint. The Phenotips staging site can be accessed in the browser by navigating to the URL specified by the `G4RD_URL` env var, using the OSMP machine account.
Phenotips API documentation can be found [here](https://help.phenotips.com/hc/en-us/articles/360048543632-Variant-Store-Add-on-REST-API).
### Building the remote test server
Apart from Phenotips, another data source for the staging instance is a Node/Express server that queries a MySQL database that has been populated wtih variants from the STAGER application database.
- make sure the `.env` file exists (see above)
- if this is your first time bringing up the app, install the dependencies:
- ```bash
docker-compose run --rm test-node yarn install
```
- bring up the server using [docker-compose](https://docs.docker.com/compose/):
- ```bash
docker-compose up test-node
```
- to populate the MySQL database with variants from STAGER, download this [script](https://sickkidsca.sharepoint.com/:u:/r/sites/thecenterforcomputationalmedicineworkspace/Shared%20Documents/SSMP/data/stager-local-20210716.sql?csf=1&web=1&e=fVzHIB) and run the script using one of these two options:
- MySQLWorkbench
- ```bash
docker exec -i <stager-mysql-container-name> mysql -u <env.TEST_DATA_DB_USER> --password="<env.TEST_DATA_DB_PASSWORD>" <env.TEST_DATA_DB> < <filepath>.sql
```
where the `.sql` script is on the host machine.
## Keycloak
The app uses [keycloak](https://www.keycloak.org/) as an identity provider and identity broker. Essentially, keycloak stores all user information and the app is a keycloak client. The implementation is currently in its earliest phases and documentation will be updated as the project evolves.
In the dev environment, the app uses keycloak's default h2 database for storage, though in production we'll want to use MySQL or Postgres. To set up the app client and a test user, you can use the following command on your host machine with the keycloak container running:
```bash
docker-compose exec keycloak /usr/local/bin/bootstrap-keycloak.sh
```
The keycloak admin portal can be accessed in the browser by navigating to localhost and the port specified by the `KEYCLOAK_PORT` env var, e.g., `localhost:9821`
## Mongo
gnomAD annotations are performed on-the-fly using MongoDB. The staging VM and production VM are connected to the MongoDB instance in the CHEO-RI tenancy. Since dev VMs are not in the CHEO-RI tenancy, they cannot connect to the MongoDB instance in the CHEO-RI tenancy. Instead, in local development, we can connect to [mongodb.ccm.sickkids.ca](mongodb.ccm.sickkids.ca) which currently only supports GRCh37 annotations and a small subset of GRCh38 annotations.
Annotations were imported into mongo using the following command. Note that that the headers should not be included in the csv and the order of the fields passed to the `fields` argument should match the order of the fields in the csv.
```bash
mongoimport --collection=annotations --type=csv \
--columnsHaveTypes \
--fields="pos.int32(),ref.string(),alt.string(),chrom.string(),nhomalt.int32(),an.int32(),af.double(),assembly.string()" \
--file=<filename>.csv \
--uri=mongodb://<env.MONGO_INITDB_ROOT_USERNAME>:<env.MONGO_INITDB_ROOT_PASSWORD>@mongo/<env.MONGO_INITDB_DATABASE>?authSource=admin
```
Then make sure to create the following indexes to optimize the query:
```
db.annotations.createIndexes([ {"pos": 1}, {"assembly":1}, {"alt": 1, "chrom": 1, "pos": 1, "ref": 1 } ])
```
9 changes: 9 additions & 0 deletions docs/production.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Production

OSMP is deployed via Docker Compose at [https://osmp.genomics4rd.ca](https://osmp.genomics4rd.ca). The key differences between the staging and production are the removal of the test node and increased memory and CPU resource allocations for the `server` container. The OSMP production instance is connected to the [production instance of G4RD Phenotips](https://phenotips.genomics4rd.ca) and to the [production instance of CMH Phenotips](https://phenotips-ga4k.cmh.edu). Similar to the staging stack, to deploy the frontend, compiled static bundles are uploaded to a designated MinIO bucket. The routing between the frontend and backend is handled by the HAProxy reverse proxy. User accounts are managed in [Keycloak](https://keycloak.genomics4rd.ca).

## Continuous deployment through Github Actions

On each commit to the `production` branch, if the changes affect the backend, a Github Actions workflow [Build, test, and deploy backend to production](https://github.com/ccmbioinfo/osmp/blob/develop/.github/workflows/node-prod.yml) is run. After the Docker image build and test stages pass, we move to the deployment stage. This stage runs on a self-hosted Actions runner that is networked with the production host, and deploys the backend to the production host.

If the changes affect the frontend, a different workflow [Build react app and deploy to production](https://github.com/ccmbioinfo/osmp/blob/develop/.github/workflows/react-prod.yml) builds the frontend, incorporating environment-specific configurations as needed, and uploads the compiled static bundles to a designated S3 (MinIO) bucket.
9 changes: 9 additions & 0 deletions docs/staging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Staging

OSMP is deployed via Docker Compose at [https://osmp.ccmdev.ca/](https://osmp.ccmdev.ca/). For G4RD data source, the OSMP staging instance is connected to the [staging instance of G4RD Phenotips](https://staging.phenotips.genomics4rd.ca) and the [staging instance of CMH Phenotips](https://phenotipstest-ga4k.cmh.edu). To deploy the frontend, compiled static bundles are uploaded to a designated MinIO bucket. The routing between the frontend and backend is handled by the HAProxy reverse proxy. User accounts are managed in [Keycloak](https://keycloak.ccmdev.ca).

## Continuous deployment through Github Actions

On each commit to the `develop` branch, if the changes affect the backend, a Github Actions workflow [Build, test, and deploy backend to staging](https://github.com/ccmbioinfo/osmp/blob/develop/.github/workflows/node.yml) is run. After the Docker image build and test stages pass, we move to the deployment stage. This stage runs on a self-hosted Actions runner that is networked with the staging host, and deploys the backend to the staging host.

If the changes affect the frontend, a different workflow [Build react app and deploy to staging](https://github.com/ccmbioinfo/osmp/blob/develop/.github/workflows/react.yml) builds the frontend, incorporating environment-specific configurations as needed, and uploads the compiled static bundles to a designated S3 (MinIO) bucket.
2 changes: 1 addition & 1 deletion react/src/apollo/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { VariantQueryResponseError } from '../types';
const GRAPHQL_URL = process.env.REACT_APP_GRAPHQL_URL;

export const buildLink = (token?: string) => {
const timeoutLink = new ApolloLinkTimeout(90_000); // 90 second timeout
const timeoutLink = new ApolloLinkTimeout(900_000); // 900 second timeout
const mygeneRestLink = new RestLink({
uri: 'https://mygene.info/v3/',
});
Expand Down
2 changes: 1 addition & 1 deletion react/src/apollo/hooks/useFetchVariantsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const fetchVariantsQuery = gql`
info {
aaChange
af
ac
cdna
consequence
geneName
gnomadHet
gnomadHom
phred
spliceAIScore
Expand Down
17 changes: 11 additions & 6 deletions react/src/components/GeneSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,14 @@ const GeneSearch: React.FC<GeneSearchProps> = ({ assembly, geneName, onChange, o
const debouncedAutocompleteFetch = useAsyncDebounce(fetchAutocompleteResults, 500);

const formatAutocompleteOptions = useCallback(
(autocompleteResults: AutocompleteResults, assembly: AssemblyId) =>
(autocompleteResults.autocompleteResults.hits || [])
.filter(hit => !!hit.ensembl && !!hit.genomic_pos && !!hit.genomic_pos_hg19)
(autocompleteResults: AutocompleteResults, assembly: AssemblyId) => {
const is38 = /38/.test(assembly);
const something = (autocompleteResults.autocompleteResults.hits || [])
.filter(
hit =>
!!hit.ensembl &&
((is38 && !!hit.genomic_pos) || (!is38 && !!hit.genomic_pos_hg19))
)
.map((hit, i) => {
const { symbol, ...rest } = hit;

Expand All @@ -71,8 +76,6 @@ const GeneSearch: React.FC<GeneSearchProps> = ({ assembly, geneName, onChange, o
genomic_pos_hg19,
};

const is38 = /38/.test(assembly);

return (is38 ? genomic_pos : genomic_pos_hg19)
.filter(g => isCanonicalRegion(g.chr))
.map((e, eid) => {
Expand All @@ -88,7 +91,9 @@ const GeneSearch: React.FC<GeneSearchProps> = ({ assembly, geneName, onChange, o
};
});
})
.flat(),
.flat();
return something;
},
[]
);

Expand Down
Loading

0 comments on commit c0630ed

Please sign in to comment.