1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: Apache-2.0
8 InlineJavascriptRequirement: {}
16 var pattern = /^(.+)(_S[0-9]{1,3}_)(.+)$/;
17 inputs.dir.listing = inputs.dir.listing.sort(function(a, b) { return a.basename.localeCompare(b.basename); });
18 for (var i = 0; i < inputs.dir.listing.length; i++) {
19 var file = inputs.dir.listing[i];
20 var groups = file.basename.match(pattern);
22 var sampleid = groups[1];
23 if (!samples[sampleid]) {
24 samples[sampleid] = [];
26 samples[sampleid].push(file);
30 Object.keys(samples).sort().forEach(function(sampleid, _) {
31 dirs.push({"class": "Directory",
33 "listing": samples[sampleid]});