diff options
author | Justin Bedo <cu@cua0.org> | 2023-05-25 11:50:52 +1000 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2023-10-10 13:26:17 +1100 |
commit | 7372c27ea3930ad464b05a6c3ab4fd6348eb3abd (patch) | |
tree | 02e578175470bf5a095469bb1e2a1f1bb0f5db2c | |
parent | 59edb7d9c37a688c8c408508c1a9ae5d37df348f (diff) |
ampliconarchitect: init
-rw-r--r-- | default.nix | 1 | ||||
-rw-r--r-- | tools/aa-app.nix | 57 | ||||
-rw-r--r-- | tools/aa-call.nix | 31 | ||||
-rw-r--r-- | tools/aa.nix | 7 |
4 files changed, 96 insertions, 0 deletions
diff --git a/default.nix b/default.nix index 62b6d3c..529dddd 100644 --- a/default.nix +++ b/default.nix @@ -55,6 +55,7 @@ let hatchet = callBionix ./tools/hatchet.nix { }; pizzly = callBionix ./tools/pizzly.nix { }; quip = callBionix ./tools/quip.nix { }; + ampliconarchitect = callBionix ./tools/aa.nix { }; slurm-run = callPackage ./lib/slurm.nix { }; slurm-exec = f: x: y: diff --git a/tools/aa-app.nix b/tools/aa-app.nix new file mode 100644 index 0000000..4b782b3 --- /dev/null +++ b/tools/aa-app.nix @@ -0,0 +1,57 @@ +{ + stdenv, + fetchurl, + fetchFromGitHub, + python3, +}: let + python = python3.withPackages (pkgs: + with pkgs; [ + numpy + scipy + pysam + matplotlib + future + (mosek pkgs) + ]); + + mosek = assert stdenv.system == "x86_64-linux"; + pkgs: + pkgs.buildPythonPackage { + pname = "mosek"; + version = "8.1.0.83"; + src = fetchurl { + url = "https://download.mosek.com/stable/8.1.0.83/mosektoolslinux64x86.tar.bz2"; + sha256 = "sha256-d/S/IalmQwizWYZ89ZskUoVAaXWYszuw7w+w0Vp+13k"; + }; + doCheck = false; + preBuild = '' + cd 8/tools/platform/linux64x86/python/3/ + ''; + propagatedBuildInputs = with pkgs; [numpy]; + postInstall = '' + find $out -name lib\*.so\* -print0 | xargs -0 \ + patchelf --add-rpath ${stdenv.cc.cc.lib}/lib + ''; + }; +in + stdenv.mkDerivation rec { + pname = "AmpliconArchitect"; + version = "1.3"; + + src = fetchFromGitHub { + owner = "virajbdeshpande"; + repo = pname; + rev = "40da8520a953810ad43e5a6fdf4aba7449d7f5e0"; + sha256 = "sha256-4SAOpdjXiZFTfpD6WpLfs2zDyGT2hcWabl+sUjboBpc="; + }; + + doBuild = false; + installPhase = '' + mkdir -p $out/libexec + cp -r src $out/libexec/aa + mkdir $out/bin + ln -s $out/libexec/aa/{AmpliconArchitect,amplified_intervals,ref_util,downsample}.py $out/bin + ''; + + buildInputs = [python]; + } diff --git a/tools/aa-call.nix b/tools/aa-call.nix new file mode 100644 index 0000000..1c6a121 --- /dev/null +++ b/tools/aa-call.nix @@ -0,0 +1,31 @@ +{ + bionix, + seeds, + license, + flags ? "", + downsample ? 0.1, + ... +}: input: +with bionix; let + indexedBam = linkOutputs { + "input.bam" = input; + "input.bam.bai" = samtools.index {} input; + }; +in + stage { + name = "aa-call"; + MOSEKLM_LICENSE_FILE = license; + buildInputs = [bionix.ampliconarchitect.app]; + buildCommand = '' + mkdir $out + export AA_DATA_REPO=$TMPDIR + tar -xzf ${self.aa.ref} + AmpliconArchitect.py \ + --bam ${indexedBam}/input.bam \ + --bed ${seeds} \ + --ref GRCh38 \ + --out $out/out \ + --downsample ${toString downsample} \ + $flags + ''; + } diff --git a/tools/aa.nix b/tools/aa.nix new file mode 100644 index 0000000..6010c43 --- /dev/null +++ b/tools/aa.nix @@ -0,0 +1,7 @@ +{bionix}: +with bionix; + +{ + app = pkgs.callPackage ./aa-app.nix { }; + call = callBionixE ./aa-call.nix { }; +} |