Channel.fromPath(params.list)
.splitText()
.map { file(it.trim()) }
.set { dir_list }
dir_list.println()
/Users/pmca/NF/datasets/ds1
/Users/pmca/NF/datasets/ds2params.reads = "*{1,2}.fastq.gz"
Channel.fromFilePairs("${read_list}/*", size: -1) { file -> params.reads }
.set { reads_list }dir_list = '/Users/pmca/NF/datasets/ds1'
Channel.fromFilePairs("${dir_list}/*", size: -1) { file -> params.reads }
.set { reads_list }
reads_list.println()[*{1,2}.fastq.gz, [/Users/pmca/NF/datasets/ds1/s4_1.fq.gz, /Users/pmca/NF/datasets/ds1/s4_2.fq.gz]]To convert a file containing the a list of directory you can use the following snippet:Channel.fromFilePatterns( "{foo,bar,qux}/*_{1,2}.fastq" )
def paths = file('directories.txt').readLines().findAll { it.size()>0 }.join(',')Channel.fromPath( "{$paths}/*_{1,2}.fastq" ).set { new_channel }
--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/nextflow.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+u...@googlegroups.com.
myExtension = "*_{1,2}.fq.gz"
Channel.fromFilePairs( "/Users/pmca/NF/datasets/ds1/${myExtension},/Users/pmca/NF/datasets/ds2/${myExtension}" ).set { new_channel }
new_channel.println()
Channel.fromFilePairs( "/Users/pmca/NF/datasets/ds1/${myExtension}" ).set { other_channel }
other_channel.println()[warm up] executor > local
[s4, [/Users/pmca/NF/datasets/ds1/s4_1.fq.gz, /Users/pmca/NF/datasets/ds1/s4_2.fq.gz]]Channel.fromFilePairs( "/Users/pmca/NF/datasets/{ds1,ds2,etc}/*_{1,2}.fastq.gz" )
Channel.fromFilePairs( "/Users/pmca/NF/datasets/*/*_{1,2}.fastq.gz" )
id1, /Users/pmca/NF/datasets/ds1/s1_1.fq.gz, /Users/pmca/NF/datasets/ds1/s1_2.fq.gzid2, /Users/pmca/NF/datasets/ds1/s2_1.fq.gz, /Users/pmca/NF/datasets/ds1/s2_2.fq.gz:idn, /Users/pmca/NF/datasets/ds1/sn_1.fq.gz, /Users/pmca/NF/datasets/ds1/sn_2.fq.gz
Channel.fromPath( 'listing.txt' ).splitCsv().map { id, read1, read2 -> tuple( id, file(read1), file(read2) ) }.set { new_channel }
--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+unsubscribe@googlegroups.com.
Channel.fromPath( 'list.reads.txt' )
.splitCsv()
// .subscribe { row ->
// println "${row[0]} - ${row[1]} - ${row[2]}" }
.map { id, read1, read2 -> tuple( id, file(read1), file(read2) ) }
.set { channel3 }
channel3.println()ERROR ~ No signature of method: _nf_script_8d5b6144$_run_closure1.call() is applicable for argument types: ([Ljava.lang.String;) values: [[s1, /Users/pmca/NF/datasets/ds1/s4_1.fq.gz, ...]]
Possible solutions: any(), any(), any(groovy.lang.Closure), each(groovy.lang.Closure), any(groovy.lang.Closure), each(groovy.lang.Closure)s1 - /Users/pmca/NF/datasets/ds1/s4_1.fq.gz - /Users/pmca/NF/datasets/ds1/s4_2.fq.gz
s2 - /Users/pmca/NF/datasets/ds2/s5_1.fq.gz - /Users/pmca/NF/datasets/ds2/s5_2.fq.gzTo unsubscribe from this group and stop receiving emails from it, send an email to nextflow+u...@googlegroups.com.
tuple( it[0], file(it[1]), file(it[2]) )
tuple(it[0], it[1], it[2])
I think I managed to get over the error message by just using one "receiver" in .map. This seems to work but had to loose the file() definition. Not sure how important this is at this stage of reading from file. I guess I could set file() when the channel is send to a process!?
Channel.fromPath( 'list.reads.txt' )
.splitCsv()
.map { it -> tuple(it[0], it[1], it[2]) }
// .map { id, read1, read2 -> tuple( id, read1, read2 ) }
.into { channel3 }
channel3.println()
prints:[s1, /Users/pmca/NF/datasets/ds1/s4_1.fq.gz, /Users/pmca/NF/datasets/ds1/s4_2.fq.gz]
[s2, /Users/pmca/NF/datasets/ds2/s5_1.fq.gz, /Users/pmca/NF/datasets/ds2/s5_2.fq.gz]
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+unsubscribe@googlegroups.com.
[s1, /Users/pmca/NF/ /Users/pmca/NF/datasets/ds1/s4_1.fq.gz, /Users/pmca/NF/ /Users/pmca/NF/datasets/ds1/s4_2.fq.gz]
[s2, /Users/pmca/NF/datasets/ds2/s5_1.fq.gz, /Users/pmca/NF/datasets/ds2/s5_2.fq.gz]> cat list.reads.txt
s1, /Users/pmca/NF/datasets/ds1/s4_1.fq.gz, /Users/pmca/NF/datasets/ds1/s4_2.fq.gz
s2,/Users/pmca/NF/datasets/ds2/s5_1.fq.gz,/Users/pmca/NF/datasets/ds2/s5_2.fq.gzTo unsubscribe from this group and stop receiving emails from it, send an email to nextflow+unsubscribe@googlegroups.com.