Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: gene essentiality workflow #675

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/commentsFromTests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This PR has been [automatically tested with GH Actions](https://github.com/SysBioChalmers/Human-GEM/actions/runs/{GH_ACTION_RUN}). Here is the output of the gene essentiality test:

<pre>
{TEST_RESULTS}
</pre>

> _Note: In the case of multiple test runs, this post will be edited._
32 changes: 32 additions & 0 deletions .github/workflows/gene-essentiality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check gene essentiality with Hart 2015

on:
pull_request:
branches:
- "main"
mihai-sysbio marked this conversation as resolved.
Show resolved Hide resolved

jobs:
check-metabolictasks:
runs-on: self-hosted

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Run gene essentiality
id: essentiality
run: |
TEST_RESULTS=$(/usr/local/bin/matlab -nodisplay -nosplash -nodesktop -r "ihuman = importYaml('Human-GEM.yml'); taskStruct = parseTaskList('data/metabolicTasks/metabolicTasks_Essential.txt'); eGenes = estimateEssentialGenes(ihuman, 'Hart2015_RNAseq.txt', taskStruct); disp(evaluateHart2015Essentiality(eGenes));" | awk 'NR>9 && !/^\.+/')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haowang-bioinfo the output of this line is very hard to capture/use. Do you have any suggestions to make this output more compact?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As seen in this workflow run, the output is way too rich to fit in a PR comment. @haowang-bioinfo how would you suggest to change it to end up with a nice summary like here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, I've never thought about this. Because they are non-binary indicators that are hard to be used for evaluating purpose in actions

PARSED_RESULTS="${TEST_RESULTS//'%'/'%25'}"
PARSED_RESULTS="${PARSED_RESULTS//$'\n'/'<br>'}"
PARSED_RESULTS="${PARSED_RESULTS//$'\r'/'<br>'}"
echo "results=$PARSED_RESULTS" >> $GITHUB_OUTPUT

- name: Post comment
uses: NejcZdovc/comment-pr@v2
with:
file: "commentsFromTests.md"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
TEST_RESULTS: ${{steps.essentiality.outputs.results}}
GH_ACTION_RUN: ${{github.run_id}}