** Génerer une liste de fastq en les groupant par nom de dossier
List all fastq, then generate a column containing the file and dirname.
Groupy by directory, extract record values input a table.
Filter folders with less than 2 files.
Concatenante the files and save the result into a txt file (.csv does not work)
#+begin_src sh
ls fastq/*/*.fastq.gz | select name | insert dir { $in.name | path dirname } | group-by dir | values | where ($in | length) > 1 | each { $in.name | str join ',' } | save input.txt
#+end_src
Version plus évoluée:
#+begin_src sh
def annotate [] { insert dir { $in.name | path dirname | path basename } | insert file { $in.name | path basename } | insert id { $in.name | patientID }}
def patientID [] { path basename | split row '_R' | first }
def toCSV [d] { $d.name | insert 0 ($d.dir | first) | insert 1 ($d.id | first) | str join ',' }
ls fastq/*/*.fastq.gz | select name | annotate | group-by dir | values | where ($in | length) > 1 | each { toCSV $in } | save -f input.txt
#+end_src