Commit 856b1163 authored by Aiden Lab's avatar Aiden Lab Committed by GitHub
Browse files

Merge pull request #34 from mzhibo/master

bugs fix
parents 44db5df1 688fc4f3
Loading
Loading
Loading
Loading
+27 −36
Changes for PBS/scripts/juicer.sh: 27 added lines, 36 removed lines.
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ load_cuda='module load cuda/7.5.18/gcc/4.4.7'

# Juicer directory, contains scripts/, references/, and restriction_sites/
# can also be set in options via -D
juiceDir="/lustre1/mzhibo/hic/apps/juicer"
juiceDir=""
# default queue, can also be set in options via -q
queue="batch"
# default queue time, can also be set in options via -Q
@@ -94,25 +94,18 @@ walltime="walltime=24:00:00"
long_queue="batch"
# default long queue time, can also be set in options via -L
long_walltime="walltime=120:00:00"

###################
#The specific format for cpu/gpu resource request with #PBS -l node=?:ppn=?:AMD header line
#might be different on different cluster. 
#Please adjust this header line according to your cluster setup.
###################
# give your email address to be used in #PBS -M to receive notifications when job error occurs.
EMAIL=""


# size to split fastqs. adjust to match your needs. 4000000=1M reads per split
# can also be changed via the -C flag
# give your email address to be used in #PBS -M to receive notifications when job error occurs.
# Must be either set with an email address or skipped
# This email is not included in the launch stat and postprocessing steps, add manually if needed
EMAIL='#PBS -M mzhibo@gmail.com'
splitsize=90000000
# fastq files should look like filename_R1.fastq and filename_R2.fastq 
# if your fastq files look different, change this value
read1str="_R1"
read2str="_R2"
#resolutions is optional, set if you want resolutions other than the default in .hic
resolutions='1000000,500000,100000,50000,10000,5000,2000'


# unique groupname for jobs submitted in each run. lab initial with an timestamp
# Length of $groupname in this PBS version needs to be no longer than 8 characters.
@@ -404,9 +397,9 @@ then
                #PBS -S /bin/bash
                #PBS -q $queue
                #PBS -l $walltime
                $RESOURCE
                #PBS -l nodes=1:ppn=1:AMD
                #PBS -l mem=20gb
                #PBS -M ${EMAIL}
                ${EMAIL}
                #PBS -m a
                #PBS -o ${logdir}/${timestamp}_split_${filename}_${groupname}.log
                #PBS -j oe
@@ -432,7 +425,7 @@ SPLITEND
            #PBS -l $walltime
            #PBS -l nodes=1:ppn=1:AMD
            #PBS -l mem=20gb
            #PBS -M ${EMAIL}
            ${EMAIL}
            #PBS -m a
            #PBS -o ${logdir}/${timestamp}_move_${groupname}.log
            #PBS -j oe
@@ -470,7 +463,7 @@ SPLITMV
    #PBS -j oe
    #PBS -N AlnWrp${groupname}
    #PBS -W depend=afterok:${jID_splitmv}
    #PBS -M ${EMAIL}
    ${EMAIL}
    #PBS -m a
    for i in ${read1}
    do
@@ -496,7 +489,7 @@ SPLITMV
        #PBS -l $walltime
        #PBS -l nodes=1:ppn=1:AMD
        #PBS -l mem=4gb
        #PBS -M ${EMAIL}
        ${EMAIL}
        #PBS -m a
        #PBS -o ${logdir}/\${timestamp}_\${jname}_CntLig_\${countjobs}_${groupname}.log
        #PBS -j oe
@@ -541,7 +534,7 @@ CNTLIG
        #PBS -l $walltime
        #PBS -l nodes=1:ppn=${threads}:AMD
        #PBS -l mem=\${alloc_mem}
        #PBS -M ${EMAIL}
        ${EMAIL}
        #PBS -m a
        #PBS -o ${logdir}/\${timestamp}_\${jname}_align1_\${countjobs}_${groupname}.log
        #PBS -j oe
@@ -592,7 +585,7 @@ ALGNR1
        #PBS -l $walltime
        #PBS -l nodes=1:ppn=${threads}:AMD
        #PBS -l mem=\$alloc_mem
        #PBS -M ${EMAIL}
        ${EMAIL}
        #PBS -m a
        #PBS -o ${logdir}/\${timestamp}_\${jname}_align2_\${countjobs}_${groupname}.log
        #PBS -j oe
