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

Set up Github Actions to update gene list #380

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
52 changes: 52 additions & 0 deletions .github/workflows/updating_oncokb_database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: update oncokb curated gene List

on:
schedule:
# Runs at 00:00 on the 1st day of every second month
- cron: '0 0 1 */2 *'
workflow_dispatch: {}
#run manually

jobs:
update-gene-list:
runs-on: ubuntu-latest

steps:
- name: checkout repo
uses: actions/checkout@v4
with:
ref: release-1.6.0

- name: set up python
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: installing dependencies
run:
pip install pandas

- name: fetch and update gene list
env:
TOKEN: ${{ secrets.ONCOKB_TOKEN }}
run: |
# download the database
curl -H "Authorization: Bearer $TOKEN" https://www.oncokb.org/api/v1/utils/allCuratedGenes > allCuratedGenes.json

# convert json to tsv
python -c "import pandas as pd; import datetime; df = pd.read_json('allCuratedGenes.json'); date_str = datetime.datetime.now().strftime('%Y%m%d'); df.to_csv(f'src/lib/djerba/data/{date_str}_allcuratedgenelist.tsv', sep='\t', index=False)"

# delete json file
rm allCuratedGenes.json

# replace filename in the constants.py script
awk -v new_val="ALL_CURATED_GENES = \"${date_str}_allcuratedgenelist.tsv\"" '{gsub(/ALL_CURATED_GENES = \047.*\047/, new_val)}1' src/lib/djerba/util/oncoKB/constants.py > temp && mv temp src/lib/djerba/util/oncoKB/constants.py

- name: create pull request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Update curated gene list"
branch: OncoKb_database_update
base: release-1.6.0
title: "Update curated gene list"
body: "This is an automated PR made by Github Actions to update OncoKb list of curated genes."