genomeHelp="* [genomeID] must be defined in the script, e.g. \"hg19\" or \"mm10\" (default \n\"$genomeID\"); alternatively, it can be defined using the -z command"
dirHelp="* [topDir] is the top level directory (default\n\"$topDir\")\n [topDir]/fastq must contain the fastq files\n [topDir]/splits will be created to contain the temporary split files\n [topDir]/aligned will be created for the final alignment"
siteHelp="* [site] must be defined in the script, e.g. \"HindIII\" or \"MboI\"\n (default \"$site\")"
@@ -98,6 +98,8 @@ pathHelp="* [chrom.sizes path]: enter path for chrom.sizes file"
siteFileHelp="* [restriction site file]: enter path for restriction site file (locations of\n restriction sites in genome; can be generated with the script\n misc/generate_site_positions.py)"
scriptDirHelp="* [Juicer scripts directory]: set the Juicer directory,\n which should have scripts/ references/ and restriction_sites/ underneath it\n (default ${juiceDir})"
refSeqHelp="* [reference genome file]: enter path for reference sequence file, BWA index\n files must be in same directory"
ligationHelp="* [ligation junction]: use this string when counting ligation junctions"
threadsHelp="* [threads]: number of threads when running BWA alignment"
excludeHelp="* -x: exclude fragment-delimited maps from hic file creation"
helpHelp="* -h: print this help and exit"
@@ -114,6 +116,8 @@ printHelpAndExit() {
echo-e"$siteFileHelp"
echo-e"$refSeqHelp"
echo-e"$scriptDirHelp"
echo-e"$ligationHelp"
echo-e"$threadsHelp"
echo"$excludeHelp"
echo"$helpHelp"
exit"$1"
@@ -134,6 +138,8 @@ while getopts "d:g:R:a:hrs:p:y:z:S:D:x" opt; do
S)stage=$OPTARG;;
D)juiceDir=$OPTARG;;
x)nofrag=1 ;;#no fragment maps
b)ligation=$OPTARG;;
t)threads=$OPTARG;;
[?]) printHelpAndExit 1;;
esac
done
@@ -171,23 +177,25 @@ else
if[-z"$genomePath"]
then
echo"***! You must define a chrom.sizes file via the \"-p\" flag that delineates the lengths of the chromosomes in the genome at $refSeq";
exit 100;
exit 1;
fi
fi
## Check that refSeq exists
if[!-e"$refSeq"];then
echo"***! Reference sequence $refSeq does not exist";
exit 100;
exit 1;
fi
## Check that index for refSeq exists
if[!-e"${refSeq}.bwt"];then
echo"***! Reference sequence $refSeq does not appear to have been indexed. Please run bwa index on this file before running juicer.";
exit 100;
exit 1;
fi
## Set ligation junction based on restriction enzyme
if[-z"$ligation"]
then
case$sitein
HindIII)ligation="AAGCTAGCTT";;
DpnII)ligation="GATCGATC";;
@@ -198,6 +206,7 @@ case $site in
echo"$site not listed as recognized enzyme. Using $site_file as site file"
echo"Ligation junction is undefined"
esac
fi
## If DNAse-type experiment, no fragment maps
if["$site"=="none"]
@@ -212,7 +221,7 @@ case $shortreadend in
2);;
*)echo"$usageHelp"
echo"$shortHelp2"
exit 100
exit 1
esac
if[-z"$site_file"]
@@ -224,7 +233,16 @@ fi
if[!-e"$site_file"]&&["$nofrag"-ne 1 ]
then
echo"***! $site_file does not exist. It must be created before running this script."
exit 100
exit 1
fi
## Set threads for sending appropriate parameters to cluster and string for BWA call
if[!-z"$threads"]
then
threadstring="-t $threads"
else
threads="$(getconf _NPROCESSORS_ONLN)"
threadstring="-t $threads"
fi
## Directories to be created and regex strings for listing files
@@ -239,7 +257,7 @@ if [ ! -d "$topDir/fastq" ]; then
echo"Directory \"$topDir/fastq\" does not exist."
echo"Create \"$topDir/fastq\" and put fastq files to be aligned there."
echo"Type \"juicer.sh -h\" for help"
exit 100
exit 1
else
if stat-t${fastqdir}>/dev/null 2>&1
then
@@ -248,7 +266,7 @@ else
if[!-d"$splitdir"];then
echo"***! Failed to find any files matching ${fastqdir}"