These are chat archives for nextflow-io/nextflow

16th
Apr 2017
Tim Diels
@timdiels
Apr 16 2017 12:29
My pipeline keeps running from scratch despite using -resume https://pastebin.com/eqnS9uxL
Tim Diels
@timdiels
Apr 16 2017 12:43
Oh, it's because I use ${workflow.runName} in script, but I would like to use it in my command as the name of a database, to ensure runs of the same pipeline with different inputs don't end up using the same name
I'll just use a name param that remains the same across runs
Karin Lagesen
@karinlag
Apr 16 2017 16:24
just looking through the workflow that @ewels et al works on, and its accompanying config files
they seem to have a task.attempt variable that I can't see where they define
is this something that is part of nf, as $workflow is?
Phil Ewels
@ewels
Apr 16 2017 17:57
Yes - the task namespace is all stuff to do with, well, the task :)
But built-in as you guessed
Tim Diels
@timdiels
Apr 16 2017 20:27
Is there a way to hook into nextflow clean? Multiple tasks require the same database, so instead of trying to delete it during the run (which I couldn't make work without manually invalidating createDatabase tasks on -resume, or recreating the database each run whether it's needed or not), I'll just leave it 'cached' until I run nextflow clean. So on clean, I'd like to run a process to remove the created databases
Tim Diels
@timdiels
Apr 16 2017 20:33
Never mind, I think I can just do this
process blast {
    output:
    db into dbs
    other into output

    script:
    """
    with shared_dir/lock
        if not db
            create db
    use db
    """
}
process deleteDb {
    input:
    db from dbs

    script:
    """
    delete db
    """
}
Tim Diels
@timdiels
Apr 16 2017 22:39
Seems exec: does not run in an isolated directory, would publishDir even work with it?