Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 12 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
timeout-minutes: 2
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.11"]

steps:
- uses: actions/checkout@v3
Expand All @@ -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
Expand All @@ -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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion bin/hello-world.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ def main():


if __name__ == "__main__":
main(sys.argv)
main(sys.argv)
2 changes: 1 addition & 1 deletion bin/logan
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

TOOLDIR=$(realpath $(dirname $(dirname ${BASH_SOURCE})))

${TOOLDIR}/main.py "$@"
${TOOLDIR}/main.py "$@"
2 changes: 1 addition & 1 deletion bin/make_freec_exome_paired.pl
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
print C "makePileup = $makePileup\n";
print C "fastaFile = $fastaFile\n";
print C "minimalCoveragePerPosition = 10\n";
print C "SNPfile = $SNPfile";
print C "SNPfile = $SNPfile";
2 changes: 1 addition & 1 deletion bin/reformat_bed.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@
# freec_bed.write(freec_bed_output)

### Update loop variables
last_start = curr_cols[1]
last_start = curr_cols[1]
16 changes: 16 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -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())
27 changes: 18 additions & 9 deletions src/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,21 @@ def cli():


help_msg_extra = """
\b
Nextflow options:
-profile <profile> Nextflow profile to use (e.g. test)
-params-file <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
"""


Expand All @@ -82,6 +85,7 @@ def cli():
type=str,
default=repo_base("main.nf"),
show_default=True,
hidden=True,
)
@click.option(
"--output",
Expand All @@ -95,7 +99,7 @@ def cli():
"_mode",
help="Run mode (slurm, local)",
type=str,
default="local",
default="slurm",
show_default=True,
)
@click.option(
Expand All @@ -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 <output_dir>` to initialize
the output directory.
"""
if ( # this is the only acceptable github repo option for logan
main_path != "CCBR/LOGAN"
):
Expand Down