diff options
author | l-d-s <l@sdf.org> | 2019-05-01 14:04:54 +1000 |
---|---|---|
committer | l-d-s <l@sdf.org> | 2019-05-01 14:05:00 +1000 |
commit | 95c8a36a7e673fac090175729069a668daa919da (patch) | |
tree | 7807cd59d5645864769d6e89b17ff43ed63c0d55 /tools/fastp-run.nix | |
parent | d517a934f570427e46be8d83aa2ae4b045b069e8 (diff) |
Add fastp.
Diffstat (limited to 'tools/fastp-run.nix')
-rw-r--r-- | tools/fastp-run.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tools/fastp-run.nix b/tools/fastp-run.nix new file mode 100644 index 0000000..c7cbb3c --- /dev/null +++ b/tools/fastp-run.nix @@ -0,0 +1,40 @@ +{ bionix +, flags ? null +} : + +{ input1 +, input2 ? null +} : + +with bionix; +with pkgs.lib; + +# 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 \ + + cp fastq2.fq.gz $fastq2 + ln -s $fastq2 $out/fastq2.fq.gz + ''} + + 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 |