-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathena.nix
More file actions
28 lines (27 loc) · 719 Bytes
/
ena.nix
File metadata and controls
28 lines (27 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{ lib, fetchFastQGZ }:
{
importFromJSON = input: with lib; let
meta = with builtins; pipe input [ readFile fromJSON ];
fetch = { run_accession, fastq_md5, fastq_ftp, ... }:
let
fqs = splitString ";" fastq_ftp;
md5s = splitString ";" fastq_md5;
snd = x: head (tail x);
fq1 = head fqs;
fq2 = snd fqs;
md51 = head md5s;
md52 = snd md5s;
go = url: hash: fetchFastQGZ {
url = "ftp://" + url;
outputHash = hash;
outputHashAlgo = "md5";
};
in
nameValuePair run_accession
{
input1 = go fq1 md51;
input2 = go fq2 md52;
};
in
listToAttrs (map fetch meta);
}