From 583fb28b14ee08a2c0763e56d49a162a46c75bcd Mon Sep 17 00:00:00 2001 From: Moshiko Raboh <86309179+mosheraboh@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:35:11 +0200 Subject: [PATCH 1/7] Create python-publish.yml --- .github/workflows/python-publish.yml | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..82f8dbd --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,70 @@ +# This workflow will upload a Python Package to PyPI when a release is created +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + release-build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Build release distributions + run: | + # NOTE: put your own distribution build steps here. + python -m pip install build + python -m build + + - name: Upload distributions + uses: actions/upload-artifact@v4 + with: + name: release-dists + path: dist/ + + pypi-publish: + runs-on: ubuntu-latest + needs: + - release-build + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + + # Dedicated environments with protections for publishing are strongly recommended. + # For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules + environment: + name: pypi + # OPTIONAL: uncomment and update to include your PyPI project URL in the deployment status: + # url: https://pypi.org/p/YOURPROJECT + # + # ALTERNATIVE: if your GitHub Release name is the PyPI project version string + # ALTERNATIVE: exactly, uncomment the following line instead: + # url: https://pypi.org/project/YOURPROJECT/${{ github.event.release.name }} + + steps: + - name: Retrieve release distributions + uses: actions/download-artifact@v4 + with: + name: release-dists + path: dist/ + + - name: Publish release distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist/ From c76d4a55dd6666387a10e1960ba488263e586894 Mon Sep 17 00:00:00 2001 From: Moshiko Raboh <86309179+mosheraboh@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:38:08 +0200 Subject: [PATCH 2/7] Create manual.yml --- .github/workflows/manual.yml | 90 ++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/manual.yml diff --git a/.github/workflows/manual.yml b/.github/workflows/manual.yml new file mode 100644 index 0000000..074054b --- /dev/null +++ b/.github/workflows/manual.yml @@ -0,0 +1,90 @@ +name: GitHub Clone Count Update Everyday + +on: + schedule: + - cron: "0 */24 * * *" + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: gh login + run: echo "${{ secrets.SECRET_TOKEN }}" | gh auth login --with-token + + - name: parse latest clone count + run: | + curl --user "${{ github.actor }}:${{ secrets.SECRET_TOKEN }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/${{ github.repository }}/traffic/clones \ + > clone.json + + - name: create gist and download previous count + id: set_id + run: | + if gh secret list | grep -q "GIST_ID" + then + echo "GIST_ID found" + echo "GIST=${{ secrets.GIST_ID }}" >> $GITHUB_OUTPUT + curl https://gist.githubusercontent.com/${{ github.actor }}/${{ secrets.GIST_ID }}/raw/clone.json > clone_before.json + if cat clone_before.json | grep '404: Not Found'; then + echo "GIST_ID not valid anymore. Creating another gist..." + gist_id=$(gh gist create clone.json | awk -F / '{print $NF}') + echo $gist_id | gh secret set GIST_ID + echo "GIST=$gist_id" >> $GITHUB_OUTPUT + cp clone.json clone_before.json + git rm --ignore-unmatch CLONE.md + fi + else + echo "GIST_ID not found. Creating a gist..." + gist_id=$(gh gist create clone.json | awk -F / '{print $NF}') + echo $gist_id | gh secret set GIST_ID + echo "GIST=$gist_id" >> $GITHUB_OUTPUT + cp clone.json clone_before.json + fi + + - name: update clone.json + run: | + curl https://raw.githubusercontent.com/MShawon/github-clone-count-badge/master/main.py > main.py + python3 main.py + + - name: Update gist with latest count + run: | + content=$(sed -e 's/\\/\\\\/g' -e 's/\t/\\t/g' -e 's/\"/\\"/g' -e 's/\r//g' "clone.json" | sed -E ':a;N;$!ba;s/\r{0,1}\n/\\n/g') + echo '{"description": "${{ github.repository }} clone statistics", "files": {"clone.json": {"content": "'"$content"'"}}}' > post_clone.json + curl -s -X PATCH \ + --user "${{ github.actor }}:${{ secrets.SECRET_TOKEN }}" \ + -H "Content-Type: application/json" \ + -d @post_clone.json https://api.github.com/gists/${{ steps.set_id.outputs.GIST }} > /dev/null 2>&1 + + if [ ! -f CLONE.md ]; then + shields="https://img.shields.io/badge/dynamic/json?color=success&label=Clone&query=count&url=" + url="https://gist.githubusercontent.com/${{ github.actor }}/${{ steps.set_id.outputs.GIST }}/raw/clone.json" + repo="https://github.com/MShawon/github-clone-count-badge" + echo ''> CLONE.md + echo ' + **Markdown** + + ```markdown' >> CLONE.md + echo "[![GitHub Clones]($shields$url&logo=github)]($repo)" >> CLONE.md + echo ' + ``` + + **HTML** + ```html' >> CLONE.md + echo "GitHub Clones" >> CLONE.md + echo '```' >> CLONE.md + + git add CLONE.md + git config --global user.name "GitHub Action" + git config --global user.email "action@github.com" + git commit -m "create clone count badge" + fi + + - name: Push + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.GITHUB_TOKEN }} From ce00b9e0cd2a0390128f0a58853792282f0f17c3 Mon Sep 17 00:00:00 2001 From: Moshiko Raboh <86309179+mosheraboh@users.noreply.github.com> Date: Sun, 8 Dec 2024 09:40:25 +0200 Subject: [PATCH 3/7] Rename manual.yml to clone.yml --- .github/workflows/{manual.yml => clone.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{manual.yml => clone.yml} (100%) diff --git a/.github/workflows/manual.yml b/.github/workflows/clone.yml similarity index 100% rename from .github/workflows/manual.yml rename to .github/workflows/clone.yml From c756de0e2aec9db1c5941a325f2808de44f02295 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 8 Dec 2024 07:51:34 +0000 Subject: [PATCH 4/7] create clone count badge --- CLONE.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 CLONE.md diff --git a/CLONE.md b/CLONE.md new file mode 100644 index 0000000..365f6c6 --- /dev/null +++ b/CLONE.md @@ -0,0 +1,13 @@ + + + **Markdown** + + ```markdown +[![GitHub Clones](https://img.shields.io/badge/dynamic/json?color=success&label=Clone&query=count&url=https://gist.githubusercontent.com/mosheraboh/519a49d9073e04d2cc98dc7bb5805677/raw/clone.json&logo=github)](https://github.com/MShawon/github-clone-count-badge) + + ``` + + **HTML** + ```html +GitHub Clones +``` From 6ba5a3feabe8235f8342db05fde358f44df749ff Mon Sep 17 00:00:00 2001 From: Moshiko Raboh <86309179+mosheraboh@users.noreply.github.com> Date: Mon, 9 Dec 2024 08:20:32 +0200 Subject: [PATCH 5/7] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5ff3f46..fd795a4 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +![PyPI Downloads](https://static.pepy.tech/badge/biomed-multi-view) +[![GitHub Clones](https://img.shields.io/badge/dynamic/json?color=success&label=Clone&query=count&url=https://gist.githubusercontent.com/mosheraboh/519a49d9073e04d2cc98dc7bb5805677/raw/clone.json&logo=github)](https://github.com/MShawon/github-clone-count-badge) + + # Introduction This repository contains the implementation of the Multi-view Molecular Embedding with Late Fusion (MMELON) architecture presented in our preprint [Multi-view biomedical foundation models for molecule-target and property prediction](https://arxiv.org/abs/2410.19704). MMELON is a flexible approach to aggregate multiple views (sequence, image, graph) of molecules in a foundation model setting. While models based on single view representation typically performs well on some downstream tasks and not others, the multi-view model performs robustly across a wide range of property prediction tasks encompassing ligand-protein binding, molecular solubility, metabolism and toxicity. It has been applied to screen compounds against a large (> 100 targets) set of G Protein-Coupled receptors (GPCRs) to identify strong binders for 33 targets related to Alzheimer’s disease, which are validated through structure-based modeling and identification of key binding motifs. From d12eba04bf0c539bfb03db5129ca363811eadbd4 Mon Sep 17 00:00:00 2001 From: Moshiko Raboh <86309179+mosheraboh@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:30:05 +0200 Subject: [PATCH 6/7] comment out downloads --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index fd795a4..34155a8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![PyPI Downloads](https://static.pepy.tech/badge/biomed-multi-view) + [![GitHub Clones](https://img.shields.io/badge/dynamic/json?color=success&label=Clone&query=count&url=https://gist.githubusercontent.com/mosheraboh/519a49d9073e04d2cc98dc7bb5805677/raw/clone.json&logo=github)](https://github.com/MShawon/github-clone-count-badge) From 74a83258f04af5fb207cba48ff27205af1569148 Mon Sep 17 00:00:00 2001 From: Moshiko Raboh <86309179+mosheraboh@users.noreply.github.com> Date: Wed, 11 Dec 2024 17:26:00 +0200 Subject: [PATCH 7/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34155a8..cd0dc96 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +[![PyPI Downloads](https://static.pepy.tech/badge/biomed-multi-view)](https://pepy.tech/projects/biomed-multi-view) [![GitHub Clones](https://img.shields.io/badge/dynamic/json?color=success&label=Clone&query=count&url=https://gist.githubusercontent.com/mosheraboh/519a49d9073e04d2cc98dc7bb5805677/raw/clone.json&logo=github)](https://github.com/MShawon/github-clone-count-badge)