dashboard_table_updater
genie.dashboard_table_updater
¶
Updates dashboard tables
Attributes¶
logger = logging.getLogger(__name__)
module-attribute
¶
Functions¶
get_center_data_completion(center, df)
¶
Gets center data completion. Calulates the percentile of how complete a clinical data element is: Number of not blank/Unknown/NA divded by total number of patients or samples
| PARAMETER | DESCRIPTION |
|---|---|
center
|
GENIE center
|
df
|
sample or patient dataframe
|
| RETURNS | DESCRIPTION |
|---|---|
Dataframe
|
Center data |
update_samples_in_release_table(syn, file_mapping, release, samples_in_release_synid)
¶
Updates the sample in release table This tracks the samples of each release. 1 means it exists, and 0 means it doesn't. For releases without a column in the sample in release table, a new release column will be created for that release.
New samples will be displayed on top of old samples (pre-existing samples already in the sample in release table) in the release column.
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
TYPE:
|
file_mapping
|
file mapping generated from file mapping function
TYPE:
|
release
|
GENIE release number (ie. 5.3-consortium)
TYPE:
|
samples_in_release_synid
|
Synapse Id of 'samples in release' Table
TYPE:
|
update_cumulative_sample_table(syn, file_mapping, release, cumulative_sample_count_synid)
¶
Consortium release sample count table update function This gets the cumulative sample count of each file type in each release
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
|
file_mapping
|
file mapping generated from file mapping function
|
release
|
GENIE release number (ie. 5.3-consortium)
|
cumulative_sample_count_synid
|
Synapse Id of 'Cumulative sample count' Table
|
update_release_numbers(syn, database_mappingdf, release=None)
¶
Updates all release dashboard numbers or specific release number
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
|
database_mappingdf
|
mapping between synapse ids and database
|
release
|
GENIE release (ie. 5.3-consortium). Defaults to None
DEFAULT:
|
update_database_numbers(syn, database_mappingdf)
¶
Updates database cumulative numbers (Only called when not staging)
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
|
database_mappingdf
|
mapping between synapse ids and database
|
update_oncotree_code_tables(syn, database_mappingdf)
¶
Updates database statistics of oncotree codes and primary onocotree codes
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
|
database_mappingdf
|
mapping between synapse ids and database
|
update_sample_difference_table(syn, database_mappingdf)
¶
Updates sample difference table between consortium releases
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
|
database_mappingdf
|
mapping between synapse ids and database
|
update_data_completeness_table(syn, database_mappingdf)
¶
Updates the data completeness of the database
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
|
database_mappingdf
|
mapping between synapse ids and database
|
update_wiki(syn, database_mappingdf)
¶
Updates the GENIE project dashboard wiki timestamp
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
|
database_mappingdf
|
mapping between synapse ids and database
|
string_to_unix_epoch_time_milliseconds(string_time)
¶
Takes dates in this format: 2018-10-25T20:16:07.959Z and turns it into unix epoch time in milliseconds
| PARAMETER | DESCRIPTION |
|---|---|
string_time
|
string in this format: 2018-10-25T20:16:07.959Z
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
int
|
unix epoch time in milliseconds
TYPE:
|
update_data_release_file_table(syn, database_mappingdf)
¶
Updates data release file table
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
|
database_mappingdf
|
mapping between synapse ids and database
|
check_column_decreases(currentdf, olderdf)
¶
Checks entity decreases
| PARAMETER | DESCRIPTION |
|---|---|
current_ent
|
Current entity dataframe
|
old_ent
|
Older entity dataframe
|
| RETURNS | DESCRIPTION |
|---|---|
|
Differences in values |
print_clinical_values_difference_table(syn, database_mappingdf)
¶
Checks for a decrease in values in the clinical file from last consortium release to most recent consortium release
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
|
database_mappingdf
|
mapping between synapse ids and database
|
run_dashboard(syn, database_mappingdf, release, staging=False, public=False)
¶
Runs the dashboard scripts
| PARAMETER | DESCRIPTION |
|---|---|
syn
|
synapse object
TYPE:
|
database_mappingdf
|
mapping between synapse ids and database
TYPE:
|
release
|
GENIE release (ie. 5.3-consortium)
TYPE:
|
public
|
whether to run for public release or not
TYPE:
|
staging
|
whether to run in staging mode or not
TYPE:
|