Skip to content

Commit

Permalink
PIP-1580-slice-subcompartments (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-sud authored Dec 3, 2021
1 parent 2817458 commit d908cc9
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 8 deletions.
6 changes: 6 additions & 0 deletions docker/hic-pipeline/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ RUN curl \
chmod 666 /opt/juicer/CPU/common/juicer_tools.jar && \
ln -s juicer/CPU scripts

RUN curl \
-LO \
https://github.com/sa501428/mixer-tools/releases/download/v4.07.08/MixerTools.4.7.8.jar && \
chmod 666 /opt/MixerTools.4.7.8.jar && \
ln -s /opt/MixerTools.4.7.8.jar /opt/MixerTools.jar

# For sorting, LC_ALL is C
ENV LC_ALL C
ENV PATH=/opt:/opt/scripts:/opt/scripts/common:/opt/juicer/misc:$PATH
Expand Down
64 changes: 60 additions & 4 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.3.1"
caper_docker: "encodedcc/hic-pipeline:1.3.1"
caper_singularity: "docker://encodedcc/hic-pipeline:1.3.1"
version: "1.4.0"
caper_docker: "encodedcc/hic-pipeline:1.4.0"
caper_singularity: "docker://encodedcc/hic-pipeline:1.4.0"
croo_out_def: "https://raw.githubusercontent.com/ENCODE-DCC/hic-pipeline/dev/croo_out_def.json"
}

Expand All @@ -37,6 +37,7 @@ workflow hic {
Boolean no_call_loops = false
Boolean no_call_tads = false
Boolean no_eigenvectors = false
Boolean no_slice = false
Int align_num_cpus = 32
Int? create_hic_num_cpus
Int? add_norm_num_cpus
Expand Down Expand Up @@ -258,6 +259,25 @@ workflow hic {
}
}
}

if (!no_slice) {
File hic_file = select_first([add_norm.output_hic[1], input_hic])

call slice as slice_25kb { input:
hic_file = hic_file,
resolution = 25000,
}

call slice as slice_50kb { input:
hic_file = hic_file,
resolution = 50000,
}

call slice as slice_100kb { input:
hic_file = hic_file,
resolution = 100000,
}
}
}

task get_ligation_site_regex {
Expand Down Expand Up @@ -778,7 +798,7 @@ task hiccups {
cpu : "1"
bootDiskSizeGb: "20"
disks: "local-disk 100 HDD"
docker: "encodedcc/hic-pipeline:1.3.1_hiccups"
docker: "encodedcc/hic-pipeline:1.4.0_hiccups"
gpuType: "nvidia-tesla-p100"
gpuCount: 1
memory: "8 GB"
Expand Down Expand Up @@ -828,6 +848,42 @@ task create_eigenvector {
}
}

task slice {
input {
File hic_file
Int resolution = 25000
Int minimum_num_clusters = 2
Int maximum_num_clusters = 13
Int num_kmeans_runs = 4
}

command {
set -euo pipefail
java \
-Xmx20G \
-jar /opt/MixerTools.jar \
slice \
--encode-mode \
-r ~{resolution} \
~{hic_file} \
~{minimum_num_clusters},~{maximum_num_clusters},~{num_kmeans_runs} \
slice_results \
cell_type
gzip -n slice_results/*.bed
mv slice_results/slice_subcompartment_clusters.bed.gz slice_subcompartment_clusters_~{resolution}.bed.gz
}

output {
File subcompartments = "slice_subcompartment_clusters_~{resolution}.bed.gz"
}

runtime {
cpu : "1"
disks: "local-disk 100 SSD"
memory : "24 GB"
}
}

task exit_early {
input {
String message
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.3.1"
__version__ = "1.4.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.3.1"
caper_docker: "encodedcc/hic-pipeline:1.3.1"
caper_singularity: "docker://encodedcc/hic-pipeline:1.3.1"
version: "1.4.0"
caper_docker: "encodedcc/hic-pipeline:1.4.0"
caper_singularity: "docker://encodedcc/hic-pipeline:1.4.0"
}

parameter_meta {
Expand Down
1 change: 1 addition & 0 deletions tests/functional/json/test_hic.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"hic.no_call_loops": true,
"hic.no_call_tads": true,
"hic.no_slice": true,
"hic.reference_index": "tests/data/ce10_selected.tar.gz",
"hic.restriction_enzymes": [
"MboI"
Expand Down
1 change: 1 addition & 0 deletions tests/functional/json/test_hic_nonspecific.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
],
"hic.no_call_loops": true,
"hic.no_call_tads": true,
"hic.no_slice": true,
"hic.reference_index": "tests/data/ce10_selected.tar.gz",
"hic.restriction_enzymes": [
"none"
Expand Down
1 change: 1 addition & 0 deletions tests/functional/json/test_hic_with_read_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
],
"hic.no_call_loops": true,
"hic.no_call_tads": true,
"hic.no_slice": true,
"hic.reference_index": "tests/data/ce10_selected.tar.gz",
"hic.restriction_enzymes": [
"MboI"
Expand Down
1 change: 1 addition & 0 deletions tests/functional/json/test_multiple_libraries.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
],
"hic.no_call_loops": true,
"hic.no_call_tads": true,
"hic.no_slice": true,
"hic.reference_index": "tests/data/ce10_selected.tar.gz",
"hic.restriction_enzymes": [
"MboI"
Expand Down
1 change: 1 addition & 0 deletions tests/functional/json/test_no_pairs.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"hic.no_call_loops": true,
"hic.no_call_tads": true,
"hic.no_pairs": true,
"hic.no_slice": true,
"hic.reference_index": "tests/data/ce10_selected.tar.gz",
"hic.restriction_enzymes": [
"MboI"
Expand Down
1 change: 1 addition & 0 deletions tests/functional/json/test_ultima.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"hic.no_call_loops": true,
"hic.no_call_tads": true,
"hic.no_eigenvectors": true,
"hic.no_slice": true,
"hic.reference_index": "tests/data/hg38_chr19_chrM_GRCh38_no_alt_analysis_set_GCA_000001405.15.chr19_chrM.tar.gz",
"hic.restriction_enzymes": [
"none"
Expand Down

0 comments on commit d908cc9

Please sign in to comment.