These are chat archives for nextflow-io/nextflow

22nd
Dec 2018
Brad Langhorst
@bwlang
Dec 22 2018 03:18
i think i’m going mad…
Channel
    .fromPath( params.input_files )
    .ifEmpty { exit 1, "Cannot find any input bams matching: ${params.input_files}\nNote: Path needs to be enclosed in quotes." }
    .map { file -> [file.baseName, file, file + ".bai"]}
    .dump(tag:'input_files')
    .set{ input_bams }
should produce a nice list that i can consume like this:
set library, file(md_file), file(md_bai) from bams_for_fastqc
but no files are linked to the work directory… what am I missing?
Paolo Di Tommaso
@pditommaso
Dec 22 2018 13:52
@bwlang I see .set{ input_bams } instead the process declares from bams_for_fastqc ?
@stevekm it's memory not mem
Brad Langhorst
@bwlang
Dec 22 2018 13:57

missed a line...

input_bams.into {bams_for_fastqc; bams_for_samstats; bams_for_samflagstats; bams_for_picard_gc; bams_for_insert_sizes; bams_for_qualimap}

i’ve since skipped the .set and just applied the .into after the .dump. I think my problem was that I was expecting that links to the input files are created. I fixed that by not using file(md_file).

Paolo Di Tommaso
@pditommaso
Dec 22 2018 14:00
if so it should work as you were expecting
Channel
    .fromPath( 'foo.bam' )
    .map { file -> [file.baseName, file, file + ".bai"]}
    .dump(tag:'input_files')
    .set{ input_bams }


 process foo {
 echo true
 input:
 set library, file(md_file), file(md_bai) from input_bams

 """
 ls -la 
 """
 }
[50/8eb69e] Submitted process > foo (1)
total 16
drwxr-xr-x  10 pditommaso  staff   320 Dec 22 15:01 .
drwxr-xr-x   3 pditommaso  staff    96 Dec 22 15:01 ..
-rw-r--r--   1 pditommaso  staff     0 Dec 22 15:01 .command.begin
-rw-r--r--   1 pditommaso  staff     0 Dec 22 15:01 .command.err
-rw-r--r--   1 pditommaso  staff     0 Dec 22 15:01 .command.log
-rw-r--r--   1 pditommaso  staff     0 Dec 22 15:01 .command.out
-rw-r--r--   1 pditommaso  staff  1972 Dec 22 15:01 .command.run
-rw-r--r--   1 pditommaso  staff    23 Dec 22 15:01 .command.sh
lrwxr-xr-x   1 pditommaso  staff    43 Dec 22 15:01 foo.bam -> /Users/pditommaso/projects/nextflow/foo.bam
lrwxr-xr-x   1 pditommaso  staff    47 Dec 22 15:01 foo.bam.bai -> /Users/pditommaso/projects/nextflow/foo.bam.bai
that's it
Brad Langhorst
@bwlang
Dec 22 2018 14:02
hmm - i’ll try to switch back to using file .