diff --git a/modules/generate_tmb.nf b/modules/generate_tmb.nf index e69de29..936f40c 100644 --- a/modules/generate_tmb.nf +++ b/modules/generate_tmb.nf @@ -0,0 +1,26 @@ + +params.release_folder_synid = 'syn62069187' + +process generate_tmb { + // container 'sagebionetworks/genie-tmb' + container 'test' + secret 'SYNAPSE_AUTH_TOKEN' + + input: + val previous + // val release + val release_folder_synid + val production + + output: + stdout + + script: + """ + /tmb/generate_tmb.sh $release_folder_synid + """ +} + +workflow { + generate_tmb('test', params.release_folder_synid, 'test') +} \ No newline at end of file diff --git a/scripts/tmb/Dockerfile b/scripts/tmb/Dockerfile new file mode 100644 index 0000000..b44f91d --- /dev/null +++ b/scripts/tmb/Dockerfile @@ -0,0 +1,10 @@ +FROM ghcr.io/sage-bionetworks/synapsepythonclient:v4.6.1 + +WORKDIR /tmb + +COPY requirements.txt requirements.txt +COPY generate_tmb.sh generate_tmb.sh + +RUN pip install -r requirements.txt + +ADD https://raw.githubusercontent.com/cBioPortal/datahub-study-curation-tools/refs/heads/master/tmb/calculate_tmb/calc_nonsyn_tmb.py ./calc_nonsyn_tmb.py \ No newline at end of file diff --git a/scripts/tmb/README.md b/scripts/tmb/README.md new file mode 100644 index 0000000..b7601be --- /dev/null +++ b/scripts/tmb/README.md @@ -0,0 +1,29 @@ +# Calculate TMB + +1. Follow readme here: https://github.com/cBioPortal/datahub-study-curation-tools/tree/master/tmb/calculate_tmb +1. download the script and setup environment + + ``` + wget https://raw.githubusercontent.com/cBioPortal/datahub-study-curation-tools/refs/heads/master/tmb/calculate_tmb/calc_nonsyn_tmb.py + pip install -r requirements.txt + ``` + +1. Download a GENIE release (Example 17.6) + + ``` + synapse get -r --followLink syn64386356 + ``` + +1. Rename files as needed + + ``` + mv data_mutations_extended.txt data_mutations.txt + ``` + +1. Run code + + ``` + python calc_nonsyn_tmb.py -i . -p . + ``` + +1. View `tmb_output_data_clincal_sample.txt` diff --git a/scripts/tmb/generate_tmb.sh b/scripts/tmb/generate_tmb.sh new file mode 100755 index 0000000..a9041ec --- /dev/null +++ b/scripts/tmb/generate_tmb.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +release_folder_synapse_id=$1 + +synapse get -r --followLink "$release_folder_synapse_id" +mv data_mutations_extended.txt data_mutations.txt +python calc_nonsyn_tmb.py -i . -p . +synapse store tmb_output_data_clinical_sample.txt --parentId "$release_folder_synapse_id"