ncpus=${4:-1}# If parameter is unset or null, the expansion of word is substituted (see https://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion)
if[[-z${bamlist}||-z${input}||-z${outprefix}]]
then
usage
echo"At least one argument is missing"
exit 1
fi
outprefix=`realpath-s$outprefix`
if[[!-s$input]]
then
echo"$input is not and existing or non empty file.\nExiting!"
exit 1
fi
input=`realpath-s$input`
bamarray=()
while read line
do
if[[!-s$line]]
then
echo"$line is not and existing or non empty file.\nExiting!"
exit 1
fi
path=`realpath-s$line`
bamarray+=("$path")
done < ${bamlist}
bams=`join_by ','"${bamarray[@]}"`
origdir=`pwd`
tempdir=`mktemp-d`
cd$tempdir
echo"Working in $tempdir"
# genotype the Structural variants (and parallelize the job)