aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-05-21 18:20:24 +1000
committerJustin Bedo <cu@cua0.org>2019-05-21 18:23:46 +1000
commit7b7f7c5eddfb3829cef8df7bf217d8309507cf2d (patch)
tree4ffe1670e18fb257f8fc906c52c9ee31a7420656 /tools
parent867e68554307d45e102ba3267f5f469d02fc6a86 (diff)
fastp: split outputs and set filetypes
Diffstat (limited to 'tools')
-rw-r--r--tools/fastp-check.nix50
1 files changed, 25 insertions, 25 deletions
diff --git a/tools/fastp-check.nix b/tools/fastp-check.nix
index c7cbb3c..be807d6 100644
--- a/tools/fastp-check.nix
+++ b/tools/fastp-check.nix
@@ -8,33 +8,33 @@
with bionix;
with pkgs.lib;
+with types;
# Match input file type—how to do .fq and .fq.gz? Does bz2 work?
-stage {
- name = "fastp";
- buildInputs = [ fastp.app ];
- outputs = [ "out" "fastq1" "fastq2" "html" "json" ];
- buildCommand = ''
- mkdir -p $out
- fastp \
- ${optionalString (flags != null) flags} \
- -i ${input1} \
- -o fastq1.fq.gz \
- ${optionalString (input2 != null) ''
- -I ${input2} \
- -O fastq2.fq.gz \
+let
+ out =
+ stage {
+ name = "fastp";
+ buildInputs = [ fastp.app ];
+ outputs = [ "out" "fastq1" "json" ] ++ (if input2 != null then [ "fastq2" ] else []);
+ buildCommand = ''
+ mkdir -p $out
+ fastp \
+ ${optionalString (flags != null) flags} \
+ -i ${input1} \
+ -o fastq1.fq.gz \
+ ${optionalString (input2 != null) ''
+ -I ${input2} \
+ -O fastq2.fq.gz \
- cp fastq2.fq.gz $fastq2
- ln -s $fastq2 $out/fastq2.fq.gz
- ''}
+ cp fastq2.fq.gz $fastq2
+ ''}
- cp fastq1.fq.gz $fastq1
- cp fastp.html $html
- cp fastp.json $json
-
- ln -s $fastq1 $out/fastq1.fq.gz
- ln -s $html $out/fastp.html
- ln -s $json $out/fastp.json
- '';
-} \ No newline at end of file
+ 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 {})