Skip to content

Commit

Permalink
Merge pull request nf-core#115 from JoseEspinosa/updates
Browse files Browse the repository at this point in the history
Add pipeline level ci
  • Loading branch information
JoseEspinosa authored May 6, 2024
2 parents 14692bc + 51d2412 commit a85b0ff
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 21 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci_nextflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: pipeline CI
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
on:
push:
branches:
- main
pull_request:
release:
types: [published]

env:
NXF_ANSI_LOG: false

concurrency:
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true

jobs:
test:
name: Run pipeline with test data
# Only run on push if this is the nf-core dev branch (merged PRs)
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'mathysgrapotte/stimulus') }}"
runs-on: ubuntu-latest
strategy:
matrix:
NXF_VER:
- "23.04.0"
- "latest-everything"
steps:
- name: Check out pipeline code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install Nextflow
uses: nf-core/setup-nextflow@v1
with:
version: "${{ matrix.NXF_VER }}"

- name: Disk space cleanup
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

- name: Run pipeline with test data
# TODO: Get rid of loca profile when the nf-core like configs are in
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test,local
test_stub:
name: Stub run of the pipeline
if: ${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'mathysgrapotte/stimulus') }}
runs-on: ubuntu-latest
steps:
- name: Check out pipeline code
uses: actions/checkout@v2

- name: Install Nextflow
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
- name: Run pipeline with stub-run in alphafold2 split mode
run: |
nextflow run ${GITHUB_WORKSPACE} -profile test_stub
2 changes: 1 addition & 1 deletion bin/launch_transform_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def main(data_csv, config_json, out_path):

# Transform the data according to what defined in the experiment class and the specifics of the user in the Json
# in case of no transformation specification so when the config has "augmentation" : None just save a copy of the original csv file
if config["transform"]:
if config.get("transform") is not None:
csv_obj.transform(config["transform"])

# save the modified csv
Expand Down
33 changes: 16 additions & 17 deletions configs/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,23 @@

process {


withName: "GENERATE_FASTA|GENERATE_FROM_FASTA" {
ext.args = { [ params.dna_seq_len ? "-sl ${params.dna_seq_len}" : '-sl 100',
params.motif_tag ? "-t ${params.motif_tag}" : '-t 5',
params.non_motif_tag ? "-u ${params.non_motif_tag}" : '-u 0',
params.num_seq ? "-ns ${params.num_seq}" : '',
params.motif_start ? "-p ${params.motif_start}" : ''
].flatten().unique(false).join(' ').trim()
}
ext.prefix = { params.generated_fasta ? params.generated_fasta : null }
// withName: "GENERATE_FASTA|GENERATE_FROM_FASTA" {
// ext.args = { [ params.dna_seq_len ? "-sl ${params.dna_seq_len}" : '-sl 100',
// params.motif_tag ? "-t ${params.motif_tag}" : '-t 5',
// params.non_motif_tag ? "-u ${params.non_motif_tag}" : '-u 0',
// params.num_seq ? "-ns ${params.num_seq}" : '',
// params.motif_start ? "-p ${params.motif_start}" : ''
// ].flatten().unique(false).join(' ').trim()
// }
// ext.prefix = { params.generated_fasta ? params.generated_fasta : null }

// the outdir has to be the one the user specify plus stuff that makes it run unique
publishDir = [
path: { "${params.outdir}/${workflow.runName}_" + "${workflow.start}".replaceAll('[-:]', '_').split('\\.')[0] },
mode: params.publish_dir_mode,
overwrite: true
]
}
// // the outdir has to be the one the user specify plus stuff that makes it run unique
// publishDir = [
// path: { "${params.outdir}/${workflow.runName}_" + "${workflow.start}".replaceAll('[-:]', '_').split('\\.')[0] },
// mode: params.publish_dir_mode,
// overwrite: true
// ]
// }

withName: "TORCH_TUNE" {

Expand Down
2 changes: 1 addition & 1 deletion configs/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ params {
csv = "${projectDir}/bin/tests/test_data/dna_experiment/test.csv"
exp_conf = "${projectDir}/examples/test.json"
model = "${projectDir}/bin/tests/test_model/dnatofloatmodel.py"
train_conf = "${projectDir}/bin/tests/test_model/simple.config"
train_conf = "${projectDir}/bin/tests/test_model/simple_config.yaml"

}
2 changes: 1 addition & 1 deletion configs/test_stub.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ params {
csv = "${projectDir}/bin/tests/test_data/dna_experiment/test.csv"
exp_conf = "${projectDir}/examples/test.json"
model = "${projectDir}/bin/tests/test_model/dnatofloatmodel.py"
train_conf = "${projectDir}/bin/tests/test_model/simple.config"
train_conf = "${projectDir}/bin/tests/test_model/simple_config.yaml"
}

process {
Expand Down
2 changes: 1 addition & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"format": "directory-path",
"description": "Training config",
"fa_icon": "fas fa-folder-open",
"default": "${projectDir}/bin/tests/test_model/simple.config"
"default": "${projectDir}/bin/tests/test_model/simple_config.yaml"
}
}
}
Expand Down

0 comments on commit a85b0ff

Please sign in to comment.