-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a test example and functional testing. Fixes #4
- Loading branch information
Showing
7 changed files
with
1,568 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ rp-files/ | |
testdata/ | ||
*.o | ||
*~ | ||
tests/chr* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
# Test all options | ||
for opts in "" "--linear" "--symlink" "--linear --symlink"; do | ||
echo "Testing chopBAI with option $opts" | ||
|
||
|
||
for chr in chrA:B:C:D chrA:B chrB; do | ||
echo " Testing chromosome $chr" | ||
./test.sh $chr $opts | ||
for reg in "100" "2,000" "1-100" "1,000-10,000"; do | ||
chrreg="${chr}:${reg}" | ||
./test.sh $chrreg $opts | ||
done | ||
done | ||
done |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
|
||
REGION=$1 | ||
#clean up directory if it exists | ||
if [[ -d "${REGION}" ]]; then | ||
rm -rf ./${REGION} | ||
fi | ||
|
||
shift 1 | ||
OPTS=$@ | ||
echo "Running command: ../chopBAI ${OPTS} test.sorted.bam ${REGION}" | ||
../chopBAI ${OPTS} test.sorted.bam ${REGION} | ||
|
||
if [[ -d ${REGION} ]]; then | ||
#ok, directory exists | ||
cd ${REGION} | ||
if [[ ! -f test.sorted.bam ]]; then | ||
if [[ $OPTS =~ "--symlink" || $OPTS =~ "-s" ]]; then | ||
echo "Symlink not created!" | ||
exit 1 | ||
else | ||
#we'll just create it ourselves | ||
ln -s ../test.sorted.bam | ||
fi | ||
|
||
samtools view test.sorted.bam ${REGION} > out.chopBAI.sam | ||
samtools view ../test.sorted.bam ${REGION} > out.samtools.sam | ||
diff -q out.chopBAI.sam out.samtools.sam | ||
fi | ||
else | ||
echo "Directory ${REGION} was not created." | ||
exit 1 | ||
fi |
Binary file not shown.
Binary file not shown.