@@ -643,7 +636,7 @@ ALGNR2
        #PBS -l $long_walltime
        #PBS -l nodes=1:ppn=1:AMD
        #PBS -l mem=24gb
        #PBS -M ${EMAIL}
        ${EMAIL}
        #PBS -m a
        #PBS -o ${logdir}/\${timestamp}_\${jname}_merge_\${countjobs}_${groupname}.log
        #PBS -j oe
@@ -719,7 +712,7 @@ MRGALL
    #PBS -l $walltime
    #PBS -l nodes=1:ppn=1:AMD
    #PBS -l mem=24gb
    #PBS -M ${EMAIL}
    ${EMAIL}
    #PBS -m a
    #PBS -o ${logdir}/\${timestamp}_\${jname}_chimeric_\${countjobs}_${groupname}.log
    #PBS -j oe
@@ -791,7 +784,7 @@ CHIMERIC
    #PBS -l nodes=1:ppn=1:AMD
    #PBS -l mem=2gb
    #PBS -l $walltime
    #PBS -M ${EMAIL}
    ${EMAIL}
    #PBS -m a
    #PBS -o ${logdir}/\${timestamp}_check_alnOK_${groupname}.log
    #PBS -j oe
@@ -809,7 +802,7 @@ CKALIGNFAIL
    #PBS -l nodes=1:ppn=1:AMD
    #PBS -l mem=4gb
    #PBS -l $walltime
    #PBS -M ${EMAIL}
    ${EMAIL}
    #PBS -m a
    #PBS -o ${logdir}/\${timestamp}_alignfailclean_${groupname}.log
    #PBS -j oe
@@ -848,7 +841,7 @@ then
    #PBS -l nodes=1:ppn=1:AMD
    #PBS -l mem=24gb
    #PBS -l $walltime
    #PBS -M ${EMAIL}
    ${EMAIL}
    #PBS -m a
    #PBS -o ${logdir}/${timestamp}_mergesortwrap_${groupname}.log
    #PBS -j oe
@@ -875,7 +868,7 @@ then
        #PBS -l nodes=1:ppn=1:AMD
        #PBS -l mem=24gb
        #PBS -l $walltime
        #PBS -M ${EMAIL}
        ${EMAIL}
        #PBS -m a
        #PBS -o ${logdir}/\${timestamp}_fragmerge_${groupname}.log
        #PBS -j oe
@@ -906,7 +899,7 @@ MRGSRT
        #PBS -l nodes=1:ppn=1:AMD
        #PBS -l mem=2gb
        #PBS -l $walltime
        #PBS -M ${EMAIL}
        ${EMAIL}
        #PBS -m a
        #PBS -o ${logdir}/\${timestamp}_clean1_${groupname}.log
        #PBS -j oe
@@ -939,7 +932,7 @@ then
    #PBS -l nodes=1:ppn=1:AMD
    #PBS -l mem=4gb
    #PBS -l $walltime
    #PBS -M ${EMAIL}
    ${EMAIL}
    #PBS -m a
    #PBS -o ${logdir}/${timestamp}_rmdupwrap_${groupname}.log
    #PBS -j oe
@@ -961,7 +954,7 @@ then
        #PBS -l nodes=1:ppn=1:AMD
        #PBS -l mem=4gb
        #PBS -l $walltime
        #PBS -M ${EMAIL}
        ${EMAIL}
        #PBS -m a   
        #PBS -o ${logdir}/\${timestamp}_osplit_${groupname}.log
        #PBS -j oe
@@ -1008,7 +1001,7 @@ then
        #PBS -l nodes=1:ppn=1:AMD
        #PBS -l mem=1gb
        #PBS -l $walltime
        #PBS -M ${EMAIL}
        ${EMAIL}
        #PBS -m a
        #PBS -o ${logdir}/${timestamp}_superwrap1_${groupname}.log
        #PBS -j oe
@@ -1027,12 +1020,11 @@ then
        export splitdir=$splitdir
        export nofrag=$nofrag
        export genomePath=$genomePath
        export resolutions=$resolutions
        export final=$final
        export queue=$queue
        export walltime=$walltime
        export long_walltime=$long_walltime
        export EMAIL=$EMAIL
        export nofrag=$nofrag
        ${juiceDir}/scripts/launch_stats.sh
SUPERWRAP1
    fi
@@ -1055,7 +1047,7 @@ SUPERWRAP1
    #PBS -o ${logdir}/${timestamp}_super_wrap2_${groupname}.log
    #PBS -j oe
    #PBS -N SpWrp2${groupname}
    #PBS -M ${EMAIL}
    ${EMAIL}
    #PBS -m a
    ${waitstring6}    
    wait
