Skip to content

Merge pull request #200 from oncokb/dependabot/pip/requirements/reque… #106

Merge pull request #200 from oncokb/dependabot/pip/requirements/reque…

Merge pull request #200 from oncokb/dependabot/pip/requirements/reque… #106

# This workflow will install Python dependencies, run annotation against the master annotation for a particular study
name: Compare Genomic Change Annotation
on:
push:
branches:
- master
- next-minor-release
pull_request:
branches:
- master
- next-minor-release
jobs:
build:
if: github.repository == 'oncokb/oncokb-annotator'
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r requirements/common.txt -r requirements/pip3.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Annotate
id: annotate
env:
ONCOKB_API_TOKEN: ${{ secrets.ONCOKB_BOT_API_TOKEN }}
ONCOKB_OAUTH_TOKEN: ${{ secrets.ONCOKB_OAUTH_TOKEN }}
run: |
git checkout -b compare
MUTATION_DATA_NAME=data_mutations_mskcc.txt
CLINICAL_DATA_NAME=data_clinical_sample.txt
cd data
curl -s -H "Authorization: token ${ONCOKB_OAUTH_TOKEN}" https://api.github.com/repos/knowledgesystems/oncokb-data/contents/annotation/annotator-test/data | jq -r '.[] | .download_url + " " + .name' | while IFS=' ' read -r downloadurl name; do
if [[ "$name" == "$MUTATION_DATA_NAME" || "$name" == "$CLINICAL_DATA_NAME" ]]; then
curl -s "$downloadurl" -o $name
fi
done
cd ..
# create compare folder to add all annotated files
mkdir compare
OGCMAF=oncokb_genomic_change_$MUTATION_DATA_NAME
python MafAnnotator.py -i data/$MUTATION_DATA_NAME -o compare/$OGCMAF -c data/$CLINICAL_DATA_NAME -b $ONCOKB_API_TOKEN -q Genomic_Change
git config user.name oncokb-bot
git config user.email dev.oncokb@gmail.com
git add .
git commit -m 'add analysis'
echo "::set-output name=FILE_NAME::$OGCMAF"
- name: Compare annotation result with the ones from master
id: compare
env:
FILE_NAME: ${{steps.annotate.outputs.FILE_NAME}}
ONCOKB_OAUTH_TOKEN: ${{ secrets.ONCOKB_OAUTH_TOKEN }}
run: |
# remove everything under compare folder and replace wiht the ones from oncokb-data
rm -f compare/*.txt
cd compare
curl -s -H "Authorization: token ${ONCOKB_OAUTH_TOKEN}" https://api.github.com/repos/knowledgesystems/oncokb-data/contents/annotation/annotator-test/annotation | jq -r '.[] | .download_url + " " + .name' | while IFS=' ' read -r downloadurl name; do
if [[ "$name" == "$FILE_NAME" ]]; then
curl -s "$downloadurl" -o $name
fi
done
cd ..
# compare
CHANGED=$(git diff --name-only HEAD --)
if [ -n "$CHANGED" ]
then
git diff
exit 1
fi