diff options
-rw-r--r-- | default.nix | 1 | ||||
-rw-r--r-- | lib/types.nix | 1 | ||||
-rw-r--r-- | quip.nix | 8 | ||||
-rw-r--r-- | test-tnpair.nix | 1 | ||||
-rw-r--r-- | tools/quip-app.nix | 19 | ||||
-rw-r--r-- | tools/quip-quip.nix | 17 | ||||
-rw-r--r-- | tools/quip-unquip.nix | 18 | ||||
-rw-r--r-- | tools/quip.nix | 6 |
8 files changed, 71 insertions, 0 deletions
diff --git a/default.nix b/default.nix index 73cccdd..62b6d3c 100644 --- a/default.nix +++ b/default.nix @@ -54,6 +54,7 @@ let subread = callBionix ./tools/subread.nix { }; hatchet = callBionix ./tools/hatchet.nix { }; pizzly = callBionix ./tools/pizzly.nix { }; + quip = callBionix ./tools/quip.nix { }; slurm-run = callPackage ./lib/slurm.nix { }; slurm-exec = f: x: y: diff --git a/lib/types.nix b/lib/types.nix index 11f4bf4..896c39c 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -35,6 +35,7 @@ rec { gz = filetype; bgz = filetype; bz2 = filetype; + qp = filetype; }; toCram = matchFiletype "bam2cram" { bam = filetype.cram; sam = filetype.cram; inherit (filetype) cram; }; diff --git a/quip.nix b/quip.nix new file mode 100644 index 0000000..c5e7186 --- /dev/null +++ b/quip.nix @@ -0,0 +1,8 @@ +{bionix}: +with bionix; + +{ +app = callPackage ./quip-app.nix {}; +quip = callBionix ./quip-quip.nix; +unquip = callBionix ./quip-unqip.nix; +} diff --git a/test-tnpair.nix b/test-tnpair.nix index 679cc67..169d531 100644 --- a/test-tnpair.nix +++ b/test-tnpair.nix @@ -98,6 +98,7 @@ let snver = snver.call { ploidy = 1; } tnpairResult.alignments; mosdepth = mosdepth.plot { } { inputs = mapAttrsToList (_: mosdepth.depth { }) tnpairResult.alignments; names = [ "seq1" "seq2" ]; }; xenomapper = xenomapper.allocate { } { primary = nameSort tnpairResult.alignments.tumour; secondary = nameSort tnpairResult.alignments.tumour; }; + quip = with quip; unquip {} (quip {} tnpairResult.alignments.tumour); genmap = genmap.calcmap { } ref; inherit alignments; }; diff --git a/tools/quip-app.nix b/tools/quip-app.nix new file mode 100644 index 0000000..422b603 --- /dev/null +++ b/tools/quip-app.nix @@ -0,0 +1,19 @@ +{ + stdenv, + fetchFromGitHub, + autoreconfHook, + zlib, +}: +stdenv.mkDerivation rec { + name = "quip"; + + src = fetchFromGitHub { + owner = "dcjones"; + repo = "quip"; + rev = "9165bb5ac17a2cf2822e437df573487d7adfa1cc"; + sha256 = "PpvgLzdiYcLyJ1JH9UzbUd29eKIlyY440HiJGYWvkrs="; + }; + + nativeBuildInputs = [autoreconfHook]; + buildInputs = [zlib]; +} diff --git a/tools/quip-quip.nix b/tools/quip-quip.nix new file mode 100644 index 0000000..77cf557 --- /dev/null +++ b/tools/quip-quip.nix @@ -0,0 +1,17 @@ +{bionix}: +with bionix; +with lib.types; + input: let + ref = matchFiletype "quip" {bam = f: f.ref;} input; + in + stage { + name = "quip"; + buildInputs = [quip.app]; + buildCommand = '' + ln -s ${input} input.bam + quip -r ${ref} input.bam + cp input.bam.qp $out + ''; + stripStorePaths = false; + passthru.filetype = filetype.qp input.filetype; + } diff --git a/tools/quip-unquip.nix b/tools/quip-unquip.nix new file mode 100644 index 0000000..8c9cc01 --- /dev/null +++ b/tools/quip-unquip.nix @@ -0,0 +1,18 @@ +{bionix}: +with bionix; +with lib.types; + input: let + bamft = matchFiletype "unquip" {qp = x: x;} input; + ref = matchFiletype' "unquip-sub" {bam = f: f.ref;} bamft; + in + stage { + name = "unquip"; + buildInputs = [quip.app]; + buildCommand = '' + ln -s ${input} input.bam.qp + unquip -r ${ref} input.bam.qp + cp input.bam $out + ''; + stripStorePaths = false; + passthru.filetype = bamft; + } diff --git a/tools/quip.nix b/tools/quip.nix new file mode 100644 index 0000000..f0a57aa --- /dev/null +++ b/tools/quip.nix @@ -0,0 +1,6 @@ +{bionix}: +with bionix; { + app = pkgs.callPackage ./quip-app.nix {}; + quip = callBionix ./quip-quip.nix; + unquip = callBionix ./quip-unquip.nix; +} |