Skip to content

Commit

Permalink
PIP-1663-add-loop-localizer (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-sud authored Jan 18, 2022
1 parent e8e17ef commit 0c69cba
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 20 deletions.
8 changes: 1 addition & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,7 @@ repos:
- id: isort
language_version: python3.7

- repo: git://github.com/detailyang/pre-commit-shell
sha: v1.0.6
hooks:
- id: shell-lint
args: [--severity=warning]

- repo: git://github.com/detailyang/pre-commit-shell
- repo: https://github.com/detailyang/pre-commit-shell
sha: v1.0.6
hooks:
- id: shell-lint
Expand Down
4 changes: 4 additions & 0 deletions docker/hic-pipeline/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ RUN curl \
chmod 666 /opt/juicer/CPU/common/juicer_tools.jar && \
ln -s juicer/CPU scripts

RUN curl \
-LO \
https://github.com/aidenlab/Juicebox/releases/download/v.2.14.00/feature_tools.jar

RUN curl \
-LO \
https://github.com/sa501428/mixer-tools/releases/download/v4.07.09/MixerTools.4.7.9.jar&& \
Expand Down
2 changes: 1 addition & 1 deletion docker/hiccups/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN curl \

RUN curl \
-LO \
https://github.com/aidenlab/Juicebox/releases/download/v.2.13.07/feature_tools.jar
https://github.com/aidenlab/Juicebox/releases/download/v.2.14.00/feature_tools.jar

# For sorting, LC_ALL is C
ENV LC_ALL C
Expand Down
68 changes: 63 additions & 5 deletions hic.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ struct BamAndLigationCount {

workflow hic {
meta {
version: "1.8.0"
caper_docker: "encodedcc/hic-pipeline:1.8.0"
caper_singularity: "docker://encodedcc/hic-pipeline:1.8.0"
version: "1.9.0"
caper_docker: "encodedcc/hic-pipeline:1.9.0"
caper_singularity: "docker://encodedcc/hic-pipeline:1.9.0"
croo_out_def: "https://raw.githubusercontent.com/ENCODE-DCC/hic-pipeline/dev/croo_out_def.json"
}

Expand All @@ -34,8 +34,8 @@ workflow hic {

# Parameters controlling delta calls
Boolean no_delta = false
String delta_docker = "encodedcc/hic-pipeline:1.8.0_delta"
String hiccups_docker = "encodedcc/hic-pipeline:1.8.0_hiccups"
String delta_docker = "encodedcc/hic-pipeline:1.9.0_delta"
String hiccups_docker = "encodedcc/hic-pipeline:1.9.0_hiccups"

Boolean intact = false
Array[String] normalization_methods = []
Expand Down Expand Up @@ -250,12 +250,19 @@ workflow hic {
docker = hiccups_docker,
}
}

if (intact) {
call hiccups_2 { input:
hic = add_norm.output_hic,
quality = qualities[i],
docker = hiccups_docker,
}

call localizer as localizer_intact { input:
hic = add_norm.output_hic,
loops = hiccups_2.merged_loops,
quality = qualities[i],
}
}
}

Expand Down Expand Up @@ -283,6 +290,11 @@ workflow hic {
resolutions = delta_resolutions,
models_path = delta_models_path,
}

call localizer as localizer_delta { input:
hic = if length(add_norm.output_hic) > 1 then add_norm.output_hic[1] else select_first([input_hic]),
loops = delta.loops,
}
}

if (defined(input_hic)) {
Expand All @@ -298,11 +310,16 @@ workflow hic {
docker = hiccups_docker,
}
}

if (intact) {
call hiccups_2 as hiccups_2_input_hic { input:
hic = select_first([input_hic]),
docker = hiccups_docker,
}
call localizer as localizer_intact_input_hic { input:
hic = select_first([input_hic]),
loops = hiccups_2_input_hic.merged_loops,
}
}
}
}
Expand Down Expand Up @@ -912,6 +929,47 @@ task hiccups_2 {
}
}

task localizer {
input {
File hic
File loops
Int quality = 0
Int num_cpus = 24
}

command {
set -euo pipefail
export LOOPS_FILE=loops.bedpe
gzip -dc ~{loops} > $LOOPS_FILE
java \
-Ddevelopment=false \
-Djava.awt.headless=true \
-Xmx60G \
-Xms60G \
-jar /opt/feature_tools.jar \
localizer \
-k SCALE \
-r 100 \
-w 1 \
--threads ~{num_cpus} \
~{hic} \
$LOOPS_FILE \
localized
gzip -n localized/localizedList_primary_100.bedpe
mv localized/localizedList_primary_100.bedpe.gz localized_loops_~{quality}.bedpe.gz
}

output {
File localized_loops = "localized_loops_~{quality}.bedpe.gz"
}

runtime {
cpu : "~{num_cpus}"
disks: "local-disk 100 HDD"
memory: "64 GB"
}
}

task delta {
input {
File hic
Expand Down
2 changes: 1 addition & 1 deletion hic_pipeline/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__title__ = "hic-pipeline"
__version__ = "1.8.0"
__version__ = "1.9.0"
__description__ = "ENCODE Hi-C uniform processing pipeline."
__url__ = "https://github.com/ENCODE-DCC/hic-pipeline"
__uri__ = __url__
Expand Down
6 changes: 3 additions & 3 deletions make_restriction_site_locations.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ version 1.0

workflow make_restriction_site_locations {
meta {
version: "1.8.0"
caper_docker: "encodedcc/hic-pipeline:1.8.0"
caper_singularity: "docker://encodedcc/hic-pipeline:1.8.0"
version: "1.9.0"
caper_docker: "encodedcc/hic-pipeline:1.9.0"
caper_singularity: "docker://encodedcc/hic-pipeline:1.9.0"
}

parameter_meta {
Expand Down
6 changes: 3 additions & 3 deletions megamap.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import "./hic.wdl"

workflow megamap {
meta {
version: "1.8.0"
caper_docker: "encodedcc/hic-pipeline:1.8.0"
caper_singularity: "docker://encodedcc/hic-pipeline:1.8.0"
version: "1.9.0"
caper_docker: "encodedcc/hic-pipeline:1.9.0"
caper_singularity: "docker://encodedcc/hic-pipeline:1.9.0"
croo_out_def: "https://raw.githubusercontent.com/ENCODE-DCC/hic-pipeline/dev/croo_out_def.json"
}

Expand Down

0 comments on commit 0c69cba

Please sign in to comment.