@@ -1071,7 +1063,6 @@ SUPERWRAP1
    export walltime=$walltime
    export long_walltime=$long_walltime
    export postproc=$postproc
	export EMAIL=$EMAIL
    jID_launch=\$(qstat | grep Lnch_${groupname} | cut -c 1-7)
    echo \$jID_launch
    echo "waitstring3 is \${waitstring3}"
@@ -1092,7 +1083,7 @@ else
    #PBS -l mem=1gb
    #PBS -o ${logdir}/${timestamp}_prep_done_${groupname}.out
    #PBS -j oe
    #PBS -M ${EMAIL}
    ${EMAIL}
    #PBS -m a
    #PBS -N prepd_${groupname}
    #PBS -W depend=afterok:${jID_rmdupwrap}
@@ -1111,7 +1102,7 @@ else
        #PBS -o ${logdir}/\${timestamp}_done_${groupname}.log
        #PBS -j oe
        #PBS -N ${groupname}_done
        #PBS -M ${EMAIL}
        ${EMAIL}
        #PBS -m a
        #PBS -W depend=afterok:\${jID_osplit}:\${jID_rmsplit}

PBS/scripts/juicer_tools

deleted100644 → 0
+0 −26
Changes for PBS/scripts/juicer_tools: 0 added lines, 26 removed lines.
Original line number Diff line number Diff line
#!/bin/bash -l
#
# Copyright (c) 2015 Aiden Lab
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# 
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# Juicer version 1.5

java -Djava.awt.headless=true -Djava.library.path=`dirname $0`/lib64 -Xmx16000m -jar `dirname $0`/juicer_tools.jar $*
+2 −16
Changes for PBS/scripts/launch_stats.sh: 2 added lines, 16 removed lines.
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ echo "resolutions: $resolutions"
echo "walltime: $walltime"
echo "long_walltime: $long_walltime"
echo $load_java
echo "EMAIL: $EMAIL"
jID_osplit=$( qstat | grep osplit${groupname} | cut -c 1-7 )

if [ -z $final ]
@@ -35,8 +34,6 @@ qsub <<DOSTAT
#PBS -l nodes=1:ppn=1:AMD
#PBS -l mem=1gb
#PBS -l $walltime
#PBS -M ${EMAIL}
#PBS -m a
#PBS -o ${logdir}/${timestamp}_launch_${groupname}.log
#PBS -j oe
#PBS -N Lnch_${groupname}
@@ -64,8 +61,6 @@ qsub <<STATS0
	#PBS -l mem=20gb
	#PBS -l $walltime
	\${waitstring22}
	#PBS -M ${EMAIL}
	#PBS -m a 
	#PBS -o ${logdir}/\${timestamp}_stats0_${groupname}.log
	#PBS -j oe
	#PBS -N stats0${groupname}
@@ -89,8 +84,6 @@ qsub <<STATS30
	#PBS -l nodes=1:ppn=1:AMD
	#PBS -l mem=20gb
	#PBS -l $walltime
	#PBS -M ${EMAIL}
	#PBS -m a 
	#PBS -o ${logdir}/\${timestamp}_stats_${groupname}.log
	#PBS -j oe
	#PBS -N stats30${groupname}
@@ -115,8 +108,6 @@ qsub <<- ABNORMAL
	#PBS -l nodes=1:ppn=1:AMD
	#PBS -l mem=60gb
	#PBS -l $long_walltime
	#PBS -M ${EMAIL}
	#PBS -m ae
	#PBS -o ${logdir}/\${timestamp}_abnormal_${groupname}.log
	#PBS -j oe
	#PBS -N abnorm_${groupname}
@@ -139,8 +130,6 @@ qsub <<- HICWORK
	#PBS -l nodes=1:ppn=1:AMD
	#PBS -l mem=60gb
	#PBS -l $long_walltime
	#PBS -M ${EMAIL}
	#PBS -m ae
	#PBS -o ${logdir}/\${timestamp}_hic0_${groupname}.log
	#PBS -j oe
	#PBS -N hic0_${groupname}
@@ -154,7 +143,7 @@ qsub <<- HICWORK
	then 
		${juiceDir}/scripts/juicer_tools pre -s $outputdir/inter.txt -g $outputdir/inter_hists.m -q 1 $outputdir/merged_nodups.txt $outputdir/inter.hic $genomePath
	else 
		${juiceDir}/scripts/juicer_tools pre -r $resolutions -f $site_file -s $outputdir/inter.txt -g $outputdir/inter_hists.m -q 1 $outputdir/merged_nodups.txt $outputdir/inter.hic $genomePath
		${juiceDir}/scripts/juicer_tools pre -f $site_file -s $outputdir/inter.txt -g $outputdir/inter_hists.m -q 1 $outputdir/merged_nodups.txt $outputdir/inter.hic $genomePath
	fi
