Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Hub
hic
Commits
c7a67709
Commit
c7a67709
authored
5 years ago
by
nservant
Browse files
Options
Downloads
Patches
Plain Diff
update hicpro2higlass
parent
c5d240fe
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/hicpro2higlass.sh
+11
-7
11 additions, 7 deletions
bin/hicpro2higlass.sh
conf/base.config
+5
-0
5 additions, 0 deletions
conf/base.config
with
16 additions
and
7 deletions
bin/hicpro2higlass.sh
+
11
−
7
View file @
c7a67709
...
@@ -103,6 +103,7 @@ function help {
...
@@ -103,6 +103,7 @@ function help {
echo
" -i|--input INPUT : allValidPairs or matrix file generated by HiC-Pro"
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
" -r|--res RESOLUTION : .matrix file resolution or maximum resolution to reach from the .allValidPairs input file"
echo
" -c|--chrom CHROMSIZE : chromosome size 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
" [-n|--norm] : run cooler matrix balancing algorithm"
echo
" [-o|--out] : output path. Default is current path"
echo
" [-o|--out] : output path. Default is current path"
echo
" [-t|--temp] TEMP : path to tmp folder. Default is current path"
echo
" [-t|--temp] TEMP : path to tmp folder. Default is current path"
...
@@ -125,6 +126,7 @@ for arg in "$@"; do
...
@@ -125,6 +126,7 @@ for arg in "$@"; do
"--bed"
)
set
--
"
$@
"
"-b"
;;
"--bed"
)
set
--
"
$@
"
"-b"
;;
"--res"
)
set
--
"
$@
"
"-r"
;;
"--res"
)
set
--
"
$@
"
"-r"
;;
"--chrom"
)
set
--
"
$@
"
"-c"
;;
"--chrom"
)
set
--
"
$@
"
"-c"
;;
"--proc"
)
set
--
"
$@
"
"-p"
;;
"--out"
)
set
--
"
$@
"
"-o"
;;
"--out"
)
set
--
"
$@
"
"-o"
;;
"--temp"
)
set
--
"
$@
"
"-t"
;;
"--temp"
)
set
--
"
$@
"
"-t"
;;
"--norm"
)
set
--
"
$@
"
"-n"
;;
"--norm"
)
set
--
"
$@
"
"-n"
;;
...
@@ -136,18 +138,20 @@ done
...
@@ -136,18 +138,20 @@ done
INPUT_HICPRO
=
""
INPUT_HICPRO
=
""
INPUT_BED
=
""
INPUT_BED
=
""
NORMALIZE
=
0
NORMALIZE
=
0
NPROC
=
1
CHROMSIZES_FILE
=
""
CHROMSIZES_FILE
=
""
RES
=
10000
RES
=
10000
OUT
=
"./"
OUT
=
"./"
TEMP
=
"./"
TEMP
=
"./"
while
getopts
":i:b:c:r:o:t:nh"
OPT
while
getopts
":i:b:c:
p:
r:o:t:nh"
OPT
do
do
case
$OPT
in
case
$OPT
in
i
)
INPUT_HICPRO
=
$OPTARG
;;
i
)
INPUT_HICPRO
=
$OPTARG
;;
b
)
INPUT_BED
=
$OPTARG
;;
b
)
INPUT_BED
=
$OPTARG
;;
n
)
NORMALIZE
=
1
;;
n
)
NORMALIZE
=
1
;;
c
)
CHROMSIZES_FILE
=
$OPTARG
;;
c
)
CHROMSIZES_FILE
=
$OPTARG
;;
p
)
NPROC
=
$OPTARG
;;
r
)
RES
=
$OPTARG
;;
r
)
RES
=
$OPTARG
;;
o
)
OUT
=
$OPTARG
;;
o
)
OUT
=
$OPTARG
;;
t
)
TEMP
=
$OPTARG
;;
t
)
TEMP
=
$OPTARG
;;
...
@@ -223,9 +227,9 @@ if [[ $DATATYPE == "MATRIX" ]]; then
...
@@ -223,9 +227,9 @@ if [[ $DATATYPE == "MATRIX" ]]; then
echo
-e
"
\n
Zoomify .cool file ..."
echo
-e
"
\n
Zoomify .cool file ..."
if
[[
$NORMALIZE
==
1
]]
;
then
if
[[
$NORMALIZE
==
1
]]
;
then
cooler zoomify
--balance
$tmp_dir
/
$out
cooler zoomify
--nproc
${
NPROC
}
--balance
$tmp_dir
/
$out
else
else
cooler zoomify
--n
o-balance
$tmp_dir
/
$out
cooler zoomify
--n
proc
${
NPROC
}
$tmp_dir
/
$out
fi
fi
out
=
$(
basename
$INPUT_HICPRO
|
sed
-e
's/.mat.*/.mcool/'
)
out
=
$(
basename
$INPUT_HICPRO
|
sed
-e
's/.mat.*/.mcool/'
)
...
@@ -233,19 +237,19 @@ elif [[ $DATATYPE == "VALID" ]]; then
...
@@ -233,19 +237,19 @@ elif [[ $DATATYPE == "VALID" ]]; then
out
=
$(
basename
$INPUT_HICPRO
|
sed
-e
's/.allValidPairs.*/.cool/'
)
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
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
\
-o
$tmp_dir
/contacts.sorted.txt.gz
\
$tmp_dir
/contacts.txt
\
$tmp_dir
/contacts.txt
\
$CHROMSIZES_FILE
$CHROMSIZES_FILE
cooler makebins
$CHROMSIZES_FILE
$RES
>
$tmp_dir
/bins.bed
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
"
\n
Zoomify .cool file ..."
echo
-e
"
\n
Zoomify .cool file ..."
if
[[
$NORMALIZE
==
1
]]
;
then
if
[[
$NORMALIZE
==
1
]]
;
then
cooler zoomify
--balance
$tmp_dir
/
$out
cooler zoomify
--nproc
${
NPROC
}
--balance
$tmp_dir
/
$out
else
else
cooler zoomify
--n
o-balance
$tmp_dir
/
$out
cooler zoomify
--n
proc
${
NPROC
}
$tmp_dir
/
$out
fi
fi
out
=
$(
basename
$INPUT_HICPRO
|
sed
-e
's/.allValidPairs.*/.mcool/'
)
out
=
$(
basename
$INPUT_HICPRO
|
sed
-e
's/.allValidPairs.*/.mcool/'
)
fi
fi
...
...
This diff is collapsed.
Click to expand it.
conf/base.config
+
5
−
0
View file @
c7a67709
...
@@ -66,6 +66,11 @@ process {
...
@@ -66,6 +66,11 @@ process {
memory
= {
check_max
(
10
.
GB
*
task
.
attempt
,
'memory'
) }
memory
= {
check_max
(
10
.
GB
*
task
.
attempt
,
'memory'
) }
time
= {
check_max
(
5
.
h
*
task
.
attempt
,
'time'
) }
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
{
params
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment