-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #133 from oncokb/update-annotation-action
Split github action for annotation tests
- Loading branch information
Showing
3 changed files
with
100 additions
and
8 deletions.
There are no files selected for viewing
93 changes: 93 additions & 0 deletions
93
.github/workflows/compare-genomic-change-study-annotation.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# This workflow will install Python dependencies, run annotation against the master annotation for a particular study | ||
|
||
name: Compare Study Genomic Change Annotation | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
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 msk_impact_2017 study | ||
id: annotate | ||
env: | ||
ONCOKB_API_TOKEN: ${{ secrets.ONCOKB_BOT_API_TOKEN }} | ||
ONCOKB_OAUTH_TOKEN: ${{ secrets.ONCOKB_OAUTH_TOKEN }} | ||
run: | | ||
git checkout -b compare | ||
STUDY=msk_impact_2017 | ||
DATAHUB_URL=https://media.githubusercontent.com/media/cBioPortal/datahub/42afc279efb8d9104aba36fa35bad3ec41921949/public/$STUDY | ||
MUTATION_DATA_NAME=data_mutations_extended.txt | ||
CLINICAL_DATA_NAME=data_clinical_sample.txt | ||
cd data | ||
curl -s $DATAHUB_URL/$MUTATION_DATA_NAME -O | ||
curl -s $DATAHUB_URL/$CLINICAL_DATA_NAME -O | ||
cd .. | ||
# create compare folder to add all annotated files | ||
mkdir compare | ||
PREFIX=oncokb | ||
OGCMAF="$PREFIX"_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=STUDY::$STUDY" | ||
echo "::set-output name=FILE_NAME::$OGCMAF" | ||
- name: Compare annotation result with the ones from master | ||
id: compare | ||
env: | ||
STUDY: ${{steps.annotate.outputs.STUDY}} | ||
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/$STUDY | 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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters