From a1d18efc18772a233aa759b622c3a9960824f109 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Tue, 30 Apr 2019 09:47:49 +1000 Subject: cleanup examples and stray files --- examples/ex-nextflow/nextflow-example1.nix | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 examples/ex-nextflow/nextflow-example1.nix (limited to 'examples/ex-nextflow/nextflow-example1.nix') diff --git a/examples/ex-nextflow/nextflow-example1.nix b/examples/ex-nextflow/nextflow-example1.nix new file mode 100644 index 0000000..b31984a --- /dev/null +++ b/examples/ex-nextflow/nextflow-example1.nix @@ -0,0 +1,30 @@ +# This is a translation of the Nextflow example found at +# https://www.nextflow.io/example1.html +{ bionix ? import {} +, input ? ./sample.fa}: + +with bionix; +with lib; + +let + splitSequences = fa: stage { + name = "splitSequences"; + buildInputs = [ pkgs.gawk ]; + buildCommand = '' + awk '/^>/{f="seq_"++d} {print > f}' ${fa} + mkdir $out + cp seq* $out + ''; + }; + + reverse = fa: stage { + name = "reverse"; + buildCommand = '' + ${pkgs.utillinux}/bin/rev ${fa} > $out + ''; + }; + +in pipe [ + splitSequences + (each reverse) +] input -- cgit v1.2.3