Update Clinvar database for ANNOVAR #2377
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
name: Update Clinvar database for ANNOVAR | |
on: | |
schedule: | |
- cron: "0 3,15 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
genome: ["hg19", "hg38"] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
submodules: "true" | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirement.txt | |
- name: Update Clinvar with GRCh37 | |
if: matrix.genome == 'hg19' | |
run: | | |
cd ./update_annovar_db | |
python3 ./update_resources.py -d clinvar -w -hp ../Clinvar_build/hg19 -a ../ANNOVAR_script -g GRCh37 | |
- name: Update Clinvar with GRCh38 | |
if: matrix.genome == 'hg38' | |
run: | | |
cd ./update_annovar_db | |
python3 ./update_resources.py -d clinvar -w -hp ../Clinvar_build/hg38 -a ../ANNOVAR_script -g GRCh38 | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.genome }} | |
path: ./Clinvar_build/${{ matrix.genome }} | |
retention-days: 1 | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: clean previous build | |
run: | | |
rm -f Clinvar_build/hg19/* | |
rm -f Clinvar_build/hg38/* | |
- name: Download artifacts for GRCh37 | |
uses: actions/download-artifact@v4 | |
with: | |
name: "hg19" | |
path: ./Clinvar_build/hg19 | |
- name: Download artifacts for GRCh38 | |
uses: actions/download-artifact@v4 | |
with: | |
name: "hg38" | |
path: ./Clinvar_build/hg38 | |
- name: Commit | |
id: auto-commit-action | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GH_TOKEN }} | |
branch: master | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- name: Create Github Release | |
if: steps.auto-commit-action.outputs.changes_detected == 'true' | |
uses: actions/create-release@v1 | |
id: create_release | |
with: | |
tag_name: tag-${{ steps.date.outputs.date }} | |
release_name: release-${{ steps.date.outputs.date }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Upload assets to Github Release | |
if: steps.auto-commit-action.outputs.changes_detected == 'true' | |
uses: csexton/release-asset-action@v3 | |
with: | |
pattern: "Clinvar_build/*/*.gz" | |
github-token: ${{ secrets.GH_TOKEN }} | |
release-url: ${{ steps.create_release.outputs.upload_url }} |