github.com/pachyderm/pachyderm@v1.13.4/examples/group/lab_group_by_patient.json (about)

     1  
     2    {
     3      "pipeline": {
     4        "name": "group_by_patient"
     5      },
     6      "description": "A pipeline that groups lab test results files by patient using the files naming pattern.",
     7      "input": {
     8        "group": [
     9          {
    10            "pfs": {
    11              "repo": "labresults",
    12              "branch": "master",
    13              "glob": "/*-PATID(*)-*.txt",
    14              "group_by": "$1"
    15            }
    16          }
    17       ]
    18     },
    19     "transform": {
    20          "cmd": [ "bash" ],
    21          "stdin": [ "PATTERN=.*-PATID\\(.*\\)-.*.txt", "FILES=/pfs/labresults/*", "for f in $FILES", "do", "[[ $(basename $f) =~ $PATTERN ]]", "mkdir -p /pfs/out/${BASH_REMATCH[1]}/", "cp $f /pfs/out/${BASH_REMATCH[1]}/", "done" ]
    22          }
    23    }