Skip to content
Snippets Groups Projects
Commit ece3fad7 authored by nservant's avatar nservant
Browse files

Merge branch 'dev' of https://github.com/nservant/nf-core-hic into dev

parents df833298 c79ca2f7
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,7 @@
## v1.1.0 - 2019-10-15
* Update hicpro2higlass with `-p` parameter
* Support 'N' base motif in restriction/ligation sites
* Support multiple restriction enzymes/ligattion sites (comma separated) ([#31](https://github.com/nf-core/hic/issues/31))
* Add --saveInteractionBAM option
......
......@@ -103,6 +103,7 @@ function help {
echo " -i|--input INPUT : allValidPairs or matrix file generated by HiC-Pro"
echo " -r|--res RESOLUTION : .matrix file resolution or maximum resolution to reach from the .allValidPairs input file"
echo " -c|--chrom CHROMSIZE : chromosome size file"
echo " -p|--proc NB_CPU : number of CPUs for cooler"
echo " [-n|--norm] : run cooler matrix balancing algorithm"
echo " [-o|--out] : output path. Default is current path"
echo " [-t|--temp] TEMP : path to tmp folder. Default is current path"
......@@ -125,6 +126,7 @@ for arg in "$@"; do
"--bed") set -- "$@" "-b" ;;
"--res") set -- "$@" "-r" ;;
"--chrom") set -- "$@" "-c" ;;
"--proc") set -- "$@" "-p" ;;
"--out") set -- "$@" "-o" ;;
"--temp") set -- "$@" "-t" ;;
"--norm") set -- "$@" "-n" ;;
......@@ -136,18 +138,20 @@ done
INPUT_HICPRO=""
INPUT_BED=""
NORMALIZE=0
NPROC=1
CHROMSIZES_FILE=""
RES=10000
OUT="./"
TEMP="./"
while getopts ":i:b:c:r:o:t:nh" OPT
while getopts ":i:b:c:p:r:o:t:nh" OPT
do
case $OPT in
i) INPUT_HICPRO=$OPTARG;;
b) INPUT_BED=$OPTARG;;
n) NORMALIZE=1;;
c) CHROMSIZES_FILE=$OPTARG;;
p) NPROC=$OPTARG;;
r) RES=$OPTARG;;
o) OUT=$OPTARG;;
t) TEMP=$OPTARG;;
......@@ -223,9 +227,9 @@ if [[ $DATATYPE == "MATRIX" ]]; then
echo -e "\nZoomify .cool file ..."
if [[ $NORMALIZE == 1 ]]; then
cooler zoomify --balance $tmp_dir/$out
cooler zoomify --nproc ${NPROC} --balance $tmp_dir/$out
else
cooler zoomify --no-balance $tmp_dir/$out
cooler zoomify --nproc ${NPROC} $tmp_dir/$out
fi
out=$(basename $INPUT_HICPRO | sed -e 's/.mat.*/.mcool/')
......@@ -233,19 +237,19 @@ elif [[ $DATATYPE == "VALID" ]]; then
out=$(basename $INPUT_HICPRO | sed -e 's/.allValidPairs.*/.cool/')
awk '{OFS="\t";print $2,$3,$4,$5,$6,$7,1}' $INPUT_HICPRO | sed -e 's/+/1/g' -e 's/-/16/g' > $tmp_dir/contacts.txt
cooler csort --nproc 2 -c1 1 -p1 2 -s1 3 -c2 4 -p2 5 -s2 6 \
cooler csort --nproc ${NPROC} -c1 1 -p1 2 -s1 3 -c2 4 -p2 5 -s2 6 \
-o $tmp_dir/contacts.sorted.txt.gz \
$tmp_dir/contacts.txt \
$CHROMSIZES_FILE
cooler makebins $CHROMSIZES_FILE $RES > $tmp_dir/bins.bed
cooler cload pairix $tmp_dir/bins.bed $tmp_dir/contacts.sorted.txt.gz $tmp_dir/$out
cooler cload pairix --nproc ${NPROC} $tmp_dir/bins.bed $tmp_dir/contacts.sorted.txt.gz $tmp_dir/$out
echo -e "\nZoomify .cool file ..."
if [[ $NORMALIZE == 1 ]]; then
cooler zoomify --balance $tmp_dir/$out
cooler zoomify --nproc ${NPROC} --balance $tmp_dir/$out
else
cooler zoomify --no-balance $tmp_dir/$out
cooler zoomify --nproc ${NPROC} $tmp_dir/$out
fi
out=$(basename $INPUT_HICPRO | sed -e 's/.allValidPairs.*/.mcool/')
fi
......
......@@ -66,6 +66,11 @@ process {
memory = { check_max( 10.GB * task.attempt, 'memory' ) }
time = { check_max( 5.h * task.attempt, 'time' ) }
}
withName:generate_cool {
cpus = check_max( 2, 'cpus' ) }
memory = { check_max( 16.GB * task.attempt, 'memory' ) }
time = { check_max( 4.h * task.attempt, 'time' ) }
}
}
params {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment