Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generate tmb module #26

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions modules/generate_tmb.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

params.release_folder_synid = 'syn62069187'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be redone


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')
}
10 changes: 10 additions & 0 deletions scripts/tmb/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
29 changes: 29 additions & 0 deletions scripts/tmb/README.md
Original file line number Diff line number Diff line change
@@ -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`
8 changes: 8 additions & 0 deletions scripts/tmb/generate_tmb.sh
Original file line number Diff line number Diff line change
@@ -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"