Skip to content

Commit

Permalink
use xargs so there's no dep on gargs and make tests work from any dir…
Browse files Browse the repository at this point in the history
…ectory
  • Loading branch information
brentp committed Nov 1, 2016
1 parent 4308d94 commit 62627ea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
17 changes: 12 additions & 5 deletions lumpy_tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,18 @@ test -e ssshtest || wget -q https://raw.githubusercontent.com/ryanlayer/ssshtest
set -o nounset


export LUMPY_HOME=$HOME/lumpy-sv/
export LUMPY=$LUMPY_HOME/bin/lumpy


cd orig
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 )"

export LUMPY_HOME=$DIR/../lumpy-sv/
export LUMPY=$DIR/../bin/lumpy

cd $DIR/orig

wget -nc https://s3.amazonaws.com/lumpy/pe.pos_sorted.bam
wget -nc https://s3.amazonaws.com/lumpy/sr.pos_sorted.bam
Expand Down
14 changes: 1 addition & 13 deletions scripts/lumpy_smooth
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export THREADS=1
export ID_LIST=""

export SAMTOOLS=`which samtools`
export GARGS=`which gargs`

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Expand All @@ -30,7 +29,6 @@ usage()
Path options:
-L LUMPY source directory ($LUMPY_HOME)
-S SAMTOOLS path ($SAMTOOLS)
-G gargs path ($GARGS)
EOF
}

Expand Down Expand Up @@ -65,9 +63,6 @@ case $OPTION in
S)
SAMTOOLS=$OPTARG
;;
G)
GARGS=$OPTARG
;;
?)
usage
exit
Expand All @@ -87,13 +82,6 @@ if [ -z "$SAMTOOLS" ]; then
exit 1
fi

if [ -z "$GARGS" ]; then
echo "ERROR: gargs not found. Set with -G"
usage
exit 1
fi


EXECS="$LUMPY_HOME/bin/lumpy_filter
$SAMTOOLS
$LUMPY_HOME/scripts/pairend_distro.py
Expand Down Expand Up @@ -249,7 +237,7 @@ if [ -z "$BAMS" ];then
fi

export -f BAM_PREP
echo -en $BAMS | $GARGS --procs $THREADS "BAM_PREP {}"
echo -en $BAMS | xargs -I{} -P $THREADS bash -c "BAM_PREP {}"

export GLOBAL_LUMPY="$LUMPY_HOME/bin/lumpy -mw 4 -tt 0 -P $EXCLUDE "

Expand Down

0 comments on commit 62627ea

Please sign in to comment.