feat: gene essentiality workflow #7
Workflow file for this run
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: Check gene essentiality with Hart 2015 | |
on: | |
pull_request: | |
branches: | |
- "main" | |
- "develop" | |
jobs: | |
check-metabolictasks: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Fetch RAVEN | |
uses: actions/checkout@v4 | |
with: | |
repository: "SysBioChalmers/RAVEN" | |
path: "RAVEN" | |
- name: Run gene essentiality | |
id: essentiality | |
run: > | |
TEST_RESULTS=$(/usr/local/bin/matlab -nodisplay -nosplash -nodesktop -r | |
"warning('off', 'MATLAB:rmpath:DirNotFound'); | |
rmpath(genpath('/home/m/ecModels-dependencies/RAVEN')); | |
rmpath(genpath('/home/m/actions-runner')); | |
addpath(genpath('.')); | |
setRavenSolver('gurobi'); | |
ihuman = readYAMLmodel('model/Human-GEM.yml'); | |
taskStruct = parseTaskList('data/metabolicTasks/metabolicTasks_Essential.txt'); | |
[~, eGenes] = evalc('estimateEssentialGenes(ihuman, ''Hart2015_RNAseq.txt'', taskStruct);'); | |
output = evaluateHart2015Essentiality(eGenes); | |
fid = fopen('data/testResults/gene-essential.csv','w'); | |
fprintf(fid,[repmat('%s,',1,13) '%s\n'],transpose(output{1,:})); | |
fprintf(fid,['%s,%d,%d,%d,%d' repmat(',%.4g',1,9) '\n'],transpose(output{2:end,:})); | |
fclose(fid); | |
disp(output);" | awk 'NR>9 && !/^\.+/') && | |
PARSED_RESULTS="${TEST_RESULTS//'%'/'%25'}" && | |
PARSED_RESULTS="${PARSED_RESULTS//$'\n'/'<br>'}" && | |
PARSED_RESULTS="${PARSED_RESULTS//$'\r'/'<br>'}" && | |
echo "results=$PARSED_RESULTS" >> $GITHUB_OUTPUT | |
- name: Mention PR# in README.md | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
run: sed -i -e "s/[[:digit:]]\{3,4\}\*\* (gene /$PR_NUMBER\*\* (gene /" README.md | |
- name: Auto-commit results | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_user_name: memote-bot | |
commit_message: "chore: add gene essentiality test result" | |
file_pattern: data/testResults/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PR_NUMBER: ${{ github.event.number }} | |
- name: Post comment | |
uses: NejcZdovc/comment-pr@v2 | |
with: | |
file: "commentGeneEssential.md" | |
identifier: "GITHUB_COMMENT_GENE" | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
TEST_RESULTS: ${{steps.essentiality.outputs.results}} | |
GH_ACTION_RUN: ${{github.run_id}} |