From 0214d877a3673e148adac1576264c966f840a9a1 Mon Sep 17 00:00:00 2001 From: oncokb-bot Date: Fri, 12 Nov 2021 09:14:55 -0600 Subject: [PATCH] Update annotation tests to use the latest data --- ...-annotation.yml => compare-annotation.yml} | 28 +++++++++--------- ... => compare-genomic-change-annotation.yml} | 29 +++++++++---------- 2 files changed, 27 insertions(+), 30 deletions(-) rename .github/workflows/{compare-study-annotation.yml => compare-annotation.yml} (79%) rename .github/workflows/{compare-genomic-change-study-annotation.yml => compare-genomic-change-annotation.yml} (76%) diff --git a/.github/workflows/compare-study-annotation.yml b/.github/workflows/compare-annotation.yml similarity index 79% rename from .github/workflows/compare-study-annotation.yml rename to .github/workflows/compare-annotation.yml index 3b11af0..465c34b 100644 --- a/.github/workflows/compare-study-annotation.yml +++ b/.github/workflows/compare-annotation.yml @@ -1,11 +1,14 @@ -# This workflow will install Python dependencies, run annotation against the master annotation for a particular study +# This workflow will install Python dependencies, run annotation against the master annotation -name: Compare Study Annotation +name: Compare Annotation on: push: branches: - master + pull_request: + branches: + - master jobs: build: if: github.repository == 'oncokb/oncokb-annotator' @@ -27,7 +30,7 @@ jobs: 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 + - name: Annotate id: annotate env: ONCOKB_API_TOKEN: ${{ secrets.ONCOKB_BOT_API_TOKEN }} @@ -35,19 +38,17 @@ jobs: 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 + MUTATION_DATA_NAME=data_mutations_mskcc.txt CLINICAL_DATA_NAME=data_clinical_sample.txt FUSION_DATA_NAME=data_fusions.txt CNA_DATA_NAME=data_CNA.txt cd data || exit - curl -s "$DATAHUB_URL"/"$MUTATION_DATA_NAME" -O - curl -s "$DATAHUB_URL"/"$CLINICAL_DATA_NAME" -O - curl -s "$DATAHUB_URL"/"$FUSION_DATA_NAME" -O - curl -s "$DATAHUB_URL"/"$CNA_DATA_NAME" -O + 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" == "$FIEL_NAME_PREFIX"* ]]; then + curl -s "$downloadurl" -o $name + fi + done cd .. # create compare folder to add all annotated files @@ -77,12 +78,9 @@ jobs: git add . git commit -m 'add analysis' - echo "::set-output name=STUDY::$STUDY" - - name: Compare annotation result with the ones from master id: compare env: - STUDY: ${{steps.annotate.outputs.STUDY}} ONCOKB_OAUTH_TOKEN: ${{ secrets.ONCOKB_OAUTH_TOKEN }} FIEL_NAME_PREFIX: 'oncokb_data' run: | @@ -90,7 +88,7 @@ jobs: rm -f compare/*.txt cd compare || exit - 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 + 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" == "$FIEL_NAME_PREFIX"* ]]; then curl -s "$downloadurl" -o $name fi diff --git a/.github/workflows/compare-genomic-change-study-annotation.yml b/.github/workflows/compare-genomic-change-annotation.yml similarity index 76% rename from .github/workflows/compare-genomic-change-study-annotation.yml rename to .github/workflows/compare-genomic-change-annotation.yml index 363979b..43572d8 100644 --- a/.github/workflows/compare-genomic-change-study-annotation.yml +++ b/.github/workflows/compare-genomic-change-annotation.yml @@ -1,11 +1,14 @@ # This workflow will install Python dependencies, run annotation against the master annotation for a particular study -name: Compare Study Genomic Change Annotation +name: Compare Genomic Change Annotation on: push: branches: - master + pull_request: + branches: + - master jobs: build: if: github.repository == 'oncokb/oncokb-annotator' @@ -27,7 +30,7 @@ jobs: 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 + - name: Annotate id: annotate env: ONCOKB_API_TOKEN: ${{ secrets.ONCOKB_BOT_API_TOKEN }} @@ -35,23 +38,21 @@ jobs: 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 + MUTATION_DATA_NAME=data_mutations_mskcc.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 + 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 - PREFIX=oncokb - - OGCMAF="$PREFIX"_genomic_change_$MUTATION_DATA_NAME + 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 @@ -61,13 +62,11 @@ jobs: 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: | @@ -75,7 +74,7 @@ jobs: 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 + 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 @@ -90,4 +89,4 @@ jobs: git diff exit 1 fi - + \ No newline at end of file