Skip to content

Commit

Permalink
rtg-tools: init at 3.12.1
Browse files Browse the repository at this point in the history
A subset of RTG Core that includes several useful utilities for dealing with VCF files and sequence data.
Mostly used for vcfeval to compare VCF.
  • Loading branch information
apraga committed May 6, 2023
1 parent 5e2d479 commit f5403cb
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pkgs/applications/science/biology/rtg-tools/ant.patch
@@ -0,0 +1,21 @@
--- ./build.xml.orig 2022-10-10 23:41:37.288306508 +0200
+++ ./build.xml 2022-10-10 23:43:22.316061657 +0200
@@ -344,17 +344,10 @@
</javadoc>
</target>

- <scriptdef language="javascript" name="lowercase">
- <attribute name="value" />
- <attribute name="name" />
- project.setProperty(attributes.get("name"), attributes.get("value").toLowerCase());
- </scriptdef>
-
<target name="zip-init" depends="rtg-vcs-info"> <!-- set up properties -->
<tstamp> <format property="build.tstamp" pattern="yyyyMMddHHmm" /></tstamp>
<propertyregex property="almostproductfilename" input="${product}" regexp="\s+" global="true" replace="-" />
- <property name="almostproductfilename" value="${product}" />
- <lowercase name="productfilename" value="${almostproductfilename}" />
+ <property name="productfilename" value="${product}" />
<condition property="zipversion"
value="${productfilename}-${product.version}"
else="${productfilename}-${product.version}-${rtg.vcs.commit.revision}">
49 changes: 49 additions & 0 deletions pkgs/applications/science/biology/rtg-tools/default.nix
@@ -0,0 +1,49 @@
{ config, lib, pkgs, stdenv, fetchFromGitHub, jdk, ant, git, unzip }:

stdenv.mkDerivation rec {
pname = "rtg-tools";
version = "3.12.1";

src = fetchFromGitHub {
owner = "RealTimeGenomics";
repo = "rtg-tools";
rev = version;
sha256 = "sha256-fMrrjrgaGxBVxn6qMq2g0oFv6qtfhZcQlkvv1E9Os6Y=";
};

patches = [
./ant.patch
];

nativeBuildInputs = [
ant
jdk
git
unzip
];

buildPhase = ''
ant rtg-tools.jar
'';

installPhase =''
mkdir -p $out/bin
cp build/rtg-tools.jar $out/bin/RTG.jar
cp installer/rtg $out/bin/
'';

fixupPhase = ''
# Use a location outside nix (must be writable)
sed -i 's|$THIS_DIR/rtg.cfg|$HOME/.rtg.cfg|g' $out/bin/rtg
# Use nix java
sed -i 's|RTG_JAVA="java".*|RTG_JAVA="${jdk}/lib/openjdk/bin/java" # Nix Path to java|' $out/bin/rtg
'';

meta = with lib; {
homepage = "https://github.com/RealTimeGenomics/rtg-tools/";
description = "Useful utilities for dealing with VCF files and sequence data, especially vcfeval";
license = licenses.bsd2;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ apraga ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -37406,6 +37406,8 @@ with pkgs;

raxml-mpi = raxml.override { useMpi = true; };

rtg-tools = callPackage ../applications/science/biology/rtg-tools { };

sambamba = callPackage ../applications/science/biology/sambamba { };

samblaster = callPackage ../applications/science/biology/samblaster { };
Expand Down

0 comments on commit f5403cb

Please sign in to comment.