From bac9248a5e08e8afdf5485a6e27cfe72e1ca5090 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Fri, 29 Oct 2021 17:39:01 +1100 Subject: treewide reformatting and simplification - simplify with statix - reformat with nixpkgs-fmt --- tools/ascat-app.nix | 19 ++++---- tools/ascat-callCNV.nix | 6 +-- tools/ascat.nix | 8 ++-- tools/bowtie-align.nix | 7 +-- tools/bowtie.nix | 4 +- tools/bwa-mem.nix | 7 +-- tools/bwa-mem2-app.nix | 2 +- tools/bwa-mem2.nix | 7 +-- tools/bwa.nix | 6 +-- tools/cnvkit-batch.nix | 15 ++++--- tools/cnvkit-scatter.nix | 5 ++- tools/cnvkit.nix | 6 +-- tools/compression-bunzip2.nix | 2 +- tools/compression-bzip2.nix | 2 +- tools/compression-gunzip.nix | 2 +- tools/compression-gzip.nix | 2 +- tools/compression.nix | 75 +++++++++++++++++-------------- tools/crumble-app.nix | 2 +- tools/crumble.nix | 2 +- tools/delly-call.nix | 4 +- tools/delly.nix | 2 +- tools/facets-app.nix | 14 +++--- tools/facets-call.nix | 4 +- tools/facets.nix | 6 +-- tools/fastp-check.nix | 45 ++++++++++--------- tools/fastp.nix | 6 +-- tools/fastqc.nix | 4 +- tools/gridss-assemble.nix | 14 +++--- tools/gridss-callVariants.nix | 28 ++++++------ tools/gridss-computeSamTags.nix | 12 +++-- tools/gridss-configFile.nix | 62 ++++++++++++++------------ tools/gridss-extractSVReads.nix | 6 +-- tools/gridss-softClipsToSplitReads.nix | 8 ++-- tools/gridss-variants.nix | 24 ++++++---- tools/gridss.nix | 41 +++++++++-------- tools/hisat2-align.nix | 7 +-- tools/hisat2-index.nix | 4 +- tools/hisat2.nix | 4 +- tools/infercnv-app.nix | 42 +++++++++--------- tools/infercnv-infer.nix | 12 ++--- tools/infercnv.nix | 6 +-- tools/kallisto-index.nix | 5 ++- tools/kallisto-quant.nix | 11 ++--- tools/kallisto.nix | 4 +- tools/last-align.nix | 9 ++-- tools/last.nix | 2 +- tools/lumpy-call.nix | 5 ++- tools/lumpy.nix | 2 +- tools/manta-call.nix | 6 +-- tools/manta.nix | 2 +- tools/minimap2-align.nix | 5 ++- tools/minimap2.nix | 2 +- tools/mosdepth-depth.nix | 2 +- tools/mosdepth-plot.nix | 3 +- tools/mosdepth.nix | 4 +- tools/mutect-app.nix | 19 ++++---- tools/mutect-call.nix | 11 ++--- tools/mutect.nix | 6 +-- tools/octopus-call.nix | 4 +- tools/octopus-callSomatic.nix | 4 +- tools/octopus.nix | 6 +-- tools/picard-markDuplicates.nix | 34 +++++++------- tools/picard.nix | 8 ++-- tools/platypus-callVariants.nix | 8 ++-- tools/platypus.nix | 2 +- tools/sambamba.nix | 25 ++++++----- tools/samtools-merge.nix | 4 +- tools/samtools-sort.nix | 7 +-- tools/samtools-view.nix | 5 ++- tools/snap-align.nix | 7 +-- tools/snap-app.nix | 2 +- tools/snap.nix | 6 +-- tools/snpeff-annotate.nix | 9 ++-- tools/snpeff-dbnsfp.nix | 9 ++-- tools/snpeff.nix | 8 ++-- tools/snver-call.nix | 2 +- tools/snver.nix | 4 +- tools/star-align.nix | 7 +-- tools/star-index.nix | 4 +- tools/star.nix | 2 +- tools/strelka-call.nix | 77 ++++++++++++++++---------------- tools/strelka-callSomatic.nix | 81 +++++++++++++++++----------------- tools/strelka.nix | 4 +- tools/whisper-align.nix | 7 +-- tools/whisper.nix | 2 +- tools/xenomapper-allocate.nix | 6 +-- tools/xenomapper.nix | 6 +-- 87 files changed, 524 insertions(+), 458 deletions(-) (limited to 'tools') diff --git a/tools/ascat-app.nix b/tools/ascat-app.nix index 51aa677..bd6d538 100644 --- a/tools/ascat-app.nix +++ b/tools/ascat-app.nix @@ -1,4 +1,4 @@ -{stdenv, callPackage, buildPerlPackage, fetchurl, fetchFromGitHub, perlPackages, R, bwa, samtools, pkgconfig, zlib, htslib, curl, bzip2, lzma, gnutls, nettle, gmp, p11-kit, libtasn1, perl, psmisc, time, vcftools, rWrapper, rPackages}: +{ stdenv, callPackage, buildPerlPackage, fetchurl, fetchFromGitHub, perlPackages, R, bwa, samtools, pkgconfig, zlib, htslib, curl, bzip2, lzma, gnutls, nettle, gmp, p11-kit, libtasn1, perl, psmisc, time, vcftools, rWrapper, rPackages }: let ascat = fetchurl { @@ -98,7 +98,7 @@ let url = "mirror://cpan/authors/id/C/CD/CDRAUG/${name}.tar.gz"; sha256 = "0yvhgifs8g9rwdcq84zw4b005nq2jml6c75zgjscv6d2pd3lj1ss"; }; - propagatedBuildInputs = with perlPackages; [DBI DataStag Error GD Graph HTTPMessage HTTPMessage IOstringy IOString IPCRun LWP ListMoreUtils SetScalar TestMost TestRequiresInternet URI XMLDOM XMLDOMXPath XMLLibXML XMLLibXML libxml_perl XMLSAX XMLSAXBase XMLSAXWriter XMLTwig XMLWriter YAML DBFile ]; + propagatedBuildInputs = with perlPackages; [ DBI DataStag Error GD Graph HTTPMessage HTTPMessage IOstringy IOString IPCRun LWP ListMoreUtils SetScalar TestMost TestRequiresInternet URI XMLDOM XMLDOMXPath XMLLibXML XMLLibXML libxml_perl XMLSAX XMLSAXBase XMLSAXWriter XMLTwig XMLWriter YAML DBFile ]; nativeBuildInputs = with perlPackages; [ TestException TestWarn TestDifferences TestDeep ]; }; @@ -108,7 +108,7 @@ let url = "mirror://cpan/authors/id/C/CM/CMUNGALL/${name}.tar.gz"; sha256 = "0ncf4l39ka23nb01jlm6rzxdb5pqbip01x0m38bnvf1gim825caa"; }; - propagatedBuildInputs = with perlPackages; [IOString Graph XMLLibXSLT ]; + propagatedBuildInputs = with perlPackages; [ IOString Graph XMLLibXSLT ]; }; XMLDOMXPath = buildPerlPackage rec { @@ -117,7 +117,7 @@ let url = "mirror://cpan/authors/id/M/MI/MIROD/${name}.tar.gz"; sha256 = "1si9m1pqih3ibbd6jnw69fh98dd4krxpx90p65x9j4aja55afwq1"; }; - propagatedBuildInputs= with perlPackages; [XMLDOM XMLXPathEngine]; + propagatedBuildInputs = with perlPackages; [ XMLDOM XMLXPathEngine ]; doCheck = false; }; @@ -215,10 +215,10 @@ let name = "alleleCount.pl-${version}"; version = "4.0.1"; src = fetchFromGitHub { - owner = "cancerit"; - repo = "alleleCount"; - rev = "v${version}"; - sha256 = "0nkwnjqglgshzhlmz1r0khdjai9mfz4ih8bzrzg0g18d1725k6gp"; + owner = "cancerit"; + repo = "alleleCount"; + rev = "v${version}"; + sha256 = "0nkwnjqglgshzhlmz1r0khdjai9mfz4ih8bzrzg0g18d1725k6gp"; }; preConfigure = '' cd perl @@ -266,4 +266,5 @@ let ]; }; -in ascatNGS +in +ascatNGS diff --git a/tools/ascat-callCNV.nix b/tools/ascat-callCNV.nix index f74bb18..aa1a8ec 100644 --- a/tools/ascat-callCNV.nix +++ b/tools/ascat-callCNV.nix @@ -1,12 +1,12 @@ { bionix , ref , gc -, indexAttrs ? {} -, bamIndexAttrs ? {} +, indexAttrs ? { } +, bamIndexAttrs ? { } , flags ? null }: -{tumour, normal, gender}: +{ tumour, normal, gender }: with bionix; with lib; diff --git a/tools/ascat.nix b/tools/ascat.nix index 700cb4e..142e0d9 100644 --- a/tools/ascat.nix +++ b/tools/ascat.nix @@ -1,17 +1,17 @@ -{bionix}: +{ bionix }: with bionix; { - app = pkgs.callPackage ./ascat-app.nix {}; + app = pkgs.callPackage ./ascat-app.nix { }; /* Generate GC correction file for ascatNGS. - Type: gccorrect :: {ref :: fasta, chrPrefix :: string, ...} -> (snps :: VCF) -> (gc :: GC) + Type: gccorrect :: {ref :: fasta, chrPrefix :: string, ...} -> (snps :: VCF) -> (gc :: GC) */ gccorrect = callBionixE ./ascat-gccorrect.nix; /* Call CNVs using ascatNGS. Gender is a string as per ascatNGS docs (e.g., "XX"). - Type: callCNV :: {ref :: fasta, gc :: GC, ...} -> {tumour :: bam, normal :: bam, gender :: string} -> CNVs + Type: callCNV :: {ref :: fasta, gc :: GC, ...} -> {tumour :: bam, normal :: bam, gender :: string} -> CNVs */ callCNV = callBionixE ./ascat-callCNV.nix; } diff --git a/tools/bowtie-align.nix b/tools/bowtie-align.nix index c83c49c..8df3dba 100644 --- a/tools/bowtie-align.nix +++ b/tools/bowtie-align.nix @@ -2,7 +2,7 @@ , ref , bamOutput ? true , flags ? null -, indexAttrs ? {} +, indexAttrs ? { } }: { input1 @@ -18,7 +18,8 @@ let fa = f: matchFiletype "bowtie2-ref" { fa = _: f; } f; fq = f: matchFiletype "bowtie2-input" { fq = _: f; gz = matchFiletype' "bowtie2-input" { fq = _: f; }; } f; -in stage { +in +stage { name = "bowtie2-align"; buildInputs = with pkgs; [ bowtie2 bc samtools ]; buildCommand = '' @@ -32,6 +33,6 @@ in stage { ${optionalString bamOutput "| samtools view -b"} \ > $out ''; - passthru.filetype = if bamOutput then filetype.bam {ref = ref; sorting = sort.none {};} else filetype.sam {ref = ref; sorting = sort.name {};}; + passthru.filetype = if bamOutput then filetype.bam { inherit ref; sorting = sort.none { }; } else filetype.sam { inherit ref; sorting = sort.name { }; }; passthru.multicore = true; } diff --git a/tools/bowtie.nix b/tools/bowtie.nix index df97d36..2208dff 100644 --- a/tools/bowtie.nix +++ b/tools/bowtie.nix @@ -4,12 +4,12 @@ with bionix; { /* Align a sequence against a reference - Type: align :: {ref :: fasta, bamOutput :: bool, ...} -> {input1 :: fastq, input2 :: fastq} -> bam/sam + Type: align :: {ref :: fasta, bamOutput :: bool, ...} -> {input1 :: fastq, input2 :: fastq} -> bam/sam */ align = callBionixE ./bowtie-align.nix; /* Create a Bowtie index - Type: index :: {seed :: int, ...} -> fasta -> index + Type: index :: {seed :: int, ...} -> fasta -> index */ index = callBionixE ./bowtie-index.nix; } diff --git a/tools/bwa-mem.nix b/tools/bwa-mem.nix index 31c9487..52e73d1 100644 --- a/tools/bwa-mem.nix +++ b/tools/bwa-mem.nix @@ -2,7 +2,7 @@ , ref , bamOutput ? true , flags ? null -, indexAttrs ? {} +, indexAttrs ? { } }: { input1 @@ -18,7 +18,8 @@ let fa = f: matchFiletype "bwa-ref" { fa = _: f; } f; fq = f: matchFiletype "bwa-input" { fq = _: f; gz = matchFiletype' "bwa-input" { fq = _: f; }; } f; -in stage { +in +stage { name = "bwa-mem"; buildInputs = with pkgs; [ bwa bc ] ++ optional bamOutput samtools; buildCommand = '' @@ -35,6 +36,6 @@ in stage { ${optionalString bamOutput "| samtools view -b"} \ > $out ''; - passthru.filetype = if bamOutput then filetype.bam {ref = ref; sorting = sort.none {};} else filetype.sam {ref = ref; sorting = sort.name {};}; + passthru.filetype = if bamOutput then filetype.bam { inherit ref; sorting = sort.none { }; } else filetype.sam { inherit ref; sorting = sort.name { }; }; passthru.multicore = true; } diff --git a/tools/bwa-mem2-app.nix b/tools/bwa-mem2-app.nix index 49f4af3..6ee2ab4 100644 --- a/tools/bwa-mem2-app.nix +++ b/tools/bwa-mem2-app.nix @@ -1,5 +1,5 @@ { clangStdenv, fetchFromGitHub, zlib }: - clangStdenv.mkDerivation rec { +clangStdenv.mkDerivation rec { pname = "bwa-mem2"; version = "2.1"; src = fetchFromGitHub { diff --git a/tools/bwa-mem2.nix b/tools/bwa-mem2.nix index b16b7ea..843c5b0 100644 --- a/tools/bwa-mem2.nix +++ b/tools/bwa-mem2.nix @@ -2,7 +2,7 @@ , ref , bamOutput ? true , flags ? null -, indexAttrs ? {} +, indexAttrs ? { } }: { input1 @@ -18,7 +18,8 @@ let fa = f: matchFiletype "bwa-ref" { fa = _: f; } f; fq = f: matchFiletype "bwa-input" { fq = _: f; gz = matchFiletype' "bwa-input" { fq = _: f; }; } f; -in stage { +in +stage { name = "bwa-mem2"; buildInputs = with pkgs; [ bionix.bwa.app2 bc ] ++ optional bamOutput samtools; buildCommand = '' @@ -35,6 +36,6 @@ in stage { ${optionalString bamOutput "| samtools view -b"} \ > $out ''; - passthru.filetype = if bamOutput then filetype.bam {ref = ref; sorting = sort.none {};} else filetype.sam {ref = ref; sorting = sort.name {};}; + passthru.filetype = if bamOutput then filetype.bam { inherit ref; sorting = sort.none { }; } else filetype.sam { inherit ref; sorting = sort.name { }; }; passthru.multicore = true; } diff --git a/tools/bwa.nix b/tools/bwa.nix index 90a8bd3..6fb7d71 100644 --- a/tools/bwa.nix +++ b/tools/bwa.nix @@ -3,18 +3,18 @@ with bionix; rec { - app2 = pkgs.callPackage ./bwa-mem2-app.nix {}; + app2 = pkgs.callPackage ./bwa-mem2-app.nix { }; /* Align read against a reference: defaults to bwa-mem */ align = bionix.bwa.mem; /* Align reads against a reference using bwa-mem - Type: bwa-mem :: {ref :: fasta, bamOutput :: bool, ...} -> {input1, input2} -> bam/sam + Type: bwa-mem :: {ref :: fasta, bamOutput :: bool, ...} -> {input1, input2} -> bam/sam */ mem = callBionixE ./bwa-mem.nix; mem2 = callBionixE ./bwa-mem2.nix; /* Creates an reference index for BWA - Type: index :: {...} -> fasta -> BWA index + Type: index :: {...} -> fasta -> BWA index */ index = callBionixE ./bwa-index.nix; index2 = callBionixE ./bwa-index2.nix; diff --git a/tools/cnvkit-batch.nix b/tools/cnvkit-batch.nix index 113e0c9..7f7893f 100644 --- a/tools/cnvkit-batch.nix +++ b/tools/cnvkit-batch.nix @@ -1,17 +1,18 @@ -{bionix -,targets ? null -,annotations ? null -,flags ? null -,indexAttrs ? {}}: +{ bionix +, targets ? null +, annotations ? null +, flags ? null +, indexAttrs ? { } +}: -{normals ? [], tumours}: +{ normals ? [ ], tumours }: with bionix; with lib; with types; let - getref = f: matchFiletype "cnvkit-batch" { bam = {ref, ...}: ref; } f; + getref = matchFiletype "cnvkit-batch" { bam = { ref, ... }: ref; }; refs = map getref normals ++ map getref tumours; ref = head refs; sorted = matchFileSorting "cnvkit-batch" { coord = _: true; }; diff --git a/tools/cnvkit-scatter.nix b/tools/cnvkit-scatter.nix index 2899584..6cd5b96 100644 --- a/tools/cnvkit-scatter.nix +++ b/tools/cnvkit-scatter.nix @@ -1,5 +1,6 @@ -{bionix -,flags ? null}: +{ bionix +, flags ? null +}: input: diff --git a/tools/cnvkit.nix b/tools/cnvkit.nix index fc55d94..812652a 100644 --- a/tools/cnvkit.nix +++ b/tools/cnvkit.nix @@ -1,15 +1,15 @@ -{bionix}: +{ bionix }: with bionix; { /* Call CNVs - Type: callCNV :: {targets :: target file, annotations :: annotation file, ...} -> {normals :: [bam], tumours :: [bam]} -> CNVs + Type: callCNV :: {targets :: target file, annotations :: annotation file, ...} -> {normals :: [bam], tumours :: [bam]} -> CNVs */ callCNV = callBionixE ./cnvkit-batch.nix; /* Scatter plot from CNV calls - Type: scatterPlot :: {} -> CNVs -> PDF + Type: scatterPlot :: {} -> CNVs -> PDF */ scatterPlot = callBionixE ./cnvkit-scatter.nix; } diff --git a/tools/compression-bunzip2.nix b/tools/compression-bunzip2.nix index 06fe682..a36b66d 100644 --- a/tools/compression-bunzip2.nix +++ b/tools/compression-bunzip2.nix @@ -1,4 +1,4 @@ -{bionix}: +{ bionix }: with bionix; diff --git a/tools/compression-bzip2.nix b/tools/compression-bzip2.nix index 6dfb749..5332e7d 100644 --- a/tools/compression-bzip2.nix +++ b/tools/compression-bzip2.nix @@ -1,4 +1,4 @@ -{bionix}: +{ bionix }: with bionix; diff --git a/tools/compression-gunzip.nix b/tools/compression-gunzip.nix index 6c98f91..96a4e49 100644 --- a/tools/compression-gunzip.nix +++ b/tools/compression-gunzip.nix @@ -1,4 +1,4 @@ -{bionix}: +{ bionix }: with bionix; diff --git a/tools/compression-gzip.nix b/tools/compression-gzip.nix index 50fca9e..0229b94 100644 --- a/tools/compression-gzip.nix +++ b/tools/compression-gzip.nix @@ -1,4 +1,4 @@ -{bionix}: +{ bionix }: with bionix; diff --git a/tools/compression.nix b/tools/compression.nix index bfcc292..c9c8777 100644 --- a/tools/compression.nix +++ b/tools/compression.nix @@ -1,4 +1,4 @@ -{bionix}: +{ bionix }: with bionix; with types; @@ -8,42 +8,51 @@ let gunzip = callBionixE ./compression-gunzip.nix; bunzip2 = callBionixE ./compression-bunzip2.nix; -in { - uncompress = attrs: f: matchFiletype "uncompress" { - fa = _: f; - fq = _: f; - bam = _: f; - sam = _: f; - cram = _: f; - vcf = _: f; - bed = _: f; - gz = _: gunzip attrs f; - bz2 = _: bunzip2 attrs f; - } f; +in +{ + uncompress = attrs: f: matchFiletype "uncompress" + { + fa = _: f; + fq = _: f; + bam = _: f; + sam = _: f; + cram = _: f; + vcf = _: f; + bed = _: f; + gz = _: gunzip attrs f; + bz2 = _: bunzip2 attrs f; + } + f; gzip = attrs: f: let gz = gzip attrs f; - in types.matchFiletype "compressed" { - fa = _: gz; - fq = _: gz; - bam = _: gz; - sam = _: gz; - cram = _: gz; - vcf = _: gz; - bed = _: gz; - gz = x: x; - } f; + in + types.matchFiletype "compressed" + { + fa = _: gz; + fq = _: gz; + bam = _: gz; + sam = _: gz; + cram = _: gz; + vcf = _: gz; + bed = _: gz; + gz = x: x; + } + f; bzip2 = attrs: f: let bz2 = bzip2 attrs f; - in types.matchFiletype "compressed" { - fa = _: gz; - fq = _: gz; - bam = _: gz; - sam = _: gz; - cram = _: gz; - vcf = _: gz; - bed = _: gz; - bz2 = x: x; - } f; + in + types.matchFiletype "compressed" + { + fa = _: gz; + fq = _: gz; + bam = _: gz; + sam = _: gz; + cram = _: gz; + vcf = _: gz; + bed = _: gz; + bz2 = x: x; + } + f; } diff --git a/tools/crumble-app.nix b/tools/crumble-app.nix index fc30d5a..d8ed1a7 100644 --- a/tools/crumble-app.nix +++ b/tools/crumble-app.nix @@ -1,4 +1,4 @@ -{stdenv, fetchFromGitHub, autoreconfHook, htslib}: +{ stdenv, fetchFromGitHub, autoreconfHook, htslib }: stdenv.mkDerivation rec { name = "crumble-${version}"; diff --git a/tools/crumble.nix b/tools/crumble.nix index 4256f37..dfb4e31 100644 --- a/tools/crumble.nix +++ b/tools/crumble.nix @@ -3,5 +3,5 @@ with bionix; { - crumble = pkgs.callPackage ./crumble-app.nix {}; + crumble = pkgs.callPackage ./crumble-app.nix { }; } diff --git a/tools/delly-call.nix b/tools/delly-call.nix index 5378810..80084be 100644 --- a/tools/delly-call.nix +++ b/tools/delly-call.nix @@ -1,4 +1,4 @@ -{ bionix, flags ? "", faidxAttrs ? {}, indexAttrs ? {}}: +{ bionix, flags ? "", faidxAttrs ? { }, indexAttrs ? { } }: inputs: @@ -41,6 +41,6 @@ stage { ''; passthru = { multicore = true; - filetype = filetype.vcf { ref = ref; }; + filetype = filetype.vcf { inherit ref; }; }; } diff --git a/tools/delly.nix b/tools/delly.nix index d94457c..22d4d89 100644 --- a/tools/delly.nix +++ b/tools/delly.nix @@ -4,7 +4,7 @@ with bionix; { /* Call structural variants - Type: call { ... } -> [bam] -> vcf + Type: call { ... } -> [bam] -> vcf */ call = callBionixE ./delly-call.nix; } diff --git a/tools/facets-app.nix b/tools/facets-app.nix index 6553a67..fe2a31b 100644 --- a/tools/facets-app.nix +++ b/tools/facets-app.nix @@ -1,8 +1,9 @@ -{buildRPackage -,fetchFromGitHub -,R -,htslib -,zlib}: +{ buildRPackage +, fetchFromGitHub +, R +, htslib +, zlib +}: let pctGCdata = buildRPackage rec { @@ -18,7 +19,8 @@ let buildInputs = [ R ]; }; -in buildRPackage rec{ +in +buildRPackage rec{ name = "facets-${version}"; version = "0.6.1"; requireX = false; diff --git a/tools/facets-call.nix b/tools/facets-call.nix index a736627..43c4c7f 100644 --- a/tools/facets-call.nix +++ b/tools/facets-call.nix @@ -1,6 +1,6 @@ -{bionix}: +{ bionix }: -{vcf, bams}: +{ vcf, bams }: with bionix; with types; diff --git a/tools/facets.nix b/tools/facets.nix index 14110a9..b91e422 100644 --- a/tools/facets.nix +++ b/tools/facets.nix @@ -1,12 +1,12 @@ -{bionix}: +{ bionix }: with bionix; { - app = lib.callPackageWith (pkgs // pkgs.rPackages) ./facets-app.nix {}; + app = lib.callPackageWith (pkgs // pkgs.rPackages) ./facets-app.nix { }; /* Call CNVs - Type: callCnv :: {...} -> {vcf, bams :: [bams]} -> CNVs + Type: callCnv :: {...} -> {vcf, bams :: [bams]} -> CNVs */ callCNV = callBionixE ./facets-call.nix; } diff --git a/tools/fastp-check.nix b/tools/fastp-check.nix index 06f00ae..9467cd9 100644 --- a/tools/fastp-check.nix +++ b/tools/fastp-check.nix @@ -1,10 +1,10 @@ { bionix , flags ? null -} : +}: { input1 , input2 ? null -} : +}: with bionix; with lib; @@ -15,26 +15,27 @@ let out = stage { - name = "fastp"; - buildInputs = [ pkgs.fastp ]; - outputs = [ "out" "fastq1" "json" ] ++ (if input2 != null then [ "fastq2" ] else []); - buildCommand = '' - mkdir -p $out - fastp \ - ${optionalString (flags != null) flags} \ - -i ${fq input1} \ - -o fastq1.fq.gz \ - ${optionalString (input2 != null) '' - -I ${fq input2} \ - -O fastq2.fq.gz \ + name = "fastp"; + buildInputs = [ pkgs.fastp ]; + outputs = [ "out" "fastq1" "json" ] ++ (if input2 != null then [ "fastq2" ] else [ ]); + buildCommand = '' + mkdir -p $out + fastp \ + ${optionalString (flags != null) flags} \ + -i ${fq input1} \ + -o fastq1.fq.gz \ + ${optionalString (input2 != null) '' + -I ${fq input2} \ + -O fastq2.fq.gz \ - cp fastq2.fq.gz $fastq2 - ''} + cp fastq2.fq.gz $fastq2 + ''} - cp fastq1.fq.gz $fastq1 - cp fastp.html $out - cp fastp.json $json - ''; + 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 {}) + fqgz = { filetype = filetype.gz (filetype.fastq { }); }; +in +out // { fastq1 = out.fastq1 // fqgz; } // (if input2 != null then { fastq2 = out.fastq2 // fqgz; } else { }) diff --git a/tools/fastp.nix b/tools/fastp.nix index 36bc690..454d100 100644 --- a/tools/fastp.nix +++ b/tools/fastp.nix @@ -3,9 +3,9 @@ with bionix; rec { - /* Check and filter fastqs + /* Check and filter fastqs Type: { ... } -> { input1, input2 ? null } -> { out :: html, fastq1 :: fastq, fastq2 :: fastq, json :: JSON } - */ - check = callBionixE ./fastp-check.nix; + */ + check = callBionixE ./fastp-check.nix; } diff --git a/tools/fastqc.nix b/tools/fastqc.nix index 6279682..8c448b9 100644 --- a/tools/fastqc.nix +++ b/tools/fastqc.nix @@ -3,10 +3,10 @@ with bionix; { - fastqc = pkgs.callPackage ./fastqc-app.nix {}; + fastqc = pkgs.callPackage ./fastqc-app.nix { }; /* QC check - Type: check :: {...} -> input :: fastq -> report + Type: check :: {...} -> input :: fastq -> report */ check = callBionixE ./fastqc-check.nix; } diff --git a/tools/gridss-assemble.nix b/tools/gridss-assemble.nix index 1a46eae..15e5ca6 100644 --- a/tools/gridss-assemble.nix +++ b/tools/gridss-assemble.nix @@ -1,12 +1,12 @@ { bionix -, bwaIndexAttrs ? {} -, faidxAttrs ? {} -, indexAttrs ? {} -, collectMetricsAttrs ? {} +, bwaIndexAttrs ? { } +, faidxAttrs ? { } +, indexAttrs ? { } +, collectMetricsAttrs ? { } , flags ? null , config ? null , heapSize ? "31g" -, workdirs ? [] +, workdirs ? [ ] , jobIndex ? null , jobNodes ? null }: @@ -36,7 +36,7 @@ let in assert (all sorted inputs); -assert (homoRef); +assert homoRef; stage rec { name = "gridss-assemble"; @@ -70,6 +70,6 @@ stage rec { touch $out cp -r out.gridss.working $work ''; - passthru.filetype = filetype.bam { ref = ref; sorting = sort.none {}; }; + passthru.filetype = filetype.bam { inherit ref; sorting = sort.none { }; }; passthru.multicore = true; } diff --git a/tools/gridss-callVariants.nix b/tools/gridss-callVariants.nix index f42e3f3..ad659de 100644 --- a/tools/gridss-callVariants.nix +++ b/tools/gridss-callVariants.nix @@ -1,7 +1,7 @@ { bionix , blacklist ? null -, bwaIndexAttrs ? {} -, faidxAttrs ? {} +, bwaIndexAttrs ? { } +, faidxAttrs ? { } , flags ? null , config ? null , heapSize ? "31g" @@ -32,22 +32,22 @@ stage rec { done mkdir $out java -ea -Xmx${heapSize} \ - -Dreference_fasta="ref.fa" \ - -Dsamjdk.create_index=true \ - -Dsamjdk.use_async_io_read_samtools=true \ - -Dsamjdk.use_async_io_write_samtools=true \ - -Dsamjdk.use_async_io_write_tribble=true \ - -Dgridss.gridss.output_to_temp_file=true \ - -cp ${bionix.gridss.jar} gridss.CallVariants \ + -Dreference_fasta="ref.fa" \ + -Dsamjdk.create_index=true \ + -Dsamjdk.use_async_io_read_samtools=true \ + -Dsamjdk.use_async_io_write_samtools=true \ + -Dsamjdk.use_async_io_write_tribble=true \ + -Dgridss.gridss.output_to_temp_file=true \ + -cp ${bionix.gridss.jar} gridss.CallVariants \ VERBOSITY=WARNING \ WORKER_THREADS=$NIX_BUILD_CORES \ - TMP_DIR=. \ - WORKING_DIR=. \ + TMP_DIR=. \ + WORKING_DIR=. \ ${optionalString (config != null) ("OPTIONS_FILE=" + bionix.gridss.gridssConfig config)} \ - REFERENCE_SEQUENCE="ref.fa" \ + REFERENCE_SEQUENCE="ref.fa" \ ${concatMapStringsSep " " (i: "INPUT=\"${i}\"") inputs} \ - OUTPUT="$out/gridss.vcf" \ - ASSEMBLY="$out/gridss.bam" \ + OUTPUT="$out/gridss.vcf" \ + ASSEMBLY="$out/gridss.bam" \ ${optionalString (blacklist != null) ("BLACKLIST=" + blacklist)} \ ${optionalString (flags != null) flags} diff --git a/tools/gridss-computeSamTags.nix b/tools/gridss-computeSamTags.nix index de44478..e07f6a5 100644 --- a/tools/gridss-computeSamTags.nix +++ b/tools/gridss-computeSamTags.nix @@ -1,5 +1,10 @@ -{ bionix, bwaIndexAttrs ? { }, faidxAttrs ? { }, flags ? null, config ? null -, heapSize ? "1G" }: +{ bionix +, bwaIndexAttrs ? { } +, faidxAttrs ? { } +, flags ? null +, config ? null +, heapSize ? "1G" +}: with bionix; with lib; @@ -11,7 +16,8 @@ let ref = matchFiletype "gridss-computeSamTags" { bam = x: x.ref; } input; sorted = matchFileSorting "gridss-computeSamTags" { name = _: true; } input; -in assert (sorted); +in +assert sorted; stage rec { name = "gridss-computeSamTags"; diff --git a/tools/gridss-configFile.nix b/tools/gridss-configFile.nix index d6b600e..3d0d3f8 100644 --- a/tools/gridss-configFile.nix +++ b/tools/gridss-configFile.nix @@ -1,37 +1,41 @@ -{bionix}: +{ bionix }: with bionix; with lib; let - attrsToGridssConfigString = attrsToGridssConfigStringPrepend ""; + attrsToGridssConfigString = attrsToGridssConfigStringPrepend ""; - attrsToGridssConfigStringPrepend = prepend: attrs: - concatStringsSep "\n" ( - attrValues ( - mapAttrs - (name: attr: prepend + (iniLine name attr)) - attrs)); + attrsToGridssConfigStringPrepend = prepend: attrs: + concatStringsSep "\n" ( + attrValues ( + mapAttrs + (name: attr: prepend + (iniLine name attr)) + attrs)); - iniLine = name: attr: - let attrType = builtins.typeOf attr; - in - if (iniLineByAttrType ? ${attrType}) - then (iniLineByAttrType.${attrType} name attr) - else builtins.throw ( - "`gridssConfig` cannot convert attribute of type \"" + attrType + "\"."); + iniLine = name: attr: + let attrType = builtins.typeOf attr; + in + if (iniLineByAttrType ? "${attrType}") + then (iniLineByAttrType."${attrType}" name attr) + else + builtins.throw ( + "`gridssConfig` cannot convert attribute of type \"" + attrType + "\"." + ); - iniLineByAttrType = { - string = name: attr: name + " = " + attr; - int = name: attr: name + " = " + builtins.toString attr; - float = name: attr: name + " = " + ( - builtins.head ( - builtins.match "([0-9]+\.0?[1-9]*)0+" (builtins.toString attr))); - bool = name: attr: name + " = " + (if attr == true then "true" else "false"); - set = name: attr: attrsToGridssConfigStringPrepend (name + ".") attr; - # Allows for repeated fields (e.g. for adapters): - list = name: attr: concatStringsSep "\n" (map (x: iniLine name x) attr); - }; -in configAttrs: (pkgs.writeText - "gridss.properties.override" - ((attrsToGridssConfigString configAttrs) + "\n")) + iniLineByAttrType = { + string = name: attr: name + " = " + attr; + int = name: attr: name + " = " + builtins.toString attr; + float = name: attr: name + " = " + ( + builtins.head ( + builtins.match "([0-9]+\.0?[1-9]*)0+" (builtins.toString attr) + )); + bool = name: attr: name + " = " + (if attr then "true" else "false"); + set = name: attrsToGridssConfigStringPrepend (name + "."); + # Allows for repeated fields (e.g. for adapters): + list = name: attr: concatStringsSep "\n" (map (iniLine name) attr); + }; +in +configAttrs: (pkgs.writeText + "gridss.properties.override" + ((attrsToGridssConfigString configAttrs) + "\n")) diff --git a/tools/gridss-extractSVReads.nix b/tools/gridss-extractSVReads.nix index 6691808..ea268cf 100644 --- a/tools/gridss-extractSVReads.nix +++ b/tools/gridss-extractSVReads.nix @@ -1,10 +1,10 @@ { bionix -, dictIndexAttrs ? {} -, faidxAttrs ? {} +, dictIndexAttrs ? { } +, faidxAttrs ? { } , flags ? null , unmappedReads ? false , minClipLength ? 5 -, collectMetricsAttrs ? {} +, collectMetricsAttrs ? { } , config ? null }: diff --git a/tools/gridss-softClipsToSplitReads.nix b/tools/gridss-softClipsToSplitReads.nix index 93d02df..ef53322 100644 --- a/tools/gridss-softClipsToSplitReads.nix +++ b/tools/gridss-softClipsToSplitReads.nix @@ -1,6 +1,6 @@ { bionix -, bwaIndexAttrs ? {} -, faidxAttrs ? {} +, bwaIndexAttrs ? { } +, faidxAttrs ? { } , alignerStreaming ? false , flags ? null , config ? null @@ -37,7 +37,7 @@ stage rec { ${optionalString (config != null) ("OPTIONS_FILE=" + bionix.gridss.gridssConfig config)} \ WORKER_THREADS=$NIX_BUILD_CORES \ ${optionalString (flags != null) flags} - ''; - passthru.filetype = filetype.bam { ref = ref; sorting = sort.none {}; }; + ''; + passthru.filetype = filetype.bam { inherit ref; sorting = sort.none { }; }; passthru.multicore = true; } diff --git a/tools/gridss-variants.nix b/tools/gridss-variants.nix index a5c470a..62a89f6 100644 --- a/tools/gridss-variants.nix +++ b/tools/gridss-variants.nix @@ -1,7 +1,14 @@ -{ bionix, bwaIndexAttrs ? { }, faidxAttrs ? { }, indexAttrs ? { } -, assemblyAttrs ? { }, collectMetricsAttrs ? { } +{ bionix +, bwaIndexAttrs ? { } +, faidxAttrs ? { } +, indexAttrs ? { } +, assemblyAttrs ? { } +, collectMetricsAttrs ? { } , softClipsToSplitReadsAttrs ? { flags = "REALIGN_ENTIRE_READ=true"; } -, config ? null, heapSize ? "4g", shards ? 10 }: +, config ? null +, heapSize ? "4g" +, shards ? 10 +}: with bionix; with lib; @@ -47,15 +54,16 @@ let for f in ${bionix.bwa.index bwaIndexAttrs ref}/*; do ln -s $f done - ${concatMapStringsSep "\n" (linkSV) inputs} + ${concatMapStringsSep "\n" linkSV inputs} ${linkSV assembly} ${concatMapStringsSep "\n" (linkInput collectMetrics collectMetricsAttrs) inputs} ${linkInput collectMetrics collectMetricsAttrs assembly} ''; -in assert (all sorted inputs); -assert (homoRef); +in +assert (all sorted inputs); +assert homoRef; rec { identify = stage rec { @@ -80,7 +88,7 @@ rec { mv out.vcf $out ''; passthru = { - filetype = filetype.vcf { ref = ref; }; + filetype = filetype.vcf { inherit ref; }; gridss.assembly = assembly; multicore = true; }; @@ -115,7 +123,7 @@ rec { mv out.vcf $out ''; passthru = { - filetype = filetype.vcf { ref = ref; }; + filetype = filetype.vcf { inherit ref; }; gridss.assembly = assembly; multicore = true; }; diff --git a/tools/gridss.nix b/tools/gridss.nix index 7372864..db577ad 100644 --- a/tools/gridss.nix +++ b/tools/gridss.nix @@ -10,60 +10,65 @@ rec { }; /* Generate configuration file for GRIDSS. Takes attribute sets to GRIDSS ini style format. - Type: genConfig :: attrSet -> ini file + Type: genConfig :: attrSet -> ini file */ genConfig = callBionix ./gridss-configFile.nix { }; /* Invoke the callVariants tool - Type: callVariants :: {blacklist :: drv = null, config :: ini = null, heapSize :: String = "31g", ...} -> [bam] -> variants + Type: callVariants :: {blacklist :: drv = null, config :: ini = null, heapSize :: String = "31g", ...} -> [bam] -> variants */ callVariants = callBionixE ./gridss-callVariants.nix; /* Invoke computeSamTags tool - Type: computeSamTags :: {config :: ini = null, heapSize :: String = "1G", ...} -> bam -> bam + Type: computeSamTags :: {config :: ini = null, heapSize :: String = "1G", ...} -> bam -> bam */ computeSamTags = callBionixE ./gridss-computeSamTags.nix; /* Invoke softClipsToSplitReads tool - Type: softClipsToSplitReads :: {alignerStreaming :: Bool = false, config :: ini = null, heapSize :: String = "2G", ...} -> bam -> bam + Type: softClipsToSplitReads :: {alignerStreaming :: Bool = false, config :: ini = null, heapSize :: String = "2G", ...} -> bam -> bam */ softClipsToSplitReads = callBionixE ./gridss-softClipsToSplitReads.nix; /* Invoke collectMetrics tool - Type: collectMetrics :: {thresholdCoverage :: Int = 10000, config :: ini = null, heapSize :: String = "1G", ...} -> bam -> metrics + Type: collectMetrics :: {thresholdCoverage :: Int = 10000, config :: ini = null, heapSize :: String = "1G", ...} -> bam -> metrics */ collectMetrics = callBionixE ./gridss-collectMetrics.nix; /* Invoke extractSVReads tool - Type: extractSVReads :: {unmappedReads :: Bool = false, minClipLength :: Int = 5, config :: ini = null, ...} -> bam -> bam + Type: extractSVReads :: {unmappedReads :: Bool = false, minClipLength :: Int = 5, config :: ini = null, ...} -> bam -> bam */ extractSVReads = callBionixE ./gridss-extractSVReads.nix; /* Invoke assembly tool - Type: assemble :: {config :: ini = null, heapSize :: String = "31g", ...} -> [bam] -> bam + Type: assemble :: {config :: ini = null, heapSize :: String = "31g", ...} -> [bam] -> bam */ assemble = callBionixE ./gridss-assemble.nix; shardedAssemble = n: a: input: let - assemblies = genList (i: - bionix.gridss.assemble (a // { - jobNodes = n; - jobIndex = i; - }) input) n; - in if n <= 1 then + assemblies = genList + (i: + bionix.gridss.assemble + (a // { + jobNodes = n; + jobIndex = i; + }) + input) + n; + in + if n <= 1 then bionix.gridss.assemble a input else bionix.gridss.assemble (a // { workdirs = map (a: a.work) assemblies; }) - input; + input; /* Invoke identifyVariants tool - Type: identifyVariants :: {config :: ini = null, heapSize :: String = "4g", ...} -> [bam] -> VCF + Type: identifyVariants :: {config :: ini = null, heapSize :: String = "4g", ...} -> [bam] -> VCF */ identifyVariants = exec (attrs: input: ((callBionix ./gridss-variants.nix attrs) input).identify); /* Invoke annotateVariants tool - Type: annotateVariants :: {config :: ini = null, heapSize :: String = "4g", ...} -> [bam] -> VCF + Type: annotateVariants :: {config :: ini = null, heapSize :: String = "4g", ...} -> [bam] -> VCF */ annotateVariants = exec (attrs: input: ((callBionix ./gridss-variants.nix attrs) input).annotate); @@ -73,7 +78,7 @@ rec { ((callBionix ./gridss-variants.nix attrs) input).annotateAndAssemble); /* Preprocess BAM files to extract SV reads - Type: preprocessBam :: bam -> bam + Type: preprocessBam :: bam -> bam */ preprocessBam = with samtools; flip pipe [ @@ -84,7 +89,7 @@ rec { ]; /* Call SVs: entire pipeline including preprocessing. It is recommended to use this function rather than the individual above tools. - Type: [bam] -> GRIDSS result + Type: [bam] -> GRIDSS result */ call = inputs: gridss.annotateVariants { } (map gridss.preprocessBam inputs); diff --git a/tools/hisat2-align.nix b/tools/hisat2-align.nix index 7a216a6..0a1eb25 100644 --- a/tools/hisat2-align.nix +++ b/tools/hisat2-align.nix @@ -2,7 +2,7 @@ , ref , bamOutput ? true , flags ? null -, indexAttrs ? {} +, indexAttrs ? { } }: { input1 @@ -18,7 +18,8 @@ let fa = f: matchFiletype "hisat2-ref" { fa = _: f; } f; fq = f: matchFiletype "hisat2-input" { fq = _: f; gz = matchFiletype' "hisat2-input" { fq = _: "<(gunzip < ${f})"; }; } f; -in stage { +in +stage { name = "hisat2-align"; buildInputs = with pkgs; [ hisat2 bc samtools ]; buildCommand = '' @@ -33,6 +34,6 @@ in stage { | samtools sort -n \ > $out ''; - passthru.filetype = if bamOutput then filetype.bam {ref = ref; sorting = sort.none {};} else filetype.sam {ref = ref; sorting = sort.name {};}; + passthru.filetype = if bamOutput then filetype.bam { inherit ref; sorting = sort.none { }; } else filetype.sam { inherit ref; sorting = sort.name { }; }; passthru.multicore = true; } diff --git a/tools/hisat2-index.nix b/tools/hisat2-index.nix index ffdb4ed..d9d5cd1 100644 --- a/tools/hisat2-index.nix +++ b/tools/hisat2-index.nix @@ -1,8 +1,8 @@ { bionix , gtf ? null , flags ? null -, extractSpliceSitesAttrs ? {} -, extractExonsAttrs ? {} +, extractSpliceSitesAttrs ? { } +, extractExonsAttrs ? { } }: ref: diff --git a/tools/hisat2.nix b/tools/hisat2.nix index 8cc4ddf..e3e9995 100644 --- a/tools/hisat2.nix +++ b/tools/hisat2.nix @@ -4,12 +4,12 @@ with bionix; rec { /* Align read against a reference - Type: hisat2-mem :: {ref :: fasta, bamOutput :: bool, ...} -> {input1, input2} -> bam/sam + Type: hisat2-mem :: {ref :: fasta, bamOutput :: bool, ...} -> {input1, input2} -> bam/sam */ align = callBionixE ./hisat2-align.nix; /* Creates an reference index for HISAT2 - Type: index :: {...} -> fasta -> HISAT2 index + Type: index :: {...} -> fasta -> HISAT2 index */ index = callBionixE ./hisat2-index.nix; diff --git a/tools/infercnv-app.nix b/tools/infercnv-app.nix index 5114e2f..36b9956 100644 --- a/tools/infercnv-app.nix +++ b/tools/infercnv-app.nix @@ -1,21 +1,22 @@ -{stdenv - ,fetchurl - ,fetchFromGitHub - ,callPackage - ,nettools - ,rPackages - ,rWrapper - ,R - ,jre - ,python - ,pythonPackages - ,darwin - ,gettext - ,gfortran -,makeWrapper}: +{ stdenv +, fetchurl +, fetchFromGitHub +, callPackage +, nettools +, rPackages +, rWrapper +, R +, jre +, python +, pythonPackages +, darwin +, gettext +, gfortran +, makeWrapper +}: let - buildRPackage = rPackages.buildRPackage; + inherit (rPackages) buildRPackage; GMD = buildRPackage rec { name = "GMD-${version}"; @@ -59,7 +60,7 @@ let owner = "broadinstitute"; repo = "inferCNV"; rev = "cf442af0db6191fa8ba57c4921ac2d1f98c2c39d"; - sha256 = "0cv8qiaqpd6b4152dplnzvgv77cmk961rmvzr27qgmlaazc5hblh"; + sha256 = "0cv8qiaqpd6b4152dplnzvgv77cmk961rmvzr27qgmlaazc5hblh"; }; propagatedBuildInputs = with rPackages; [ R GMD NGCHMR RColorBrewer gplots optparse logging ]; }; @@ -75,9 +76,10 @@ let sha256 = "1pz710ig8nnydz329ry8fydccbrp3arp614dgba3bcyy9flm3gnw"; }; -in stdenv.mkDerivation rec { - name = inferCNV.name; - src = inferCNV.src; +in +stdenv.mkDerivation rec { + inherit (inferCNV) name; + inherit (inferCNV) src; buildInputs = [ r makeWrapper py ]; propagatedBuildInputs = [ jre ]; installPhase = '' diff --git a/tools/infercnv-infer.nix b/tools/infercnv-infer.nix index 0915691..e499f6c 100644 --- a/tools/infercnv-infer.nix +++ b/tools/infercnv-infer.nix @@ -1,12 +1,14 @@ -{bionix -,flags ? null}: +{ bionix +, flags ? null +}: with bionix; with lib; -{ref -,expr -,pos}: +{ ref +, expr +, pos +}: stage { name = "inferCNV"; diff --git a/tools/infercnv.nix b/tools/infercnv.nix index 71ed274..86ffb74 100644 --- a/tools/infercnv.nix +++ b/tools/infercnv.nix @@ -1,8 +1,8 @@ -{bionix}: +{ bionix }: with bionix; { - app = callPackage ./infercnv-app.nix {}; - infercnv = callBionixE ./infercnv-infer.nix {}; + app = callPackage ./infercnv-app.nix { }; + infercnv = callBionixE ./infercnv-infer.nix { }; } diff --git a/tools/kallisto-index.nix b/tools/kallisto-index.nix index 3b92d38..074a953 100644 --- a/tools/kallisto-index.nix +++ b/tools/kallisto-index.nix @@ -1,6 +1,7 @@ -{bionix +{ bionix , kmerSize ? 31 -, unique ? false}: +, unique ? false +}: with bionix; with lib; diff --git a/tools/kallisto-quant.nix b/tools/kallisto-quant.nix index 3efeaaa..b7481d8 100644 --- a/tools/kallisto-quant.nix +++ b/tools/kallisto-quant.nix @@ -1,5 +1,5 @@ -{bionix -, indexFlags ? {} +{ bionix +, indexFlags ? { } , bias ? false , bootstrapSamples ? 0 , seed ? 42 @@ -10,7 +10,8 @@ , rfStranded ? false , fragmentLength ? null , fragmentSD ? null -, ref}: +, ref +}: with bionix; with lib; @@ -21,7 +22,7 @@ inputs: let inherit (bionix.types) matchFiletype'; - isFastQ = matchFiletype' "kallisto-quant" {fq = _: true; gz = isFastQ; }; + isFastQ = matchFiletype' "kallisto-quant" { fq = _: true; gz = isFastQ; }; empty = ./kallisto-quant-empty.h5; @@ -45,7 +46,7 @@ let in -assert (all (x: isFastQ (x.filetype)) inputs); +assert (all (x: isFastQ x.filetype) inputs); stage { name = "kallisto-quant"; diff --git a/tools/kallisto.nix b/tools/kallisto.nix index 13de61e..e096d11 100644 --- a/tools/kallisto.nix +++ b/tools/kallisto.nix @@ -1,4 +1,4 @@ -{bionix}: +{ bionix }: with bionix; @@ -6,7 +6,7 @@ with bionix; index = callBionixE ./kallisto-index.nix; /* Quantify reads against a transcriptome - Type: { bias :: bool, bootstrapSamples :: int, seed :: int, plaintext :: bool, fusion :: bool, single :: bool, frStranded :: bool, rfStranded :: bool, fragmentLength :: Int, fragmentSD :: real } -> [fastq] -> kallisto + Type: { bias :: bool, bootstrapSamples :: int, seed :: int, plaintext :: bool, fusion :: bool, single :: bool, frStranded :: bool, rfStranded :: bool, fragmentLength :: Int, fragmentSD :: real } -> [fastq] -> kallisto */ quant = callBionixE ./kallisto-quant.nix; } diff --git a/tools/last-align.nix b/tools/last-align.nix index b2c8460..b326877 100644 --- a/tools/last-align.nix +++ b/tools/last-align.nix @@ -1,7 +1,7 @@ { bionix , ref , flags ? null -, indexAttrs ? {} +, indexAttrs ? { } }: { input1 @@ -16,10 +16,11 @@ let fa = f: matchFiletype "last-ref" { fa = _: f; } f; fq = f: matchFiletype "last-input" { fq = _: f; } f; fqfa = f: matchFiletype "last-input" { fq = _: f; fa = _: f; } f; - Q = f: matchFiletype "last-input" { fq = _: 1; fa = _: 0; } f; - parallel = f: matchFiletype "last-input" { fq = _: "parallel-fastq"; fa = _: "parallel-fasta"; } f; + Q = matchFiletype "last-input" { fq = _: 1; fa = _: 0; }; + parallel = matchFiletype "last-input" { fq = _: "parallel-fastq"; fa = _: "parallel-fasta"; }; -in stage { +in +stage { name = "last-align"; buildInputs = with pkgs; [ last ]; buildCommand = '' diff --git a/tools/last.nix b/tools/last.nix index 3755bde..870bfe6 100644 --- a/tools/last.nix +++ b/tools/last.nix @@ -4,7 +4,7 @@ with bionix; rec { /* Align reads against a reference genome - Type: { ref :: fastq, ... } -> { input1, input2} -> last + Type: { ref :: fastq, ... } -> { input1, input2} -> last */ align = callBionixE ./last-align.nix; index = callBionixE ./last-index.nix; diff --git a/tools/lumpy-call.nix b/tools/lumpy-call.nix index fffc329..56ac650 100644 --- a/tools/lumpy-call.nix +++ b/tools/lumpy-call.nix @@ -21,7 +21,8 @@ let ''; }; -in assert (length (unique refs) == 1); +in +assert (length (unique refs) == 1); stage { name = "lumpy"; @@ -36,5 +37,5 @@ stage { ${flags} \ -o $out ''; - passthru.filetype = filetype.vcf { ref = ref; }; + passthru.filetype = filetype.vcf { inherit ref; }; } diff --git a/tools/lumpy.nix b/tools/lumpy.nix index f82134e..59c968f 100644 --- a/tools/lumpy.nix +++ b/tools/lumpy.nix @@ -4,7 +4,7 @@ with bionix; { /* Call structural variants - Type: { ... } -> [bam] -> vcf + Type: { ... } -> [bam] -> vcf */ call = callBionixE ./lumpy-call.nix; } diff --git a/tools/manta-call.nix b/tools/manta-call.nix index 099d5e6..21cbeba 100644 --- a/tools/manta-call.nix +++ b/tools/manta-call.nix @@ -1,6 +1,6 @@ -{ bionix, indexAttrs ? {}, faidxAttrs ? {}, flags ? "" }: +{ bionix, indexAttrs ? { }, faidxAttrs ? { }, flags ? "" }: -{ normals ? [], tumour ? null }: +{ normals ? [ ], tumour ? null }: with bionix; with lib; @@ -8,7 +8,7 @@ with types; let getref = matchFiletype "manta-call" { bam = x: x.ref; }; - refs = map getref normals ++ optionals (tumour != null) [(getref tumour)]; + refs = map getref normals ++ optionals (tumour != null) [ (getref tumour) ]; ref = head refs; renameAndIndex = f: stage { diff --git a/tools/manta.nix b/tools/manta.nix index b34753f..dba8669 100644 --- a/tools/manta.nix +++ b/tools/manta.nix @@ -4,7 +4,7 @@ with bionix; { /* Call structural variants - Type: { ... } -> { normals :: [bam], tumour :: bam } -> manta + Type: { ... } -> { normals :: [bam], tumour :: bam } -> manta */ call = callBionixE ./manta-call.nix; } diff --git a/tools/minimap2-align.nix b/tools/minimap2-align.nix index a6de0b7..18bca35 100644 --- a/tools/minimap2-align.nix +++ b/tools/minimap2-align.nix @@ -18,7 +18,8 @@ let fa = f: matchFiletype "minimap2-ref" { fa = _: f; } f; fq = f: matchFiletype "minimap2-input" { fq = _: f; gz = matchFiletype' "minimap2-input" { fq = _: f; }; } f; -in stage { +in +stage { name = "minimap2-align"; buildInputs = with pkgs; [ minimap2 bc ] ++ optional bamOutput samtools; buildCommand = '' @@ -32,6 +33,6 @@ in stage { ${optionalString bamOutput "| samtools view -b"} \ > $out ''; - passthru.filetype = if bamOutput then filetype.bam {ref = ref; sorting = sort.none {};} else filetype.sam {ref = ref; sorting = sort.none {};}; + passthru.filetype = if bamOutput then filetype.bam { inherit ref; sorting = sort.none { }; } else filetype.sam { inherit ref; sorting = sort.none { }; }; passthru.multicore = true; } diff --git a/tools/minimap2.nix b/tools/minimap2.nix index e1d6af5..59439ef 100644 --- a/tools/minimap2.nix +++ b/tools/minimap2.nix @@ -4,7 +4,7 @@ with bionix; rec { /* Align read against a reference - * Type: align :: {ref :: fasta, bamOutput :: bool, preset :: string, ...} -> {input1, input2} -> bam/sam + * Type: align :: {ref :: fasta, bamOutput :: bool, preset :: string, ...} -> {input1, input2} -> bam/sam */ align = callBionixE ./minimap2-align.nix; } diff --git a/tools/mosdepth-depth.nix b/tools/mosdepth-depth.nix index 2dbfc8d..2a72989 100644 --- a/tools/mosdepth-depth.nix +++ b/tools/mosdepth-depth.nix @@ -1,5 +1,5 @@ { bionix -, indexAttrs ? {} +, indexAttrs ? { } , flags ? null }: diff --git a/tools/mosdepth-plot.nix b/tools/mosdepth-plot.nix index f98ae23..87eb67f 100644 --- a/tools/mosdepth-plot.nix +++ b/tools/mosdepth-plot.nix @@ -7,7 +7,8 @@ with bionix; with lib; { inputs -, names ? []}: +, names ? [ ] +}: stage { name = "mosdepth-plot"; diff --git a/tools/mosdepth.nix b/tools/mosdepth.nix index cbebdfb..91c30e5 100644 --- a/tools/mosdepth.nix +++ b/tools/mosdepth.nix @@ -4,12 +4,12 @@ with bionix; { /* Compute coverage of a reference given an alignemnt - Type: { ... } -> bam -> mosdepth + Type: { ... } -> bam -> mosdepth */ depth = callBionixE ./mosdepth-depth.nix; /* Plot sample coverages. Names are optional. - Type: { ... } -> { inputs :: [mosdepth], names :: [string] } -> html + Type: { ... } -> { inputs :: [mosdepth], names :: [string] } -> html */ plot = callBionixE ./mosdepth-plot.nix; } diff --git a/tools/mutect-app.nix b/tools/mutect-app.nix index ca78d34..ad1515c 100644 --- a/tools/mutect-app.nix +++ b/tools/mutect-app.nix @@ -1,16 +1,19 @@ -{stdenv, fetchurl, makeWrapper, unzip, fetchFromGitHub}: +{ stdenv, fetchurl, makeWrapper, unzip, fetchFromGitHub }: let - oldnix = import (fetchFromGitHub { - owner = "NixOS"; - repo = "nixpkgs"; - rev = "83a893c38a83877588e3ca7ccfeabaa973c30acd"; - sha256 = "0q7214hag7h95irvhkdb648m09b9jspb0raw1qjrx7y4grzb165h"; - }) {}; + oldnix = import + (fetchFromGitHub { + owner = "NixOS"; + repo = "nixpkgs"; + rev = "83a893c38a83877588e3ca7ccfeabaa973c30acd"; + sha256 = "0q7214hag7h95irvhkdb648m09b9jspb0raw1qjrx7y4grzb165h"; + }) + { }; jre = oldnix.openjdk7; -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation rec { name = "mutect-${version}"; version = "1.1.5"; diff --git a/tools/mutect-call.nix b/tools/mutect-call.nix index e98ba4b..52c1e1d 100644 --- a/tools/mutect-call.nix +++ b/tools/mutect-call.nix @@ -1,21 +1,22 @@ -{bionix +{ bionix , cosmic -, dbsnp}: +, dbsnp +}: with bionix; with lib; let inherit (types) matchFiletype; - getVCFref = matchFiletype "mutect-call" {vcf = {ref}: ref;}; - getBAMref = matchFiletype "mutect-call" {bam = {ref, ...}: ref;}; + getVCFref = matchFiletype "mutect-call" { vcf = { ref }: ref; }; + getBAMref = matchFiletype "mutect-call" { bam = { ref, ... }: ref; }; refs = map getVCFref [ cosmic dbsnp ]; ref = head refs; in assert (length (unique refs) == 1); -{normal, tumour}: +{ normal, tumour }: assert (ref == getBAMref normal && ref == getBAMref tumour); diff --git a/tools/mutect.nix b/tools/mutect.nix index addea77..8f40dee 100644 --- a/tools/mutect.nix +++ b/tools/mutect.nix @@ -1,12 +1,12 @@ -{bionix}: +{ bionix }: with bionix; { - app = pkgs.callPackage ./mutect-app.nix {}; + app = pkgs.callPackage ./mutect-app.nix { }; /* Call somatic variants with mutect - Type: { cosmic, dbsnp, ... } -> { normal :: bam, tumour :: bam } -> vcf + Type: { cosmic, dbsnp, ... } -> { normal :: bam, tumour :: bam } -> vcf */ call = callBionixE ./mutect-call.nix; } diff --git a/tools/octopus-call.nix b/tools/octopus-call.nix index 80092e0..81619b6 100644 --- a/tools/octopus-call.nix +++ b/tools/octopus-call.nix @@ -18,7 +18,7 @@ with types; inputs: let - getref = f: matchFiletype "octopus-call" { bam = { ref, ... }: ref; cram = { ref, ... }: ref; } f; + getref = matchFiletype "octopus-call" { bam = { ref, ... }: ref; cram = { ref, ... }: ref; }; refs = map getref inputs; ref = head refs; @@ -63,6 +63,6 @@ stage { ${optionalString (targets != null) (handleTarget targets)} \ ${flags} ''; - passthru.filetype = filetype.vcf { ref = ref; }; + passthru.filetype = filetype.vcf { inherit ref; }; passthru.multicore = true; } diff --git a/tools/octopus-callSomatic.nix b/tools/octopus-callSomatic.nix index 401eeb8..df41550 100644 --- a/tools/octopus-callSomatic.nix +++ b/tools/octopus-callSomatic.nix @@ -31,7 +31,7 @@ let ''; inputs = [ normal ] ++ tumours; - getref = f: matchFiletype "octopus-callSomatic" { bam = { ref, ... }: ref; cram = { ref, ... }: ref; } f; + getref = matchFiletype "octopus-callSomatic" { bam = { ref, ... }: ref; cram = { ref, ... }: ref; }; refs = map getref inputs; ref = head refs; @@ -77,6 +77,6 @@ stage { -N $normal \ ${flags} ''; - passthru.filetype = filetype.vcf { ref = ref; }; + passthru.filetype = filetype.vcf { inherit ref; }; passthru.multicore = true; } diff --git a/tools/octopus.nix b/tools/octopus.nix index 858d133..7c21758 100644 --- a/tools/octopus.nix +++ b/tools/octopus.nix @@ -4,12 +4,12 @@ with bionix; { /* Call variants for a population - Type: { fast :: bool, very-fast :: bool, max-genotypes :: int, targets :: FilePath + [string], ... } -> [bam] -> vcf + Type: { fast :: bool, very-fast :: bool, max-genotypes :: int, targets :: FilePath + [string], ... } -> [bam] -> vcf */ call = callBionixE ./octopus-call.nix; - + /* Call somatic variants - Type: { fast :: bool, very-fast :: bool, max-genotypes :: int, targets :: FilePath + [string], ... } -> { normal :: bam, tumours :: [bam] } -> vcf + Type: { fast :: bool, very-fast :: bool, max-genotypes :: int, targets :: FilePath + [string], ... } -> { normal :: bam, tumours :: [bam] } -> vcf */ callSomatic = callBionixE ./octopus-callSomatic.nix; } diff --git a/tools/picard-markDuplicates.nix b/tools/picard-markDuplicates.nix index 957a05e..e4b6369 100644 --- a/tools/picard-markDuplicates.nix +++ b/tools/picard-markDuplicates.nix @@ -1,8 +1,8 @@ { bionix , flags ? null -} : +}: -inputBam : +inputBam: with bionix; with lib; @@ -10,24 +10,24 @@ with types; assert (matchFiletype "picard-markDuplicates" { bam = _: true; } inputBam); assert (matchFileSorting - "picard-markDuplicates" - { coord = _: true; name = _: true; } - inputBam); + "picard-markDuplicates" + { coord = _: true; name = _: true; } + inputBam); # Note that picard markDuplicates has different behaviour depending on whether the input # is name-sorted or coordinate-sorted. stage { - name = "picard-markDuplicates"; - buildInputs = with pkgs; - [ picard-tools ]; - outputs = [ "out" "metrics" ]; - buildCommand = '' - picard MarkDuplicates \ - I=${inputBam} \ - O=$out \ - M=$metrics \ - ${optionalString (flags != null) flags} - ''; - passthru.filetype = inputBam.filetype; + name = "picard-markDuplicates"; + buildInputs = with pkgs; + [ picard-tools ]; + outputs = [ "out" "metrics" ]; + buildCommand = '' + picard MarkDuplicates \ + I=${inputBam} \ + O=$out \ + M=$metrics \ + ${optionalString (flags != null) flags} + ''; + passthru.filetype = inputBam.filetype; } diff --git a/tools/picard.nix b/tools/picard.nix index 4246afe..3cb61a1 100644 --- a/tools/picard.nix +++ b/tools/picard.nix @@ -3,8 +3,8 @@ with bionix; { - /* Mark duplicates + /* Mark duplicates Type: { ... } -> bam -> bam - */ - markDuplicates = callBionixE ./picard-markDuplicates.nix; -} \ No newline at end of file + */ + markDuplicates = callBionixE ./picard-markDuplicates.nix; +} diff --git a/tools/platypus-callVariants.nix b/tools/platypus-callVariants.nix index bb0faf1..59a224b 100644 --- a/tools/platypus-callVariants.nix +++ b/tools/platypus-callVariants.nix @@ -1,6 +1,6 @@ { bionix -, indexAttrs ? {} -, bamIndexAttrs ? {} +, indexAttrs ? { } +, bamIndexAttrs ? { } , flags ? null }: @@ -13,7 +13,7 @@ with types; let filename = path: last (splitString "/" path); - getref = f: matchFiletype "platypus-callVariants" { bam = {ref, ...}: ref; } f; + getref = matchFiletype "platypus-callVariants" { bam = { ref, ... }: ref; }; refs = map getref inputs; ref = head refs; in @@ -38,6 +38,6 @@ stage { # Remove timestamps from output sed -i '/^##fileDate/d' $out ''; - passthru.filetype = filetype.vcf {ref = ref;}; + passthru.filetype = filetype.vcf { inherit ref; }; passthru.multicore = true; } diff --git a/tools/platypus.nix b/tools/platypus.nix index c93a2d8..29e7e08 100644 --- a/tools/platypus.nix +++ b/tools/platypus.nix @@ -4,7 +4,7 @@ with bionix; { /* Call variants - Type: { ... } -> [bam] -> vcf + Type: { ... } -> [bam] -> vcf */ call = callBionixE ./platypus-callVariants.nix; } diff --git a/tools/sambamba.nix b/tools/sambamba.nix index 3c1d1fd..77289fe 100644 --- a/tools/sambamba.nix +++ b/tools/sambamba.nix @@ -5,34 +5,35 @@ with bionix; let gen = callBionixE ./sambamba-generic.nix; -in { +in +{ /* Sort aligned reads - Type: { nameSort :: bool, ... } -> bam -> bam + Type: { nameSort :: bool, ... } -> bam -> bam */ sort = callBionixE ./sambamba-sort.nix; /* Build an index - Type: { ... } -> bam -> index + Type: { ... } -> bam -> index */ - index = def gen {tool = "index"; }; + index = def gen { tool = "index"; }; /* Merge bam files - Type: { ... } -> [bam] -> bam + Type: { ... } -> [bam] -> bam */ - merge = def gen {tool = "merge"; }; + merge = def gen { tool = "merge"; }; /* Slice a region out of a bam file - Type: { region, ... } -> bam -> bam + Type: { region, ... } -> bam -> bam */ - slice = def gen {tool = "slice"; }; + slice = def gen { tool = "slice"; }; /* Compute flag statistics - Type: { ... } -> bam -> flagstat + Type: { ... } -> bam -> flagstat */ - flagstat = def gen {tool = "flagstat"; }; + flagstat = def gen { tool = "flagstat"; }; /* Mark duplicates - Type: { ... } -> bam -> bam + Type: { ... } -> bam -> bam */ - markdup = def gen {tool = "markdup"; }; + markdup = def gen { tool = "markdup"; }; } diff --git a/tools/samtools-merge.nix b/tools/samtools-merge.nix index 792ee52..ff8ea00 100644 --- a/tools/samtools-merge.nix +++ b/tools/samtools-merge.nix @@ -10,8 +10,8 @@ with lib; let inherit (bionix.types) matchFiletype matchSorting; - inputIsHomogenous = length (unique (map (matchFiletype "samtools-merge" {bam = x: x // {sorting = matchSorting "samtools-merge" {coord = _: "coord"; name = _: "name"; } x;};}) inputs)) == 1; - nameSorted = matchFiletype "samtools-merge" { bam = x: matchSorting "samtools-merge" {coord = _: false; name = _: true;} x;} (lib.head inputs); + inputIsHomogenous = length (unique (map (matchFiletype "samtools-merge" { bam = x: x // { sorting = matchSorting "samtools-merge" { coord = _: "coord"; name = _: "name"; } x; }; }) inputs)) == 1; + nameSorted = matchFiletype "samtools-merge" { bam = matchSorting "samtools-merge" { coord = _: false; name = _: true; }; } (lib.head inputs); in assert inputIsHomogenous; diff --git a/tools/samtools-sort.nix b/tools/samtools-sort.nix index e3fbff8..30439f1 100644 --- a/tools/samtools-sort.nix +++ b/tools/samtools-sort.nix @@ -17,9 +17,10 @@ assert (matchFiletype "samtools-sort" { bam = _: true; sam = _: true; cram = _: let outfmtR = if outfmt != null then outfmt input else input.filetype; - outFmtFlags = matchFiletype "samtools-sort-outfmt" { bam = _: "-O BAM"; sam = _: "-O SAM"; cram = ref: "-O CRAM -T ${ref}"; } {filetype = outfmtR;}; - alreadySorted = matchFileSorting "samtools-sort" { name = _: nameSort; coord = _: !nameSort; none = _: false;} input; -in stage { + outFmtFlags = matchFiletype "samtools-sort-outfmt" { bam = _: "-O BAM"; sam = _: "-O SAM"; cram = ref: "-O CRAM -T ${ref}"; } { filetype = outfmtR; }; + alreadySorted = matchFileSorting "samtools-sort" { name = _: nameSort; coord = _: !nameSort; none = _: false; } input; +in +stage { name = "samtools-sort"; buildInputs = with pkgs; [ samtools ]; buildCommand = diff --git a/tools/samtools-view.nix b/tools/samtools-view.nix index 35a3fcb..4d2bdc7 100644 --- a/tools/samtools-view.nix +++ b/tools/samtools-view.nix @@ -15,8 +15,9 @@ assert (matchFiletype "samtools-view" { bam = _: true; sam = _: true; cram = _: let outfmtR = if outfmt != null then (if builtins.typeOf outfmt == "string" then { "bam" = toBam; "cram" = toCram; "sam" = toSam; }."${outfmt}" else outfmt) input else input.filetype; fa = ref: matchFiletype "samtools-view-ref" { fa = _: ref; } ref; - outfmtFlags = matchFiletype "samtools-view-outfmt" { bam = _: "-O BAM"; sam = _: "-O SAM"; cram = x: "-O CRAM -T ${fa x.ref}"; } {filetype = outfmtR;}; -in stage { + outfmtFlags = matchFiletype "samtools-view-outfmt" { bam = _: "-O BAM"; sam = _: "-O SAM"; cram = x: "-O CRAM -T ${fa x.ref}"; } { filetype = outfmtR; }; +in +stage { name = "samtools-view"; buildInputs = with pkgs; [ samtools ]; buildCommand = '' diff --git a/tools/snap-align.nix b/tools/snap-align.nix index 279cf20..f0bcb21 100644 --- a/tools/snap-align.nix +++ b/tools/snap-align.nix @@ -2,7 +2,7 @@ , ref , bamOutput ? true , flags ? null -, indexAttrs ? {} +, indexAttrs ? { } }: { input1 @@ -18,7 +18,8 @@ let fa = f: matchFiletype "snap-ref" { fa = _: f; } f; fq = f: matchFiletype "snap-input" { fq = _: f; gz = matchFiletype' "snap-input" { fq = _: f; }; } f; -in stage { +in +stage { name = "snap-align"; buildInputs = with pkgs; [ bionix.snap.app bc ] ++ optional bamOutput samtools; buildCommand = '' @@ -32,6 +33,6 @@ in stage { ${optionalString (flags != null) flags} \ | samtools sort -n > $out ''; - passthru.filetype = if bamOutput then filetype.bam {ref = ref; sorting = sort.none {};} else filetype.sam {ref = ref; sorting = sort.name {};}; + passthru.filetype = if bamOutput then filetype.bam { inherit ref; sorting = sort.none { }; } else filetype.sam { inherit ref; sorting = sort.name { }; }; passthru.multicore = true; } diff --git a/tools/snap-app.nix b/tools/snap-app.nix index c845d1f..0e74a20 100644 --- a/tools/snap-app.nix +++ b/tools/snap-app.nix @@ -1,4 +1,4 @@ -{stdenv, fetchFromGitHub, zlib}: +{ stdenv, fetchFromGitHub, zlib }: stdenv.mkDerivation rec { name = "snap-git"; diff --git a/tools/snap.nix b/tools/snap.nix index 851c51a..51df5dc 100644 --- a/tools/snap.nix +++ b/tools/snap.nix @@ -3,15 +3,15 @@ with bionix; rec { - app = pkgs.callPackage ./snap-app.nix {}; + app = pkgs.callPackage ./snap-app.nix { }; /* Align reads against a reference - Type: snap :: {ref :: fasta, bamOutput :: bool, ...} -> {input1, input2} -> bam/sam + Type: snap :: {ref :: fasta, bamOutput :: bool, ...} -> {input1, input2} -> bam/sam */ align = callBionixE ./snap-align.nix; /* Creates an reference index for SNAP - Type: index :: {...} -> fasta -> SNAP index + Type: index :: {...} -> fasta -> SNAP index */ index = callBionixE ./snap-index.nix; } diff --git a/tools/snpeff-annotate.nix b/tools/snpeff-annotate.nix index 317d303..9324f47 100644 --- a/tools/snpeff-annotate.nix +++ b/tools/snpeff-annotate.nix @@ -1,7 +1,8 @@ -{bionix -,db -,heapSize ? "31g" -,flags ? ""}: +{ bionix +, db +, heapSize ? "31g" +, flags ? "" +}: input: diff --git a/tools/snpeff-dbnsfp.nix b/tools/snpeff-dbnsfp.nix index 518c121..003f7f8 100644 --- a/tools/snpeff-dbnsfp.nix +++ b/tools/snpeff-dbnsfp.nix @@ -1,7 +1,8 @@ -{bionix -,dbnsfp -,heapSize ? "31g" -,flags ? ""}: +{ bionix +, dbnsfp +, heapSize ? "31g" +, flags ? "" +}: input: diff --git a/tools/snpeff.nix b/tools/snpeff.nix index fb3f4a9..45a0edc 100644 --- a/tools/snpeff.nix +++ b/tools/snpeff.nix @@ -1,15 +1,15 @@ -{bionix}: +{ bionix }: with bionix; { /* Annotate variants with SNPEff database. Some annotation DBs available in bionix.ref (e.g., bionix.ref.grch38.snpeff.db). - Type: { db, ... } -> vcf -> vcf + Type: { db, ... } -> vcf -> vcf */ annotate = callBionixE ./snpeff-annotate.nix; - + /* Annotate variants with dbNSFP database. Some dbNSFP annotation DBs available in bionix.ref (e.g., bionix.ref.grch38.snpeff.dbNSFP). - Type: { dbnsfp, ... } -> vcf -> vcf + Type: { dbnsfp, ... } -> vcf -> vcf */ dbnsfp = callBionixE ./snpeff-dbnsfp.nix; } diff --git a/tools/snver-call.nix b/tools/snver-call.nix index 72562c7..2ad4b72 100644 --- a/tools/snver-call.nix +++ b/tools/snver-call.nix @@ -11,7 +11,7 @@ with types; let config = pkgs.writeText "pool.txt" (concatMapStringsSep "\n" (x: "${x}\t${toString ploidy}\t1") (attrValues inputs)); - getref = f: matchFiletype "SNVer-call" { bam = {ref, ...}: ref; } f; + getref = matchFiletype "SNVer-call" { bam = { ref, ... }: ref; }; refs = mapAttrsToList (_: getref) inputs; ref = head refs; in diff --git a/tools/snver.nix b/tools/snver.nix index 6f95e1b..c5799ec 100644 --- a/tools/snver.nix +++ b/tools/snver.nix @@ -4,10 +4,10 @@ with bionix; with pkgs; { - app = callPackage ./snver-app.nix {}; + app = callPackage ./snver-app.nix { }; /* Call variants - Type: { ploidy, ... } -> [bam] -> vcf + Type: { ploidy, ... } -> [bam] -> vcf */ call = callBionix ./snver-call.nix; } diff --git a/tools/star-align.nix b/tools/star-align.nix index 44dd7f2..670c6bf 100644 --- a/tool