diff --git a/.github/workflows/ci_nextflow.yml b/.github/workflows/ci_nextflow.yml new file mode 100644 index 0000000..9878148 --- /dev/null +++ b/.github/workflows/ci_nextflow.yml @@ -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 diff --git a/bin/launch_transform_csv.py b/bin/launch_transform_csv.py index c11c2d5..4c7519e 100755 --- a/bin/launch_transform_csv.py +++ b/bin/launch_transform_csv.py @@ -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 diff --git a/configs/modules.config b/configs/modules.config index e200a28..313afd2 100644 --- a/configs/modules.config +++ b/configs/modules.config @@ -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" { diff --git a/configs/test.config b/configs/test.config index 4d0109b..a4b9767 100644 --- a/configs/test.config +++ b/configs/test.config @@ -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" } diff --git a/configs/test_stub.config b/configs/test_stub.config index 1ba3ec7..45f3d9b 100644 --- a/configs/test_stub.config +++ b/configs/test_stub.config @@ -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 { diff --git a/nextflow_schema.json b/nextflow_schema.json index 2c6260f..2d34f34 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -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" } } }