aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/snpeff-annotate.nix21
-rw-r--r--tools/snpeff-dbnsfp.nix22
-rw-r--r--tools/snpeff.nix8
3 files changed, 51 insertions, 0 deletions
diff --git a/tools/snpeff-annotate.nix b/tools/snpeff-annotate.nix
new file mode 100644
index 0000000..a119c3c
--- /dev/null
+++ b/tools/snpeff-annotate.nix
@@ -0,0 +1,21 @@
+{bionix
+,nixpkgs
+,db
+,flags ? ""}:
+
+input:
+
+with nixpkgs;
+with bionix.types;
+
+assert (matchFiletype "snpeff-annotate" { vcf = _: true; } input);
+
+stdenv.mkDerivation {
+ name = "snpeff-annotate";
+ buildCommand = ''
+ ln -s ${db} ${db.name}
+ snpeff -nodownload -dataDir $TMPDIR ${db.name} ${input} > $out
+ '';
+ buildInputs = [ snpeff ];
+ passthru.filetype = input.filetype;
+}
diff --git a/tools/snpeff-dbnsfp.nix b/tools/snpeff-dbnsfp.nix
new file mode 100644
index 0000000..f9fbdaa
--- /dev/null
+++ b/tools/snpeff-dbnsfp.nix
@@ -0,0 +1,22 @@
+{bionix
+,nixpkgs
+,dbnsfp
+,flags ? ""}:
+
+input:
+
+with nixpkgs;
+with bionix.types;
+
+assert (matchFiletype "snpeff-dbnsfp" { vcf = _: true; } input);
+
+stdenv.mkDerivation {
+ name = "snpeff-dbnsfp";
+ buildCommand = ''
+ ln -s ${dbnsfp.db} dbNSFP.txt.gz
+ ln -s ${dbnsfp.index} dbNSFP.txt.gz.tbi
+ snpeff dbnsfp -db dbNSFP.txt.gz ${input} > $out
+ '';
+ buildInputs = [ snpeff ];
+ passthru.filetype = input.filetype;
+}
diff --git a/tools/snpeff.nix b/tools/snpeff.nix
new file mode 100644
index 0000000..2df8056
--- /dev/null
+++ b/tools/snpeff.nix
@@ -0,0 +1,8 @@
+{bionix, nixpkgs}:
+
+with bionix;
+
+{
+ annotate = callBionixE ./snpeff-annotate.nix;
+ dbnsfp = callBionixE ./snpeff-dbnsfp.nix;
+}