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

CI for variant calling via Github Actions and CIEVaD #75

Merged
merged 48 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
fac660c
new CI fundamental test
Krannich479 Apr 23, 2024
a28896a
the yaml grind chapter 1
Krannich479 Apr 23, 2024
f62be3b
the yaml grind chapter 2
Krannich479 Apr 23, 2024
921279e
the yaml grind chapter 3
Krannich479 Apr 23, 2024
ebf4b7b
the yaml grind chapter 4
Krannich479 Apr 23, 2024
c36487d
the yaml grind chapter 5
Krannich479 Apr 23, 2024
2db097a
CI test cievad hap.nf
Krannich479 Apr 23, 2024
88a6e6d
CI test hap.nf
Krannich479 Apr 23, 2024
06c3738
manage deploy key for private repo access
Krannich479 Apr 23, 2024
c3b2323
try SSH clone
Krannich479 Apr 23, 2024
f9e8392
Add reference to CI
Krannich479 Apr 23, 2024
7eb2bd2
CI split and download and run of cievad
Krannich479 Apr 23, 2024
5cf823b
CI test unix variables across tasks
Krannich479 Apr 23, 2024
429350e
-
Krannich479 Apr 23, 2024
bb03c64
CI try run CovPipe2 on simulated data
Krannich479 Apr 23, 2024
d4c4283
CI retry with reformat
Krannich479 Apr 23, 2024
a5aef6d
CI use CoVpipe2 version of auto-checkout
Krannich479 Apr 23, 2024
d982643
CI inspect results
Krannich479 Apr 23, 2024
82182ce
CI cievad eval
Krannich479 Apr 23, 2024
da96a14
tiny fix
Krannich479 Apr 23, 2024
a21614b
CI add ref to eval call
Krannich479 Apr 23, 2024
2dc9893
CI check cievad results
Krannich479 Apr 23, 2024
1a8fa1c
CI check folder structure
Krannich479 Apr 23, 2024
262f9ec
CI better symbolic links
Krannich479 Apr 24, 2024
c7b493e
CI debug
Krannich479 Apr 24, 2024
335c584
CI trying to fix dependencies
Krannich479 Apr 24, 2024
e59ddc0
test1 for auto-badge generation
Krannich479 Apr 26, 2024
b44b618
CI badge test pt2
Krannich479 Apr 26, 2024
6e3a5de
CI badge test part3
Krannich479 Apr 26, 2024
7ae5185
Update README.md
Krannich479 Apr 26, 2024
f1b9a24
Update VariantCalling.yml
Krannich479 May 16, 2024
d643aee
Update VariantCalling.yml
Krannich479 May 16, 2024
330f218
Update README.md
Krannich479 May 16, 2024
074bcca
Update VariantCalling.yml
Krannich479 May 16, 2024
2fa3e14
Update DryRun.yml
Krannich479 May 16, 2024
814a63c
Update pytest_workflows.yml
Krannich479 May 16, 2024
027d82f
Update README.md
Krannich479 May 24, 2024
5a9b3c5
Remove ssh-key requirement from CI
Krannich479 May 29, 2024
afb70c8
Update git clone strategy
Krannich479 May 29, 2024
a4f5d09
Update VariantCalling.yml
Krannich479 May 29, 2024
dbc68b0
Remove external badge creation (via schneegans)
Krannich479 May 29, 2024
8846d32
Update VariantCalling.yml
Krannich479 May 29, 2024
84e93bc
Update VariantCalling.yml
Krannich479 May 29, 2024
c033596
Update VariantCalling.yml
Krannich479 May 29, 2024
fbc606a
Merge branch 'rki-mf1:main' into main
Krannich479 May 29, 2024
1cdc24c
revert CI changes in previous tests; new status badge for variant cal…
Krannich479 May 29, 2024
2fdbdba
Update VariantCalling.yml
Krannich479 Jun 10, 2024
c92dead
Update README.md
Krannich479 Jun 12, 2024
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
140 changes: 140 additions & 0 deletions .github/workflows/VariantCalling.yml
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it make sense to upload result files from CIEVaD as artifacts? 🤔

I saw it at the lining CI at nf-core:
https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/.github/workflows/linting.yml#L60-L68

and I have it here to check results, when the test failed:
https://github.com/rki-mf1/CoVpipe2/blob/main/.github/workflows/pytest_workflows.yml#L58-L68

Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: VariantCallingBenchmark

on:
push:
branches: ["main", "dev", "ci"]
pull_request:
branches: ["main"]

jobs:
VariantCallingBenchmark:
name: CIEVaD benchmarks
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
channels: bioconda,conda-forge,defaults
channel-priority: true
auto-activate-base: true

- name: Check conda installation
run: |
conda info
conda list
conda config --show-sources
conda config --show

- name: Install nextflow
run: |
conda install -c bioconda nextflow
nextflow -version

- name: Check CovPipe2 presence
run: nextflow run CoVpipe2.nf --help

- name: Git checkout CIEVaD + REF
run: |
git clone https://github.com/rki-mf1/cievad.git
pushd cievad
nextflow run hap.nf --help
nextflow run eval.nf --help
wget https://www.ebi.ac.uk/ena/browser/api/fasta/MN908947.3
sed 's/>ENA|MN908947|MN908947.3 Severe acute respiratory syndrome coronavirus 2 isolate Wuhan-Hu-1, complete genome./>MN908947.3/g' MN908947.3 > MN908947.3.fasta
popd