HICWORK
jID_stats30=\$( qstat | grep stats30${groupname} | cut -c 1-7)
@@ -166,8 +155,6 @@ qsub <<- HIC30WORK
	#PBS -l nodes=1:ppn=1:AMD
	#PBS -l mem=60gb
	#PBS -l $long_walltime
	#PBS -M ${EMAIL}
	#PBS -m ae
	#PBS -o ${logdir}/\${timestamp}_hic30_${groupname}.log
	#PBS -j oe
	#PBS -N hic30_${groupname}
@@ -185,9 +172,8 @@ qsub <<- HIC30WORK
	then 
	${juiceDir}/scripts/juicer_tools pre -s $outputdir/inter_30.txt -g $outputdir/inter_30_hists.m -q 30 $outputdir/merged_nodups.txt $outputdir/inter_30.hic $genomePath
	else 
		${juiceDir}/scripts/juicer_tools pre -r $resolutions -f $site_file -s $outputdir/inter_30.txt -g $outputdir/inter_30_hists.m -q 30 $outputdir/merged_nodups.txt $outputdir/inter_30.hic $genomePath
		${juiceDir}/scripts/juicer_tools pre -f $site_file -s $outputdir/inter_30.txt -g $outputdir/inter_30_hists.m -q 30 $outputdir/merged_nodups.txt $outputdir/inter_30.hic $genomePath
	fi
HIC30WORK
sleep 3m

DOSTAT
+9 −12
Changes for PBS/scripts/mega.sh: 9 added lines, 12 removed lines.
Original line number Diff line number Diff line
@@ -48,8 +48,7 @@ juiceDir="/lustre1/mzhibo/hic/apps/juicer"
# unique name for jobs in this run
groupname="C$(date +"%s"|cut -c 6-11)"

#give an email to receive notification when a job exit with error
EMAIL=""

## Default options, overridden by command line arguments

# top level directory, can also be set in options
@@ -59,8 +58,6 @@ site="MboI"
# genome ID, default to human, can also be set in options
genomeID="hg19"

