How to select from nested arrays

16 views
Skip to first unread message

Tj Idowu

unread,
Feb 18, 2022, 12:53:26 PM2/18/22
to Nextflow
Hello,

I am trying to select specific values from a nested array. The array is the name of some output files that are grouped together based on unique features. It is the output from when I use the .view() function on the process that generates the files.

Example:

[f1_r1-0_1, [[patho_Ecoli_f1_r1-0_1, /nfs/staging/idowu /patho_Ecoli_f1_r1-0_1_R1.fq], [nonpatho_Ecoli_f1_r1-0_1, /nfs/staging/idowu/nonpatho_Ecoli_f1_r1-0_1_R1.fq]]]

[f1_r1-0_6, [[patho_Ecoli_f1_r1-0_6, /nfs/staging/idowu/patho_Ecoli_f1_r1-0_6_R1.fq], [nonpatho_Ecoli_f1_r1-0_6, /nfs/staging/idowu /nonpatho_Ecoli_f1_r1-0_6_R1.fq]]]

[f1_r1-0_2, [[patho_Ecoli_f1_r1-0_2, /nfs/staging/idowu/patho_Ecoli_f1_r1-0_2_R1.fq], [nonpatho_Ecoli_f1_r1-0_2, /nfs/staging/idowu/nonpatho_Ecoli_f1_r1-0_2_R1.fq]]]

[f1_r1-0_8, [[patho_Ecoli_f1_r1-0_8, /nfs/staging/idowu/patho_Ecoli_f1_r1-0_8_R1.fq], [nonpatho_Ecoli_f1_r1-0_8, /nfs/staging/idowu/nonpatho_Ecoli_f1_r1-0_8_R1.fq]]]

[f1_r0-1_1, [[patho_Ecoli_f1_r0-1_1, /nfs/staging/idowu/patho_Ecoli_f1_r0-1_1_R1.fq], [nonpatho_Ecoli_f1_r0-1_1, /nfs/staging/idowu/nonpatho_Ecoli_f1_r0-1_1_R1.fq]]]

[f1_r1-0_9, [[patho_Ecoli_f1_r1-0_9, /nfs/staging/idowu /patho_Ecoli_f1_r1-0_9_R1.fq], [nonpatho_Ecoli_f1_r1-0_9, /nfs/staging/idowu/nonpatho_Ecoli_f1_r1-0_9_R1.fq]]]

[f1_r1-0_5, [[nonpatho_Ecoli_f1_r1-0_5, /nfs/staging/idowu/nonpatho_Ecoli_f1_r1-0_5_R1.fq], [patho_Ecoli_f1_r1-0_5, /nfs/staging/idowu/patho_Ecoli_f1_r1-0_5_R1.fq]]]

[f1_r10-1_8, [[nonpatho_Ecoli_f1_r10-1_8, /nfs/staging/idowu/nonpatho_Ecoli_f1_r10-1_8_R1.fq], [patho_Ecoli_f1_r10-1_8, /nfs/staging/idowuo/patho_Ecoli_f1_r10-1_8_R1.fq]]]

[f1_r0-1_3, [[patho_Ecoli_f1_r0-1_3, /nfs/staging/idowu/patho_Ecoli_f1_r0-1_3_R1.fq], [nonpatho_Ecoli_f1_r0-1_3, /nfs/staging/idowu /nonpatho_Ecoli_f1_r0-1_3_R1.fq]]]

[f1_r0-1_4, [[patho_Ecoli_f1_r0-1_4, /nfs/staging/idowu/patho_Ecoli_f1_r0-1_4_R1.fq], [nonpatho_Ecoli_f1_r0-1_4, /nfs/staging/idowu/nonpatho_Ecoli_f1_r0-1_4_R1.fq]]]

I am trying to get only the file paths; either one, or both from each array while still maintaining their grouping from the array.

Please how do I go about doing this? 

Anand

unread,
Mar 21, 2022, 9:58:34 PM3/21/22
to next...@googlegroups.com

--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nextflow/02ac82ec-d9a1-4e9c-bac6-fbfe2984255en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages