Commit 93cf42e8 authored by nchernia's avatar nchernia
Browse files

Merge branch 'encode' of https://github.com/aidenlab/juicer into encode

parents a50c79f1 6cb20e29
Loading
Loading
Loading
Loading
+2 −2
Changes for CPU/common/juicer_hiccups.sh: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -78,14 +78,14 @@ fi
if [ -e ${hic_file_path%.*}"_loops" ]
then
    echo -e "\nAPA:\n"
    ${juicer_tools_path} apa ${hic_file_path} ${hic_file_path%.*}"_loops" "apa_results"
    ${juicer_tools_path} apa ${hic_file_path} ${hic_file_path%.*}"_loops/merged_loops.bedpe" "apa_results"
    ## Check that bed folder exists    
    if [ ! -e "${bed_file_dir}" ]; then
	echo "***! Can't find folder ${bed_file_dir}";
	echo "***! Not running motif finder";
    else
	echo -e "\nMOTIF FINDER:\n"
	${juicer_tools_path} motifs ${genomeID} ${bed_file_dir} ${hic_file_path%.*}"_loops"
	${juicer_tools_path} motifs ${genomeID} ${bed_file_dir} ${hic_file_path%.*}"_loops/merged_loops.bedpe"
    fi
    echo -e "\n(-: Feature annotation successfully completed (-:"
else
+1 −1
Changes for CPU/juicer.sh: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -593,7 +593,7 @@ if [ -z $postproc ]
    export IBM_JAVA_OPTIONS="-Xmx1024m -Xgcthreads1"
    export _JAVA_OPTIONS="-Xmx1024m -Xms1024m"
    tail -n1 $headfile | awk '{printf"%-1000s\n", $0}' > $outputdir/inter.txt
    dups=$(samtools view -c -f 1089 -F 256 $outputdir/merged_dedup.bam)
    dups=$(samtools view -c -f 1089 -F 256 $sthreadstring $outputdir/merged_dedup.bam)
    cat $splitdir/*.res.txt | awk -v ligation=$ligation -v dups=$dups -f ${juiceDir}/scripts/common/stats_sub.awk >> $outputdir/inter.txt
    cp $outputdir/inter.txt $outputdir/inter_30.txt

+29 −5
Changes for SLURM/scripts/juicer.sh: 29 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ then
    # Juicer directory, contains scripts/, references/, and restriction_sites/
    # can also be set in options via -D
    # XXX verify / change me
    juiceDir="/gpfs0/juicer"
    juiceDir="/gpfs0/juicer2"
    load_bwa="unset PYTHONPATH; conda activate"
    # default queue, can also be set in options via -q
    queue="mhgcp"
@@ -122,7 +122,7 @@ else
    load_samtools="spack load samtools arch=\`spack arch\`"
    # Juicer directory, contains scripts/, references/, and restriction_sites/
    # can also be set in options via -D
    juiceDir="/gpfs0/juicer"
    juiceDir="/gpfs0/juicer2"
    # default queue, can also be set in options
    queue="commons"
    queue_time="2880"
@@ -163,9 +163,11 @@ justexact=0
assembly=0
# force cleanup
cleanup=0
# qc apa
qc_apa=0

## Read arguments                                                     
usageHelp="Usage: ${0##*/} [-g genomeID] [-d topDir] [-q queue] [-l long queue] [-s site]\n                 [-a about] [-S stage] [-p chrom.sizes path]\n                 [-y restriction site file] [-z reference genome file]\n                 [-C chunk size] [-D Juicer scripts directory]\n                 [-Q queue time limit] [-L long queue time limit] [-b ligation] [-t threads] [-T threadsHic]\n                 [-A account name] [-e] [-h] [-f] [-j] [--assembly] [--cleanup]"
usageHelp="Usage: ${0##*/} [-g genomeID] [-d topDir] [-q queue] [-l long queue] [-s site]\n                 [-a about] [-S stage] [-p chrom.sizes path]\n                 [-y restriction site file] [-z reference genome file]\n                 [-C chunk size] [-D Juicer scripts directory]\n                 [-Q queue time limit] [-L long queue time limit] [-b ligation] [-t threads] [-T threadsHic]\n                 [-A account name] [-e] [-h] [-f] [-j] [--assembly] [--cleanup] [--qc_apa]"
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"
queueHelp="* [queue] is the queue for running alignments (default \"$queue\")"
@@ -244,6 +246,7 @@ while getopts "d:g:a:hq:s:p:l:y:z:S:C:D:Q:L:b:A:i:t:jfec-:T:" opt; do
	-) case "${OPTARG}" in 
	    assembly) earlyexit=1; assembly=1 ;;
	    cleanup)  cleanup=1 ;;
	    qc_apa)   qc_apa=1 ;;
	    *) printHelpAndExit 1;;
           esac;;
	[?]) printHelpAndExit 1;;
@@ -1277,7 +1280,7 @@ FINCLN1`
	    time ${juiceDir}/scripts/juicer_tools pre -n -f $site_file -s $outputdir/inter.txt -g $outputdir/inter_hists.m -q 1 -r 2500000,1000000,500000,250000,100000,50000,25000,10000,5000,2000,1000,500,200,100 $threadHicString $outputdir/merged1.txt $outputdir/inter.hic $genomePath
	fi
	time ${juiceDir}/scripts/juicer_tools addNorm $threadNormString ${outputdir}/inter.hic 
	rm -R ${outputdir}"/HIC_tmp"
	rm -Rf ${outputdir}"/HIC_tmp"
	date
HIC`

