Database to Staging
bin.database_to_staging
¶
Workflow to trigger a consortium release
flowchart TD
A["Start consortium release"] --> B["Remove old files in GENIE release dir"]
%% B --> C["Login to Synapse"]
%% C --> D{"Test / Staging / Prod Environment?"}
%% D -->|Test| E["Set test databaseSynIdMappingId"]
%% D -->|Staging| F["Set staging databaseSynIdMappingId, skip mutations in cis"]
%% D -->|Production| G["Set production databaseSynIdMappingId"]
B --> H["Prepare for processing by getting databaseSynIdMapping table, oncotree link, cbioportal folder, database synapse ids, etc"]
%% H --> I{"Oncotree link provided?"}
%% I -->|No| J["Extract Oncotree URL from database"]
%% I -->|Yes| K["Use provided Oncotree URL"]
%% J & K --> L["Check Oncotree URL accessibility"]
%% L --> M["Validate cBioPortal path exists"]
%% M --> N["Get Synapse IDs for consortium, process tracker, etc."]
%% N --> O["Create or retrieve case_lists folder"]
%% O --> P{"Staging?"}
%% P -- No --> Q["Start process tracking"]
H --> R["Query for all the centers for which data should be released"]
%% Expanded stagingToCbio logic
%% R --> S2["Create GENIE release directory if missing"]
%% S1 --> S2["Extract Synapse Table IDs (patient, sample, maf, bed, seg, etc.)"]
R --> S3["Create snapshots & pull patient, sample, bed data"]
S3 --> S4["Merge patient + sample tables into clinicalDf"]
S4 --> S5["Run GENIE filters"]
S5 --> SD1["Variant Filters"]
SD1 --> SD2["Germline filter"]
SD1 --> SD3["MAF in BED"]
SD2 & SD3 --> SD5["List of variants to remove"]
S5 --> SE1["Sample Filters"]
SE1 --> SE2["SEQ_DATE"]
SE1 --> SE3["No Bed file"]
SE1 --> SE4["Oncotree"]
SE1 --> SE5["Mutation In Cis"]
SE2 & SE3 & SE4 & SE5 --> SE6["List of samples to remove"]
SE6 --> SS3["Merge/Filter/store clinical file"]
%% SS3 --> S6["Merge/Filter/store clinical file"]
SD5 & SS3 --> S7["Merge/Filter/store MAF file"]
SS3 --> S8["Merge/Filter/store CNA file"]
SS3 --> S9["Merge/Filter/store Assay information file"]
SS3 --> S10["Merge/Filter/store SV file"]
S8 & S7 & S9 & S10 --> S11["Merge/Filter/store Data Gene Matrix"]
S11 --> S12["Download and upload gene panel files"]
SS3 --> S13["Merge/Filter/store SEG file"]
SS3 --> S14["Merge/Filter/store BED files"]
%% SS3 --> S15["Return list of gene panel entities"]
SS3 & S12 & S13 & S14 --> T["Remove old case list files"]
T --> U["Generate new case lists and upload to Synapse"]
U --> V["Revise metadata files with correct GENIE version"]
V --> W["Run cBioPortal validation script"]
%% W --> X{"Production?"}
%% X -->|Yes| Y["Upload validation logs to Synapse"]
W --> Z["Create release folder with links to files"]
%% Z --> AA{"Production?"}
%% AA -->|Yes| AB["End process tracking"]
Z --> AC["Run dashboard updater"]
AC --> AD["Generate dashboard HTML"]
AD --> AF["End"]
Attributes¶
logger = logging.getLogger(__name__)
module-attribute
¶
PWD = os.path.dirname(os.path.abspath(__file__))
module-attribute
¶
parser = argparse.ArgumentParser(description='Release GENIE consortium files')
module-attribute
¶
test_group = parser.add_mutually_exclusive_group()
module-attribute
¶
args = parser.parse_args()
module-attribute
¶
Functions¶
generate_dashboard_html(genie_version, staging=False)
¶
Generates dashboard html writeout that gets uploaded to the release folder
PARAMETER | DESCRIPTION |
---|---|
genie_version
|
GENIE release
|
staging
|
Use staging files. Default is False
DEFAULT:
|
Source code in bin/database_to_staging.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
generate_data_guide(genie_version, oncotree_version=None, database_mapping=None)
¶
Generates the GENIE data guide
Source code in bin/database_to_staging.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
|
main(genie_version, processing_date, cbioportal_path, oncotree_link=None, consortium_release_cutoff=184, test=False, staging=False, debug=False, skip_mutationsincis=False)
¶
- Does parameter checks
- Updates process tracking start
- initiates database to staging
- create case lists
- revise meta files
- run cBioPortal validation
- create link versions
- update process tracking end
- Create dashboard tables and plots
PARAMETER | DESCRIPTION |
---|---|
genie_version
|
GENIE version,
|
processing_date
|
processing date
|
cbioportal_path
|
Path to cbioportal validator
|
oncotree_link
|
Link to oncotree codes
DEFAULT:
|
consortium_release_cutoff
|
release cut off value in days
DEFAULT:
|
test
|
Test flag, uses test databases
DEFAULT:
|
staging
|
Staging flag, uses staging databases
DEFAULT:
|
debug
|
Synapse debug flag
DEFAULT:
|
skip_mutationsincis
|
Skip mutation in cis filter
DEFAULT:
|
Source code in bin/database_to_staging.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
|