aboutsummaryrefslogtreecommitdiff
path: root/tools/fastp-check.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2021-10-29 17:39:01 +1100
committerJustin Bedo <cu@cua0.org>2021-10-29 17:39:01 +1100
commitbac9248a5e08e8afdf5485a6e27cfe72e1ca5090 (patch)
tree8719a280b56122017d46b582cd3da8547dd3f548 /tools/fastp-check.nix
parentab809b8c77efdad9fb54d3591a0193a1cbe888d1 (diff)
treewide reformatting and simplification
- simplify with statix - reformat with nixpkgs-fmt
Diffstat (limited to 'tools/fastp-check.nix')
-rw-r--r--tools/fastp-check.nix45
1 files changed, 23 insertions, 22 deletions
diff --git a/tools/fastp-check.nix b/tools/fastp-check.nix
index 06f00ae..9467cd9 100644
--- a/tools/fastp-check.nix
+++ b/tools/fastp-check.nix
@@ -1,10 +1,10 @@
{ bionix
, flags ? null
-} :
+}:
{ input1
, input2 ? null
-} :
+}:
with bionix;
with lib;
@@ -15,26 +15,27 @@ let
out =
stage {
- name = "fastp";
- buildInputs = [ pkgs.fastp ];
- outputs = [ "out" "fastq1" "json" ] ++ (if input2 != null then [ "fastq2" ] else []);
- buildCommand = ''
- mkdir -p $out
- fastp \
- ${optionalString (flags != null) flags} \
- -i ${fq input1} \
- -o fastq1.fq.gz \
- ${optionalString (input2 != null) ''
- -I ${fq input2} \
- -O fastq2.fq.gz \
+ name = "fastp";
+ buildInputs = [ pkgs.fastp ];
+ outputs = [ "out" "fastq1" "json" ] ++ (if input2 != null then [ "fastq2" ] else [ ]);
+ buildCommand = ''
+ mkdir -p $out
+ fastp \
+ ${optionalString (flags != null) flags} \
+ -i ${fq input1} \
+ -o fastq1.fq.gz \
+ ${optionalString (input2 != null) ''
+ -I ${fq input2} \
+ -O fastq2.fq.gz \
- cp fastq2.fq.gz $fastq2
- ''}
+ cp fastq2.fq.gz $fastq2
+ ''}
- cp fastq1.fq.gz $fastq1
- cp fastp.html $out
- cp fastp.json $json
- '';
+ cp fastq1.fq.gz $fastq1
+ cp fastp.html $out
+ cp fastp.json $json
+ '';
};
- fqgz = { filetype = filetype.gz (filetype.fastq {}); };
-in out // { fastq1 = out.fastq1 // fqgz; } // (if input2 != null then {fastq2 = out.fastq2 // fqgz; } else {})
+ fqgz = { filetype = filetype.gz (filetype.fastq { }); };
+in
+out // { fastq1 = out.fastq1 // fqgz; } // (if input2 != null then { fastq2 = out.fastq2 // fqgz; } else { })