Skip to content

Commit

Permalink
New: hmftools-cobalt; Update: hmftools-purple (#11507)
Browse files Browse the repository at this point in the history
- hmftools-cobalt: Add latest version of PURPLE associated read counter,
  COBALT, with support for hg38.
- hmftools-purple: PURPLE release with hg38 support.
  • Loading branch information
chapmanb authored and karel-brinda committed Oct 31, 2018
1 parent 34d423f commit 5936927
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 2 deletions.
69 changes: 69 additions & 0 deletions recipes/hmftools-cobalt/COBALT.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash
# hmftools COBALT executable shell script
# https://github.com/hartwigmedical/hmftools/tree/master/count-bam-lines
set -eu -o pipefail

export LC_ALL=en_US.UTF-8

# Find original directory of bash script, resolving symlinks
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

JAR_DIR=$DIR
ENV_PREFIX="$(dirname $(dirname $DIR))"
# Use Java installed with Anaconda to ensure correct version
java="$ENV_PREFIX/bin/java"

# if JAVA_HOME is set (non-empty), use it. Otherwise keep "java"
if [ -n "${JAVA_HOME:=}" ]; then
if [ -e "$JAVA_HOME/bin/java" ]; then
java="$JAVA_HOME/bin/java"
fi
fi

# extract memory and system property Java arguments from the list of provided arguments
# http://java.dzone.com/articles/better-java-shell-script
default_jvm_mem_opts="-Xms512m -Xmx1g"
jvm_mem_opts=""
jvm_prop_opts=""
pass_args=""
for arg in "$@"; do
case $arg in
'-D'*)
jvm_prop_opts="$jvm_prop_opts $arg"
;;
'-XX'*)
jvm_prop_opts="$jvm_prop_opts $arg"
;;
'-Xm'*)
jvm_mem_opts="$jvm_mem_opts $arg"
;;
*)
if [[ ${pass_args} == '' ]] #needed to avoid preceeding space on first arg e.g. ' MarkDuplicates'
then
pass_args="$arg"
else
pass_args="$pass_args \"$arg\"" #quotes later arguments to avoid problem with ()s in MarkDuplicates regex arg
fi
;;
esac
done

if [ "$jvm_mem_opts" == "" ]; then
jvm_mem_opts="$default_jvm_mem_opts"
fi

pass_arr=($pass_args)
if [[ ${pass_arr[0]:=} == org* ]]
then
eval "$java" $jvm_mem_opts $jvm_prop_opts -cp "$JAR_DIR/cobalt.jar" $pass_args
else
eval "$java" $jvm_mem_opts $jvm_prop_opts -jar "$JAR_DIR/cobalt.jar" $pass_args
fi
exit
12 changes: 12 additions & 0 deletions recipes/hmftools-cobalt/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

TGT="$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM"
[ -d "$TGT" ] || mkdir -p "$TGT"
[ -d "${PREFIX}/bin" ] || mkdir -p "${PREFIX}/bin"

cd "${SRC_DIR}"
mv cobalt*.jar $TGT/cobalt.jar

cp $RECIPE_DIR/COBALT.sh $TGT/COBALT
ln -s $TGT/COBALT $PREFIX/bin
chmod 0755 "${PREFIX}/bin/COBALT"
29 changes: 29 additions & 0 deletions recipes/hmftools-cobalt/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% set version = "1.5" %}
{% set sha256 = "f3faa2b0d63beab5a074f0cc9e3841c083c3ff7eb4b7d06fdff6f538148d18bb" %}

package:
name: hmftools-cobalt
version: '{{ version }}'

source:
url: https://github.com/hartwigmedical/hmftools/releases/download/cobalt-v{{ version|replace(".", "-") }}/cobalt-{{ version }}.jar
sha256: '{{ sha256 }}'

build:
noarch: generic
number: 0

requirements:
run:
- openjdk >=8

test:
commands:
- 'COBALT 2>&1 | grep version'
- 'COBALT 2>&1 | grep usage'

about:
home: https://github.com/hartwigmedical/hmftools/tree/master/count-bam-lines
license: MIT
license_family: MIT
summary: Count bam lines is designed to count the number of read starts within each 1000 base window of a tumor and reference bam.
4 changes: 2 additions & 2 deletions recipes/hmftools-purple/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% set version = "2.15" %}
{% set sha256 = "8846f6711e98c411ef4f42549d472c0b3f5c5535e2ee654f9ac19ba5ffc6faa9" %}
{% set version = "2.16" %}
{% set sha256 = "d6143fda59d10b9fcda6299bbe8a9180a1c1adb63e65cb1888166274f746c796" %}

package:
name: hmftools-purple
Expand Down

0 comments on commit 5936927

Please sign in to comment.