diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fa37f7..d85db9a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 2 strategy: matrix: - python-version: ["3.10"] + python-version: ["3.11"] steps: - uses: actions/checkout@v3 @@ -34,7 +34,6 @@ jobs: run: | python -m pip install --upgrade pip setuptools pip install .[dev,test] - python -c 'from logan.src.util import chmod_bins_exec; chmod_bins_exec()' - name: Check CLI basics run: | which logan @@ -43,12 +42,14 @@ jobs: - name: Test stub run for Fastqs run: | logan init - logan run -profile ci_stub \ - --sample_sheet .tests/pairs.tsv \ - --fastq_input ".tests/*R{1,2}_001.fastq.gz" \ - --vc --cnv --sv --gl --qc \ - --split_regions 2 \ - --genome hg38 \ - --outdir output_tn_fqs \ - --intervals .tests/interval.bed \ - -preview + logan run \ + -profile ci_stub \ + --mode local \ + --sample_sheet .tests/pairs.tsv \ + --fastq_input ".tests/*R{1,2}_001.fastq.gz" \ + --vc --cnv --sv --gl --qc \ + --split_regions 2 \ + --genome hg38 \ + --outdir output_tn_fqs \ + --intervals .tests/interval.bed \ + -preview diff --git a/CHANGELOG.md b/CHANGELOG.md index 99f82e2..f9c00c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## LOGAN development version +- Improve help message for `logan run`. (#97, @kelly-sovacool) + - the default `--mode` is now `slurm`. + # LOGAN 0.3.0 - LOGAN now depends on ccbr_tools v0.4 for updated jobby & spooker utilities. (#95, @kelly-sovacool) diff --git a/bin/hello-world.py b/bin/hello-world.py old mode 100644 new mode 100755 index a5df617..54280ff --- a/bin/hello-world.py +++ b/bin/hello-world.py @@ -12,4 +12,4 @@ def main(): if __name__ == "__main__": - main(sys.argv) \ No newline at end of file + main(sys.argv) diff --git a/bin/logan b/bin/logan old mode 100644 new mode 100755 index 07b7af3..8cd6cae --- a/bin/logan +++ b/bin/logan @@ -4,4 +4,4 @@ TOOLDIR=$(realpath $(dirname $(dirname ${BASH_SOURCE}))) -${TOOLDIR}/main.py "$@" \ No newline at end of file +${TOOLDIR}/main.py "$@" diff --git a/bin/make_freec_exome_paired.pl b/bin/make_freec_exome_paired.pl old mode 100644 new mode 100755 index eb192a2..3e11fb2 --- a/bin/make_freec_exome_paired.pl +++ b/bin/make_freec_exome_paired.pl @@ -47,4 +47,4 @@ print C "makePileup = $makePileup\n"; print C "fastaFile = $fastaFile\n"; print C "minimalCoveragePerPosition = 10\n"; -print C "SNPfile = $SNPfile"; \ No newline at end of file +print C "SNPfile = $SNPfile"; diff --git a/bin/reformat_bed.py b/bin/reformat_bed.py old mode 100644 new mode 100755 index fc64c5b..69a4320 --- a/bin/reformat_bed.py +++ b/bin/reformat_bed.py @@ -82,4 +82,4 @@ # freec_bed.write(freec_bed_output) ### Update loop variables - last_start = curr_cols[1] \ No newline at end of file + last_start = curr_cols[1] diff --git a/main.py b/main.py new file mode 100755 index 0000000..dd67ba5 --- /dev/null +++ b/main.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +import os +import re +import sys + +# add script directory to the path to allow logan CLI to work out-of-the-box +# without the need to install it via pip first +SCRIPT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "src") +sys.path.append(SCRIPT_DIR) +from src.__main__ import main + +if ( + __name__ == "__main__" +): # this block is adapted from the executable file created by `pip install` + sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0]) + sys.exit(main()) diff --git a/src/__main__.py b/src/__main__.py index 1cd478a..ca00096 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -52,18 +52,21 @@ def cli(): help_msg_extra = """ +\b +Nextflow options: +-profile Nextflow profile to use (e.g. test) +-params-file Nextflow params file to use (e.g. assets/params.yml) +-preview Preview the processes that will run without executing them + \b EXAMPLES: Execute with slurm: - logan run ... --mode slurm + logan run --output path/to/outdir --mode slurm Preview the processes that will run: - logan run ... --mode local -preview + logan run --output path/to/outdir --mode local -preview Add nextflow args (anything supported by `nextflow run`): - logan run ... -work-dir path/to/workDir -Run with a specific installation of logan: - logan run --main path/to/logan/main.nf ... -Run with a specific tag, branch, or commit from GitHub: - logan run --main CCBR/LOGAN -r v0.1.0 ... + logan run --output path/to/outdir --mode slurm -profile test + logan run --output path/to/outdir --mode slurm -profile test -params-file assets/params.yml """ @@ -82,6 +85,7 @@ def cli(): type=str, default=repo_base("main.nf"), show_default=True, + hidden=True, ) @click.option( "--output", @@ -95,7 +99,7 @@ def cli(): "_mode", help="Run mode (slurm, local)", type=str, - default="local", + default="slurm", show_default=True, ) @click.option( @@ -109,7 +113,12 @@ def cli(): ) @click.argument("nextflow_args", nargs=-1) def run(main_path, output, _mode, force_all, **kwargs): - """Run the workflow""" + """ + Run the workflow + + Note: you must first run `logan init --output ` to initialize + the output directory. + """ if ( # this is the only acceptable github repo option for logan main_path != "CCBR/LOGAN" ):