...
 
Commits (2)
......@@ -25,7 +25,7 @@ if [ "$cluster" = "mogon" ]; then
_arg_queue="nodeshort"
else
_arg_queue="parallel"
_arg_constraint="skylake"
_arg_constraint="broadwell"
fi
_arg_dependency=""
_arg_tag=""
......@@ -38,7 +38,7 @@ _arg_qtrim_format="i1.8"
SCRIPT="$0"
SCRIPT_VERSION="0.3.1"
SCRIPT_VERSION="0.3.2"
die()
{
......@@ -132,6 +132,9 @@ credits()
echo "- v0.3.1 -- 22. Feb. 2019 -- bug fixes:"
echo " - striping only, when creating unstriped output dir on MII"
echo " - preventing to write to HOME"
echo "- v0.3.2 -- 18. Oct. 2019 -- bug fixes:"
echo " - mate file was corrupted for paired end cases"
echo " - -o flag appropriately working, now"
echo
echo "This script was written by Christian Meesters 2018-2019 (ZDV, HPC group)".
echo "See https://gitlab.rlp.net/hpc-jgu-lifescience/seq-analysis/blob/master/LICENSE"
......@@ -525,7 +528,7 @@ samples=$(find -L $(realpath "$_arg_inputdir") -type f \( -iname \*.fastq\* -o -
read -r -a samples <<< $samples
if [ ${#samples[@]} -eq 0 ]; then
error "no input found (was looking for '*gz', '*fastq' and '*fq')."
error "no input found (was looking for '*fastq*' and '*fq*')."
exit 1
fi
......@@ -543,40 +546,44 @@ if [ $_arg_paired -eq 1 ]; then
fi
fi
# assume to be true by default
compression=".gz"
# determine the actual suffix, to determine the compression / no compression type
# just look on the first file
ffile=${samples[0]}
if [ ${ffile: -4} = ".bz2" ]; then
compression=".bz2"
elif [ ${ffile: -3} = ".gz" ]; then
compression=".gz"
else
compression=""
# now, we have figured out, which - in paired end scenarios - is the mate pattern
# overwrite the samples and start afresh
set +e
set -o pipefail
samples=$(find $(realpath $_arg_inputdir) -name '*.gz' | grep -v $second)
# hit something?
if [ ! -z "$samples" ]; then
# transform into array
read -r -a samples <<< $samples
compression='.gz'
fi
if [ ${#samples[@]} -eq 0 ]; then
samples=$(find $(realpath $_arg_inputdir) -name '*bz2' | grep -v $second)
# nothing found?
if [ -z "$samples" ]; then
samples=$(find $(realpath $_arg_inputdir) -name '*.bz2' | grep -v $second)
# transform into array
read -r -a samples <<< $samples
compression='.bz2'
fi
if [ ${#samples[@]} -eq 0 ]; then
samples=$(find $(realpath $_arg_inputdir) -name '*fastq' | grep -v $second)
#if [ ${#samples[@]} -eq 0 ]; then
if [ -z "$samples" ]; then
samples=$(find $(realpath $_arg_inputdir) -name '*.fastq' | grep -v $second)
# transform into array
read -r -a samples <<< $samples
compression=''
fi
if [ ${#samples[@]} -eq 0 ]; then
samples=$(find $(realpath $_arg_inputdir) -name '*fq' | grep -v $second)
#if [ ${#samples[@]} -eq 0 ]; then
if [ -z "$samples" ]; then
samples=$(find $(realpath $_arg_inputdir) -name '*.fq' | grep -v $second)
# transform into array
read -r -a samples <<< $samples
compression=''
fi
if [ ${#samples[@]} -eq 0 ]; then
error "no input found (was looking for '*gz', '*fastq' and '*fq')."
#if [ ${#samples[@]} -eq 0 ]; then
if [ -z "$samples" ]; then
error "no input found (was looking for '*.gz', '*.bz2', '*.fastq' or '*.fq')."
exit 1
fi
set -e
### special case for jgu-cbdm
if [[ "$cluster" = "mogon" && "$_arg_assoc" = "jgu-cbdm" ]]; then
......@@ -587,7 +594,6 @@ fi
JOBTAG="QC_on_$(basename $_arg_inputdir)"
if [[ ! -z "${_arg_tag/ /}" ]]; then
JOBTAG=${_arg_tag}
>>>>>>> update_mapper
fi
INPUTDIR=$_arg_inputdir
......@@ -673,7 +679,6 @@ if [ -z "$SLURM_JOB_ID" ]; then
script_statement="${script_statement} $INPUTDIR"
# paste them together
submit_statement="${submit_statement} ${script_statement}"
echo $submit_statement
if [[ $_arg_test == "on" ]]; then
exit
fi
......