@@ -1319,7 +1322,7 @@ HIC`
	    time ${juiceDir}/scripts/juicer_tools pre -n -f $site_file -s $outputdir/inter_30.txt -g $outputdir/inter_30_hists.m -q 30 -r 2500000,1000000,500000,250000,100000,50000,25000,10000,5000,2000,1000,500,200,100 $threadHic30String $outputdir/merged30.txt $outputdir/inter_30.hic $genomePath
	fi
	time ${juiceDir}/scripts/juicer_tools addNorm $threadNormString ${outputdir}/inter_30.hic
	rm -R ${outputdir}"/HIC30_tmp"
	rm -Rf ${outputdir}"/HIC30_tmp"
	date
HIC30`

@@ -1389,6 +1392,27 @@ jid=`sbatch <<- ARROWS | egrep -o -e "\b[0-9]+$"
	date;
ARROWS`
dependarrows="${dependhiccups}:$jid"
if [ "$qc_apa" = 1 ]
then
    jid=`sbatch <<- QC | egrep -o -e "\b[0-9]+$"
	#!/bin/bash -l
	#SBATCH -p $queue
	#SBATCH --mem-per-cpu=4G
	#SBATCH -o $debugdir/qc-%j.out
	#SBATCH -e $debugdir/qc-%j.err
	#SBATCH -t $queue_time
	#SBATCH --ntasks=1
	#SBATCH -J "${groupname}_qc_apa"
	${sbatch_wait}
	$userstring
	${load_java}
	date
	export IBM_JAVA_OPTIONS="-Xmx4000m -Xgcthreads1"                                                                    
        export _JAVA_OPTIONS="-Xmx4000m -Xms4000m" 
	java -jar ${juiceDir}/scripts/juicer_3.25.21_aggNormAPA.jar apa --ag-norm -k NONE -n 300 -w 100 -r 1000 -q 60 --threads 1 $outputdir/inter_30.hic ${juiceDir}/scripts/GSE63525_GM12878_primary+replicate_HiCCUPS_looplist_with_motifs_unique_localized.txt $outputdir/qc_apa
	date
QC`
fi

jid=`sbatch <<- FINCLN1 | egrep -o -e "\b[0-9]+$"
	#!/bin/bash -l
+2 −2
Changes for SLURM/scripts/juicer_hiccups.sh: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -95,14 +95,14 @@ fi
if [ -n "$(ls -A ${hic_file_path%.*}_loops)" ]
then
    echo -e "\nAPA:\n"
    ${juicer_tools_path} apa ${hic_file_path} ${hic_file_path%.*}"_loops" "apa_results"
    ${juicer_tools_path} apa ${hic_file_path} ${hic_file_path%.*}"_loops/merged_loops.bedpe" "apa_results"
    ## Check that bed folder exists    
    if [ ! -e "${bed_file_dir}" ]; then
	echo "***! Can't find folder ${bed_file_dir}";
	echo "***! Not running motif finder";
    else
	echo -e "\nMOTIF FINDER:\n"
	${juicer_tools_path} motifs ${genomeID} ${bed_file_dir} ${hic_file_path%.*}"_loops"
	${juicer_tools_path} motifs ${genomeID} ${bed_file_dir} ${hic_file_path%.*}"_loops/merged_loops.bedpe"
    fi
    echo -e "\n(-: Feature annotation successfully completed (-:"
else
+3 −4
Changes for SLURM/scripts/mega.sh: 3 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ else
    load_gpu="CUDA_VISIBLE_DEVICES=0,1,2,3"
    # Juicer directory, contains scripts/, references/, and restriction_sites/
    # can also be set in options via -D
    juiceDir="/gpfs0/juicer/"
    juiceDir="/gpfs0/juicer2/"
    # default queue, can also be set in options
    queue="commons"
    queue_time="1400"
@@ -187,7 +187,6 @@ touchfile3=${megadir}/touch3
touchfile4=${megadir}/touch4

## Check for existing merged files:

merged_count=`find -L ${topDir} | grep merged1.txt | wc -l`
if [ "$merged_count" -lt "1" ]
then
@@ -442,7 +441,7 @@ fi
	    time ${juiceDir}/scripts/juicer_tools pre -n -f $site_file -s $outputdir/inter.txt -g $outputdir/inter_hists.m -q 1 -r 2500000,1000000,500000,250000,100000,50000,25000,10000,5000,2000,1000,500,200,100 $threadHicString $outputdir/merged1.txt $outputdir/inter.hic $genomeID
	fi
	time ${juiceDir}/scripts/juicer_tools addNorm $threadNormString ${outputdir}/inter.hic 
	rm -R ${outputdir}"/HIC_tmp"
	rm -Rf ${outputdir}"/HIC_tmp"
HIC1`
    dependhic1="afterok:$jid5"

@@ -481,7 +480,7 @@ fi
	    time ${juiceDir}/scripts/juicer_tools pre -n -f $site_file -s $outputdir/inter_30.txt -g $outputdir/inter_30_hists.m -q 30 -r 2500000,1000000,500000,250000,100000,50000,25000,10000,5000,2000,1000,500,200,100 $threadHic30String $outputdir/merged30.txt $outputdir/inter_30.hic $genomeID
	fi
	time ${juiceDir}/scripts/juicer_tools addNorm $threadNormString ${outputdir}/inter_30.hic
	rm -R ${outputdir}"/HIC30_tmp"
	rm -Rf ${outputdir}"/HIC30_tmp"
HIC30`
    dependhic30only="afterok:$jid6"
    sbatchdepend="#SBATCH -d ${dependhic30only}"