Andrew VonHandorf
08/26/2024, 1:53 PM// example.csv //
sample,path1,path2
sample1,/path/to/sample1.bam,/path/to/sample1.bam
sample2,/path/to/sample2.bam,/path/to/sample2.bam
sample3,/path/to/sample3.bam,/path/to/sample3.bam
// end example.csv //
// workflow //
workflow {
Channel
.fromPath(params.input)
.splitCsv(header: true, sep: ",")
.set{ch_input}
ch_input
| collectFile(name: "valid_samplesheet.csv", newLine: true, keepHeader: true)
| view
}
// end workflow //
// error //
ERROR ~ Not a valid file collector argument [java.util.LinkedHashMap]: [sample:sample3, path1:/path/to/sample3.bam, path2:/path/to/sample3.bam]
// end error //
Hey all, I've been racking my brain over what is a seemingly simple issue for some reason. Essentially, I am trying to read a samplesheet into a channel, then collect the updated contents into a new file. Am I missing something in this conversion?Mahesh Binzer-Panchal
08/26/2024, 2:22 PMmap to turn the `Map`'s into Strings againAndrew VonHandorf
08/26/2024, 2:44 PMch_input
| map{row -> row.collectEntries { k, v -> [(k): v.toString()] } }
| collectFile(name: "samplesheet.csv", keepHeader: true, newLine:true)
// error //
ERROR ~ Not a valid file collector argument [java.util.LinkedHashMap]: [sample:sample3, path1:/path/to/sample3.bam, path2:/path/to/sample3.bam]
I gave that a go, but ran into the same issue; thinking it may be easier just to rethink my strategy for this particular stepMahesh Binzer-Panchal
08/26/2024, 5:01 PM[(k): v.toString()] this object is still a Map. It needs to be a string "k,v" or something.Andrew VonHandorf
08/26/2024, 5:33 PM