- name: Run CIEVaD hap
run: |
pushd cievad
nextflow run hap.nf -profile local,conda --reference MN908947.3.fasta
ls -la results/simulated_hap*NGSWGS*.fastq
popd

- name: Run CovPipe2
run: |
# BECAUSE CIEVAD'S DEFAULT IS N=3 SAMPLES
NB_SAMPLES=3
echo "sample,fastq_1,fastq_2" > samplesheet.csv
for s in $(seq 1 $NB_SAMPLES); do echo "hap${s},cievad/results/simulated_hap${s}.NGSWGS.R1.fastq,cievad/results/simulated_hap${s}.NGSWGS.R2.fastq" >> samplesheet.csv; done
cat samplesheet.csv
nextflow run CoVpipe2.nf \
-profile local,conda \
-w work \
--output results \
--reference 'sars-cov-2' \
--fastq samplesheet.csv --list \
--primer_version V3

- name: Prep CIEVaD input
run: |
NB_SAMPLES=3
mkdir -p cievad/callsets
for s in $(seq 1 $NB_SAMPLES); do ln -sr results/03-Variant-Calling/hap${s}/hap${s}.filtered.gt_adjust.filtered_indels.vcf.gz cievad/callsets/callset_${s}.vcf.gz; done

- name: Run CIEVaD eval
run: |
pushd cievad
tree .
nextflow run eval.nf -profile local,conda --callsets_dir callsets --reference MN908947.3.fasta
tree results
popd

- name: Create Badge variable for average indel F1-score # in personal (non-organisational) git repos the score can be visualized via schneegans' dynamic badge action
run: |
INDELS_AVG_F1=$(cut -f 2,21 -d ',' cievad/results/summary.sompy.stats.csv | grep "indels" | sed 's/indels,//g')
INDELS_AVG_F1_ABS=$(echo $INDELS_AVG_F1*100 | bc)
INDELS_AVG_F1_INT=$(echo $INDELS_AVG_F1_ABS | cut -f 1 -d '.')
echo "INDELS_SCORE=$INDELS_AVG_F1_INT" >> $GITHUB_ENV
echo $INDELS_AVG_F1_ABS
echo $INDELS_AVG_F1_INT
if [ "$INDELS_AVG_F1_INT" -lt 91 ]; then
echo "Indels benchmark value decreased since last test! Exiting with status 1."
exit 1
else
echo "Indels benchmark did not drop since last test."
fi

#- name: Create Indels Badge
# uses: schneegans/[email protected]
# with:
# auth: ${{ secrets.GIST_SECRET_CIEVAD_GH_ACTIONS }}
# gistID: 4a0fffafb6e8969ddb31b3100926e9cf
# filename: cievad_covpipe2_indels.json # Use test.svg if you want to use the SVG mode.
# namedLogo: GitHub
# label: Indels F1-score
# message: ${{ env.INDELS_SCORE }}%
# valColorRange: ${{ env.INDELS_SCORE }}
# minColorRange: 0
# maxColorRange: 100

- name: Create Badge variable for average SNV F1-score
run: |
SNV_AVG_F1=$(cut -f 2,21 -d ',' cievad/results/summary.sompy.stats.csv | grep "SNVs" | sed 's/SNVs,//g')
SNV_AVG_F1_ABS=$(echo $SNV_AVG_F1*100 | bc)
SNV_AVG_F1_INT=$(echo $SNV_AVG_F1_ABS | cut -f 1 -d '.')
echo "SNV_SCORE=$SNV_AVG_F1_INT" >> $GITHUB_ENV
echo $SNV_AVG_F1_ABS
echo $SNV_AVG_F1_INT
if [ "$SNV_AVG_F1_INT" -lt 96 ]; then
echo "SNV benchmark value decreased since last test! Exiting with status 1."
exit 1
else
echo "SNV benchmark did not drop since last test."
fi

#- name: Create SNV Badge
# uses: schneegans/[email protected]
# with:
# auth: ${{ secrets.GIST_SECRET_CIEVAD_GH_ACTIONS }}
# gistID: 87db7a851147867bc3e8857dc643dd15
# filename: cievad_covpipe2_SNV.json # Use test.svg if you want to use the SVG mode.
# namedLogo: GitHub
# label: SNV F1-score
# message: ${{ env.SNV_SCORE }}%
# valColorRange: ${{ env.SNV_SCORE }}
# minColorRange: 0
# maxColorRange: 100
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
[![run with docker](https://img.shields.io/badge/run%20with-docker-0db7ed?labelColor=000000&logo=docker)](https://www.docker.com/)
[![run with singularity](https://img.shields.io/badge/run%20with-singularity-1d355c.svg?labelColor=000000)](https://sylabs.io/docs/)
![](https://img.shields.io/badge/licence-GPL--3.0-lightgrey.svg)
[![](https://img.shields.io/badge/awaiting%20peer%20review-F1000Research-ef8336.svg)](https://doi.org/10.12688/f1000research.136683.1)
[![](https://img.shields.io/badge/manuscript-F1000Research-ef8336.svg)](https://doi.org/10.12688/f1000research.136683.1)
Krannich479 marked this conversation as resolved.
Show resolved Hide resolved
[![VariantCallingBenchmark](https://github.com/rki-mf1/CoVpipe2/actions/workflows/VariantCalling.yml/badge.svg)](https://github.com/rki-mf1/CoVpipe2/actions/workflows/VariantCalling.yml)

CoVpipe2 is a Nextflow pipeline for reference-based genome reconstruction of SARS-CoV-2 from NGS data. In principle it can be used also for other viruses.

Expand Down