Skip to content
Snippets Groups Projects
Commit 5ca30c98 authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Update for bats testing.

parent ef5feb0b
Branches
Tags
1 merge request!67Resolve "Rename Plot profile to be consistent with naming"
......@@ -496,7 +496,7 @@ process plotProfile {
script:
"""
module load deeptools/2.5.0.1
bash $baseDir/scripts/plot_profile.sh $gtfFile
bash $baseDir/scripts/plot_profile.sh
"""
}
......
#!/bin/bash
#plot_profile.sh
bws=$(ls *.bw)
gtf=$(ls *.gtf *.bed)
computeMatrix reference-point \
--referencePoint TSS \
-S $bws \
-R $gtf \
--skipZeros \
-o computeMatrix.gz
-p max/2
plotProfile -m computeMatrix.gz \
-out plotProfile.png \
raise()
{
echo "${1}" >&2
}
check_tools() {
raise "
Checking for required libraries and components on this system
"
deeptools --version &> version_deeptools.txt
if [ $? -gt 0 ]
then
raise "Missing deeptools"
return 1
fi
}
compute_matrix() {
raise "
Computing matrix on ${1} using ${2}
"
computeMatrix reference-point \
--referencePoint TSS \
-S ${1} \
-R ${2} \
--skipZeros \
-o computeMatrix.gz \
-p max/2
if [ $? -gt 0 ]
then
raise "Problem building matrix"
return 1
fi
}
plot_profile() {
raise "
Plotting profile
"
plotProfile -m computeMatrix.gz \
-out plotProfile.png
if [ $? -gt 0 ]
then
raise "Problem plotting"
return 1
fi
}
run_main() {
bws=$(ls *.bw)
gtf=$(ls *.gtf *.bed)
check_tools || exit 1
compute_matrix "${bws}" "${gtf}" || return 1
plot_profile || return 1
raise "ALL COMPLETE"
}
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]
then
run_main
if [ $? -gt 0 ]
then
exit 1
fi
fi
#!/opt/bats/libexec/bats-core/ bats
profile_script="./worflow/scripts/plot_profile.sh"
setup() {
module load deeptools/2.5.0.1
}
@test "Test deeptools present" {
source ${profile_script}
run check_tools
assert_success
}
@test "Test matrix generation" {
source ${profile_script}
run check_tools
assert_success
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment