Package: nci-cidc-cli
NCI-CIDC-CLICommand line tool for interfacing with the NCI CIDC API.SetupInstallationpip3installnci-cidc-cliUsageTo display the help message for the CLI, run:nci-cidcTo authenticate with the CIDC API, run:nci-cidclogin[token]DevelopmentFor local development, install the development dependencies:pipinstall-rrequirements.dev.txtAdmin functionsUnder the (hidden)adminare several functions meant for CIDC administators / engineers.CSMSnci-cidcadmintest-csmsA simple API hit for a test of CSMS connection. Hits API endpoint/admin/test_csmswhich in turn gets CSMS's/docs.
This tests that the API is able to successfully make connection with the CSMS, as the/docsendpoint requires authorization.
As the API endpoint is protected, only users with rolecidc-admincan make this request.dbedit suiteA set of commands to list / remove data from the database, including shipments, clinical data, and assay/analysis data.
It directly uses Google's cloud SDK to make a direct connection to the postgres cloud sql database, so it requires the user hascloudsql.instances.connectIAM permission.AuthenticationAuthentication uses Application Default Credentials (ADC). Log-in is done via:gcloudauthapplication-defaultloginConfigurationConfiguration of the environment ie staging versus production is done as above using:nci-cidcconfigget-env
nci-cidcconfigset-envENVConfiguration of the database username is done via a pair of functions:nci-cidcadminget-username
nci-cidcadminset-usernameUSERNAMEThe password is requested every time you issue a command so as to not store it.Listing dataUnder thelistsubcommand ofnci-cidc admin, you can get descriptions of the data available in the database.nci-cidc admin list clinical TRIAL_IDprints a table describing all shipments for the given trialwith the following columns:object_url,filename,num_participants,created,commentnci-cidc admin list misc-data TRIAL_IDprints a table describing all misc_data files for the given trialwith the following columns:batch_id,object_url,filename,created,descriptionnci-cidc admin list shipments TRIAL_IDprints a table describing all shipments for the given trialwith the following columns:upload_type,manifest_id,num_samples,creatednci-cidc admin list assay TRIAL_ID ASSAY_OR_ANALYSISprints a table listing all samples for the given assay/analysis and trialany of the following values are allowed:clinical_data, same asnci-cidc admin list clinical TRIAL_IDmisc_data, same asnci-cidc admin list misc-data TRIAL_IDanalyses:atacseq_analysis,cytof_analysis,rna_level1_analysis,tcr_analysis,wes_analysis,wes_analysis_old,wes_tumor_only_analysis,wes_tumor_only_analysis_oldassays:atacseq,ctdna,cytof,hande,ihc,elisa,microbiome,mif,nanostring,olink,rna,tcr,wesRemoving dataUnder theremovesubcommand ofnci-cidc admin, you can remove a wide variety of data from the JSON blobs.nci-cidc admin remove clinical TRIAL_ID TARGET_IDremoves a given clinical data file from a given trial's metadata as well as the file itself from the portalTARGET_IDis thefilenameof the clinical data to remove, as fromnci-cidc admin list clinical TRIAL_IDspecial value'*'for all files for this trialnci-cidc admin remove shipment TRIAL_ID TARGET_IDremoves a given shipment from a given trial's metadataTARGET_IDis themanifest_idof the shipment to remove, as fromnci-cidc admin list shipments TRIAL_IDnci-cidc admin remove assay TRIAL_ID ASSAY_OR_ANALYSIS TARGET_IDremoves a given clinical data file from a given trial's metadata as well as the associated files themselves from the portalforASSAY_OR_ANALYSIS=clinical_data, same asnci-cidc admin remove clinical TRIAL_ID TARGET_IDTARGET_IDis a tuple of the ids to find the data to remove, as fromnci-cidc admin list assay TRIAL_ID ASSAY_OR_ANALYSIS.It cannot go past where is divisible in the data, but can end early to remove the whole section.Namely:elisa: requires onlyassay_run_idmisc_data,olink: requirebatch_idwith an optionalfilenamenanostring: requiresbatch_idand optionalrun_idrna_level1_analysis,wes_tumor_only_analysis,wes_tumor_only_analysis_old: requires onlycimac_idwes_analysis,wes_analysis_old: requires onlyrun_idotherwise: requiresbatch_idand optionalcimac_id