diff options
author | Justin Bedo <cu@cua0.org> | 2019-01-09 16:38:42 +1100 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2019-01-09 16:38:42 +1100 |
commit | c3babc9eb65dc8c56d07ce8a6ee0d8c03bbd223e (patch) | |
tree | f7d88ec21635664781c7c79fe0ea6f962ae38004 /test-tnpair.nix | |
parent | 9fd618d0305d4927c8d86fc37238d1216e401967 (diff) |
large refactor
- use bionix.pkgs instead of nixpkgs
- replace stdenv.mkDerivation with stage
Diffstat (limited to 'test-tnpair.nix')
-rw-r--r-- | test-tnpair.nix | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/test-tnpair.nix b/test-tnpair.nix index b897366..0851a74 100644 --- a/test-tnpair.nix +++ b/test-tnpair.nix @@ -1,49 +1,39 @@ -with (import <nixpkgs> {}); +with import <bionix> {}; with lib; let - bionix = (import <bionix> {}).extend (self: super: with self; { - bwa = with super.bwa; { - align = align; - index = def index { flags = "-a is"; }; - }; - }); - -in - -with bionix; - -let - fetchlocal = path: stdenv.mkDerivation { + fetchlocal = path: pkgs.stdenv.mkDerivation { name = baseNameOf path; buildCommand = "ln -s ${path} $out"; }; fetchfq = attrs: types.tagFiletype (types.filetype.fq {}) (fetchlocal attrs); fetchfa = attrs: types.tagFiletype (types.filetype.fa {}) (fetchlocal attrs); - ref = fetchfa ./example/ref.fa; + ref = fetchfa ./examples/ref.fa; alignWithRG = rg: bwa.align { inherit ref; flags = "-R'@RG\\tID:${rg}\\tSM:${rg}'";}; sort = samtools.sort {}; flagstat = samtools.flagstat {}; check = fastqc.check {}; callVariants = strelka.call {}; + markdup = samtools.markdup {}; + fixmate = samtools.fixmate {}; tnpair = { tumour = {name = "mysample1"; files = { - input1 = fetchfq ./example/sample1-1.fq; - input2 = fetchfq ./example/sample1-2.fq; + input1 = fetchfq ./examples/sample1-1.fq; + input2 = fetchfq ./examples/sample1-2.fq; }; }; normal = {name = "mysample2"; files = { - input1 = fetchfq ./example/sample2-1.fq; - input2 = fetchfq ./example/sample2-2.fq; + input1 = fetchfq ./examples/sample2-1.fq; + input2 = fetchfq ./examples/sample2-2.fq; }; }; }; processPair = { tumour, normal }: rec { - alignments = mapAttrs (_: x: sort (alignWithRG x.name x.files)) { inherit normal tumour; }; + alignments = mapAttrs (_: x: markdup (sort (fixmate (alignWithRG x.name x.files)))) { inherit normal tumour; }; variants = callVariants alignments; }; |