#the resolution is optional, set only when you want resolution other than the default
resolutions="1M,500K,100K,50K,10K,5K,3K,2K"
## Read arguments
usageHelp="Usage: ${0##*/} -g genomeID [-d topDir] [-s site] [-r resolutions] [-hx]"
genomeHelp="   genomeID must be defined in the script, e.g. \"hg19\" or \"mm10\" (default \"$genomeID\")"
@@ -235,11 +232,11 @@ jid5=$(qsub -o ${logdir}/hic0_${groupname}.log -j oe -q batch -M ${EMAIL} -m ae
$load_java
if [ -z "$exclude" ]
then
  echo "Launching ${juiceDir}/scripts/juicer_tools pre -f ${site_file} -s ${outputdir}/inter.txt -g ${outputdir}/inter_hists.m -q 1 ${outputdir}/merged_nodups.txt ${outputdir}/inter.hic ${genomeID}"
  ${juiceDir}/scripts/juicer_tools pre -f ${site_file} -s ${outputdir}/inter.txt -g ${outputdir}/inter_hists.m -q 1 ${outputdir}/merged_nodups.txt ${outputdir}/inter.hic ${genomeID}
  echo "Launching ${juiceDir}/scripts/juicer_tools pre ${resolutions} -f ${site_file} -s ${outputdir}/inter.txt -g ${outputdir}/inter_hists.m -q 1 ${outputdir}/merged_nodups.txt ${outputdir}/inter.hic ${genomeID}"
  ${juiceDir}/scripts/juicer_tools pre ${resolutions} -f ${site_file} -s ${outputdir}/inter.txt -g ${outputdir}/inter_hists.m -q 1 ${outputdir}/merged_nodups.txt ${outputdir}/inter.hic ${genomeID}
else
  echo "Launching ${juiceDir}/scripts/juicer_tools pre -s ${outputdir}/inter.txt -g ${outputdir}/inter_hists.m -q 1 ${outputdir}/merged_nodups.txt ${outputdir}/inter.hic ${genomeID}"
  ${juiceDir}/scripts/juicer_tools pre -s ${outputdir}/inter.txt -g ${outputdir}/inter_hists.m -q 1 ${outputdir}/merged_nodups.txt ${outputdir}/inter.hic ${genomeID}
  echo "Launching ${juiceDir}/scripts/juicer_tools pre ${resolutions} -s ${outputdir}/inter.txt -g ${outputdir}/inter_hists.m -q 1 ${outputdir}/merged_nodups.txt ${outputdir}/inter.hic ${genomeID}"
  ${juiceDir}/scripts/juicer_tools pre ${resolutions} -s ${outputdir}/inter.txt -g ${outputdir}/inter_hists.m -q 1 ${outputdir}/merged_nodups.txt ${outputdir}/inter.hic ${genomeID}
fi
HIC0
)
@@ -249,11 +246,11 @@ jid6=$(qsub -o ${logdir}/hic30_${groupname}.log -j oe -q batch -M ${EMAIL} -m ae
$load_java
if [ -z "${exclude}" ]
then
    echo "Launching ${juiceDir}/scripts/juicer_tools pre -f ${site_file} -s ${outputdir}/inter_30.txt -g ${outputdir}/inter_30_hists.m -q 30 ${outputdir}/merged_nodups.txt ${outputdir}/inter_30.hic ${genomeID}"
    ${juiceDir}/scripts/juicer_tools pre -f ${site_file} -s ${outputdir}/inter_30.txt -g ${outputdir}/inter_30_hists.m -q 30 ${outputdir}/merged_nodups.txt ${outputdir}/inter_30.hic ${genomeID}
    echo "Launching ${juiceDir}/scripts/juicer_tools pre ${resolutions} -f ${site_file} -s ${outputdir}/inter_30.txt -g ${outputdir}/inter_30_hists.m -q 30 ${outputdir}/merged_nodups.txt ${outputdir}/inter_30.hic ${genomeID}"
    ${juiceDir}/scripts/juicer_tools pre ${resolutions} -f ${site_file} -s ${outputdir}/inter_30.txt -g ${outputdir}/inter_30_hists.m -q 30 ${outputdir}/merged_nodups.txt ${outputdir}/inter_30.hic ${genomeID}
else
   echo "Launching ${juiceDir}/scripts/juicer_tools pre -s ${outputdir}/inter_30.txt -g ${outputdir}/inter_30_hists.m -q 30 ${outputdir}/merged_nodups.txt ${outputdir}/inter_30.hic ${genomeID}"
   ${juiceDir}/scripts/juicer_tools pre -s ${outputdir}/inter_30.txt -g ${outputdir}/inter_30_hists.m -q 30 ${outputdir}/merged_nodups.txt ${outputdir}/inter_30.hic ${genomeID}
   echo "Launching ${juiceDir}/scripts/juicer_tools pre ${resolutions} -s ${outputdir}/inter_30.txt -g ${outputdir}/inter_30_hists.m -q 30 ${outputdir}/merged_nodups.txt ${outputdir}/inter_30.hic ${genomeID}"
   ${juiceDir}/scripts/juicer_tools pre ${resolutions} -s ${outputdir}/inter_30.txt -g ${outputdir}/inter_30_hists.m -q 30 ${outputdir}/merged_nodups.txt ${outputdir}/inter_30.hic ${genomeID}
fi
HIC30
)
+0 −8
Changes for PBS/scripts/postprocessing.sh: 0 added lines, 8 removed lines.
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@ qsub <<- POSTPROCWRAP
#PBS -o ${logdir}/${timestamp}_postproc_wrap_${groupname}.log
#PBS -j oe
#PBS -N PPrWrp${groupname}
#PBS -M ${EMAIL}
#PBS -m a
${waitstring3}

date +"%Y-%m-%d %H:%M:%S"
@@ -40,8 +38,6 @@ qsub <<POSTPROCESS
	#PBS -o ${logdir}/\${timestamp}_postproc_${groupname}.log
	#PBS -j oe
	#PBS -N PProc_${groupname}
	#PBS -M ${EMAIL}
	#PBS -m a
    $waitstring4

    date +"%Y-%m-%d %H:%M:%S"
@@ -66,8 +62,6 @@ qsub <<- FINCK
#PBS -l $walltime
#PBS -o ${logdir}/${timestamp}_prep_done_${groupname}.log
#PBS -j oe
#PBS -M ${EMAIL}
#PBS -m a
#PBS -N Pdone_${groupname}
#PBS -W depend=afterok:${jID_postprocwrap}

@@ -93,8 +87,6 @@ qsub <<DONE
	#PBS -o ${logdir}/\${timestamp}_done_${groupname}.log
	#PBS -j oe
	#PBS -N done_${groupname}
	#PBS -M ${EMAIL}
	#PBS -m a
	\${waitstring5}

	date +"%Y-%m-%d %H:%M:%S"