The NCPI Portal uses a list of study ids for each platform at dashboard-source-ncpi.tsv.
This list was imported manually from the anvilproject.org repository utils directory where it is updated each time the application is started.
We can update for CRDC, BDC, AnVIL and KF in different ways.
Calls the CRDC or other APIs to retrieve the list of studies for that platform.
Add update the list of CRDC studies in the dashboard-sorce-ncpi-tsv file to mach the new studies.
There is javscript code in the anvil portal repo that can be used as an example of how to read and parse the CRDC API. This code will need to be converted to typescript. Note that we currently only list the CRDC studies that have a dbGAP phsId associated with them. The js code should show how this filtering is done.
Getting Started / Background
We now have a /files directory that contains scripts for preparing the data for the the static explorer instances. These are the ones that do not use a back end server and instead do all of the filtering on the client (e.g. ncpi-catalog, anvil-catallog). The scripts in these directories run before the application is run or built and generate files in the "out" directory under each project name.
For example to run the anvil-catalog browser locally will need to:
Make sure you have node 16.15.1 configured as the current nodejs
Pull the latest from main.
Navigate into explorer/files/ and do an npm ci
Manually create an out directory under explorer/files/ ncpi-catalog e.g. explorer/files/ ncpi-catalog/out
From explorer/files run npm run build-ncpi-db to expand the dashboard-source-ncpi.tsv into two files ncpi-plaftorm-studies.json and ncpi-platforms.json.
From /explore run npm run dev:ncpi-catalog -this should read in the json files and make the application available on localhost:3000/explore.
Note that we will also make scripts to update the other 3 platform's studies but for now lets focus on getting the CRDC one going.
BDC
BDC can be done in a very similar manner to CRDC. The AnVILProject portal code has examples in the same files as CRDC for the BDC API.
AnVIL
The AnVIL studies list is in files/anvil-catalog/out/anvil-studies.json This can be read in and we can use any study that has a dbGapId. The anvil-studies.json will be created when npm run build-anvil-db is run from the /files directory.
KF
KF has an API but this API call has a manual authentication step. @jpaten you manually did this once a while back. You need to manually call https://kf-api-fhir-service.kidsfirstdrc.org/ResearchStudy?_total=accurate then login, then download the page to a file (in out so it wont get checked into github). Then have the script import import the studies from the KF download.
Definition of Done
We have a new typescript script in the package.json under /files that can be run to update the dashboard-source-ncpi-tsv file with new items from CRDC.
We have a new typescript script in the package.json under /files that can be run to update the dashboard-source-ncpi-tsv file with new items from BDC.
We have a new typescript script in the package.json under /files that can be run to update the dashboard-source-ncpi-tsv file with new items from AnVIL.
We have a new typescript script in the package.json under /files that can be run to update the dashboard-source-ncpi-tsv file with new items from KF.
The script prints out the dbGap ids of any new studies and the count of new studies if any.
When we then run build-ncpi-db this uses any new studies from the CRDC API.
The NCPI Portal uses a list of study ids for each platform at dashboard-source-ncpi.tsv. This list was imported manually from the anvilproject.org repository utils directory where it is updated each time the application is started.
We can update for CRDC, BDC, AnVIL and KF in different ways.
For this ticket we want to create a script in the files/ncpi-catalog directory that:
There is javscript code in the anvil portal repo that can be used as an example of how to read and parse the CRDC API. This code will need to be converted to typescript. Note that we currently only list the CRDC studies that have a dbGAP phsId associated with them. The js code should show how this filtering is done.
Getting Started / Background
We now have a /files directory that contains scripts for preparing the data for the the static explorer instances. These are the ones that do not use a back end server and instead do all of the filtering on the client (e.g. ncpi-catalog, anvil-catallog). The scripts in these directories run before the application is run or built and generate files in the "out" directory under each project name.
For example to run the anvil-catalog browser locally will need to:
16.15.1
configured as the current nodejsnpm ci
out
directory under explorer/files/ ncpi-catalog e.g. explorer/files/ ncpi-catalog/outnpm run build-ncpi-db
to expand the dashboard-source-ncpi.tsv into two filesncpi-plaftorm-studies.json
andncpi-platforms.json
.npm run dev:ncpi-catalog
-this should read in the json files and make the application available onlocalhost:3000/explore
.Note that we will also make scripts to update the other 3 platform's studies but for now lets focus on getting the CRDC one going.
BDC
BDC can be done in a very similar manner to CRDC. The AnVILProject portal code has examples in the same files as CRDC for the BDC API.
AnVIL
The AnVIL studies list is in
files/anvil-catalog/out/anvil-studies.json
This can be read in and we can use any study that has a dbGapId. The anvil-studies.json will be created whennpm run build-anvil-db
is run from the /files directory.KF
KF has an API but this API call has a manual authentication step. @jpaten you manually did this once a while back. You need to manually call https://kf-api-fhir-service.kidsfirstdrc.org/ResearchStudy?_total=accurate then login, then download the page to a file (in out so it wont get checked into github). Then have the script import import the studies from the KF download.
Definition of Done
build-ncpi-db
this uses any new studies from the CRDC API.