Hey @cademirch @tsackton, I saw on the v2 roadmap that you want to work towards a CLI for snparcher, which is a great idea. I'm trying to work towards a similar thing with our friends over at loco-pipe, which is conceptually similar to SNParcher with respect to one snakemake invocation doing a great many things/analyses. In the case of loco-pipe (a project I'm unaffiliated with, but am a friend and colleague of Nicolas'), I wanted the users at my uni to have some kind of setup automation (a frequent pain point), but without refactoring anything loco-pipe actually does. My WIP attempt is bundling loco-pipe (and its assets) as a minimal python package, then exposing loco-pipe init to setup a run directory, followed by loco-pipe start to do a basic directory validation and call snakemake on your behalf with all the configs present in the output dir from init, along with any user modifications since (hpc, etc.).
I think SNParcher's infrastructure would work well for that kind of design, i.e. snparcher init + snparcher start (or something similar), without compromising its strength of being a one-stop shop, in contrast to e.g. the discrete and narrow workflows in harpy, each with its own CLI. I'm still refining the loco-pipe approach, but you can see the barebones design here, where it uses a bit of simple python to copy loco-pipe configs/workflows, and fill in placeholder config text with format strings (stdlib and click, but argparse would suffice without adding extra deps). It would be ideal to run snakemake using the python API instead of as a subprocess, but I still can't wrap my head around it after the big API change between versions 7/8/9 and the inconsistent documentation associated with those changes.
So far, this CLI looks like (and is unlikely to become any more sophisticated):
➜ loco-pipe init
Usage: loco-pipe init [OPTIONS] SAMPLES...
Initialize a configured loco-pipe project
Create a directory (--output) with all the components loco-pipe needs to
run. Must include a `--reference` file. Provide the input BAM files and/or
directories at the end of the command as individual files/folders, using
shell wildcards (e.g. `data/*.bam`), or both.
Options:
-o, --output TEXT name of directory to create [default: .]
-r, --reference FILE reference fasta file which BAMs were aligned to
[required]
-s, --simple Do not annotate the workflow YAML file
➜ loco-pipe init -o koyfish -r toyfish/reference/toy_refgen.fa -s toyfish/bams
Notices:
- Samples have all been assigned to a single group and need to have distinct classifications in koyfish/docs/samples.tsv.
➜ loco-pipe start
Usage: loco-pipe start [OPTIONS] [DIRECTORY]
Launch the loco-pipe snakemake workflow
The target `directory` is expected to have been created with `loco-pipe init`.
Make sure you have addressed any notices provided by the init command prior
to launching loco-pipe. Will print snakemake output to the terminal.
Options:
-@, --threads INTEGER RANGE Number of threads to use [default: 8;
1<=x<=999]
-d, --dry Perform a snakemake dry run
Hey @cademirch @tsackton, I saw on the v2 roadmap that you want to work towards a CLI for snparcher, which is a great idea. I'm trying to work towards a similar thing with our friends over at loco-pipe, which is conceptually similar to SNParcher with respect to one snakemake invocation doing a great many things/analyses. In the case of loco-pipe (a project I'm unaffiliated with, but am a friend and colleague of Nicolas'), I wanted the users at my uni to have some kind of setup automation (a frequent pain point), but without refactoring anything loco-pipe actually does. My WIP attempt is bundling loco-pipe (and its assets) as a minimal python package, then exposing
loco-pipe initto setup a run directory, followed byloco-pipe startto do a basic directory validation and call snakemake on your behalf with all the configs present in the output dir frominit, along with any user modifications since (hpc, etc.).I think SNParcher's infrastructure would work well for that kind of design, i.e.
snparcher init+snparcher start(or something similar), without compromising its strength of being a one-stop shop, in contrast to e.g. the discrete and narrow workflows in harpy, each with its own CLI. I'm still refining the loco-pipe approach, but you can see the barebones design here, where it uses a bit of simple python to copy loco-pipe configs/workflows, and fill in placeholder config text with format strings (stdlibandclick, butargparsewould suffice without adding extra deps). It would be ideal to run snakemake using the python API instead of as a subprocess, but I still can't wrap my head around it after the big API change between versions 7/8/9 and the inconsistent documentation associated with those changes.So far, this CLI looks like (and is unlikely to become any more sophisticated):