genomeHelp=" genomeID must be defined in the script, e.g. \"hg19\" or \"mm10\" (default \"$genomeID\")"
dirHelp=" [topDir] is the top level directory (default \"$topDir\") and must contain links to all merged_nodups files underneath it"
siteHelp=" [site] must be defined in the script, e.g. \"HindIII\" or \"MboI\" (default \"$site\"); alternatively, this can be the restriction site file"
helpHelp=" -h: print this help and exit"
printHelpAndExit(){
echo"$usageHelp"
echo"$genomeHelp"
echo"$dirHelp"
echo"$siteHelp"
echo"$helpHelp"
exit$1
}
while getopts"d:g:hs:" opt;do
case$optin
g)genomeID=$OPTARG;;
h) printHelpAndExit 0;;
d)topDir=$OPTARG;;
s)site=$OPTARG;;
[?]) printHelpAndExit 1;;
esac
done
## Set ligation junction based on restriction enzyme
case$sitein
HindIII)ligation="AAGCTAGCTT";;
DpnII)ligation="GATCGATC";;
MboI)ligation="GATCGATC";;
*)ligation="XXXX"
site_file=$site
echo"$site not listed as recognized enzyme, so trying it as site file."