The problem
Currently, users are required to place all of their input files into a directory named data within the repository itself. This means that users would need to replace (or move) this directory if a second run was being performed on different inputs. This introduces opportunities for user error and feels kind of clunky. It would significantly improve the user experience if users could run the program in the directory of their choice.
Proposed solution
Although by default, snakemake looks for Snakefile in ./, this is not required. It is possible to run snakemake elsewhere by using following syntax:
snakemake -d ./my/working/directory/ --snakefile path/to/seabreeze/Snakefile --cores 42
Within the Snakefile, you can reference the directory containing the snakefile with variable workflow.basedir and the working directory with the variable workflow.overwrite_workdir. This will allow you to do something like:
query_path = os.path.join(workflow.overwrite_workdir, '02_genomes', '{sample}.fasta')
script = os.path.join(workflow.basedir, 'bin', 'scripts', 'find_reindex_bases.py')
instead of hardcoding it like this
query_path = 'data/02_genomes/{sample}.fasta')
script = 'bin/scripts/find_reindex_bases.py'
This is part of the review at openjournals/joss-reviews#8065
The problem
Currently, users are required to place all of their input files into a directory named
datawithin the repository itself. This means that users would need to replace (or move) this directory if a second run was being performed on different inputs. This introduces opportunities for user error and feels kind of clunky. It would significantly improve the user experience if users could run the program in the directory of their choice.Proposed solution
Although by default,
snakemakelooks forSnakefilein./, this is not required. It is possible to runsnakemakeelsewhere by using following syntax:Within the Snakefile, you can reference the directory containing the snakefile with variable
workflow.basedirand the working directory with the variableworkflow.overwrite_workdir. This will allow you to do something like:instead of hardcoding it like this
This is part of the review at openjournals/joss-reviews#8065