diff --git a/CHANGELOG.md b/CHANGELOG.md index 019a0e11fb5808c9d240033171694226a613c5e8..39ad52a5dad8332451ef7a68cf2fa1ce902646f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,17 @@ # nf-core/hic: Changelog + ## v1.1dev * Fix bug for reads extension _1/_2 (#30) * Update manual (#28) -## v1.0dev - 2019-04-09 +## v1.0 - 2019-05-06 -First version of nf-core-hic pipeline which is a Nextflow implementation of the [HiC-Pro pipeline](https://github.com/nservant/HiC-Pro/). -Note that all HiC-Pro functionalities are not yet all implemented. The current version is designed for protocols based on restriction enzyme digestion. +First version of nf-core Hi-C pipeline which is a Nextflow implementation of the [HiC-Pro pipeline](https://github.com/nservant/HiC-Pro/). +Note that all HiC-Pro functionalities are not yet all implemented. +The current version supports most protocols including Hi-C, in situ Hi-C, DNase Hi-C, Micro-C, capture-C or HiChip data. In summary, this version allows : diff --git a/README.md b/README.md index 5f2c07459b0e8da3644198705f6ecb91b57bca01..37692cf5d7e8901feeb77f29da73ad500ca46cc4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# nf-core/hic +#  **Analysis of Chromosome Conformation Capture data (Hi-C)**. diff --git a/Singularity b/Singularity deleted file mode 100644 index 927866f0ec891fab132980e50a91d78d7f887eaa..0000000000000000000000000000000000000000 --- a/Singularity +++ /dev/null @@ -1,18 +0,0 @@ -From:nfcore/base -Bootstrap:docker - -%labels - MAINTAINER Nicolas Servant - DESCRIPTION Singularity image containing all requirements for the nf-core/hic pipeline - VERSION 1.0dev - -%environment - PATH=/opt/conda/envs/nf-core-hic-1.0dev/bin:$PATH - export PATH - -%files - environment.yml / - -%post - /opt/conda/bin/conda env create -f /environment.yml - /opt/conda/bin/conda clean -a diff --git a/docs/images/nfcore-hic_logo.png b/docs/images/nfcore-hic_logo.png index 713ca9c500139f90bc9f3ad8e09d8c59b1f634b4..d75e44b92cc77b61d1cc79747cfa390101784a03 100644 Binary files a/docs/images/nfcore-hic_logo.png and b/docs/images/nfcore-hic_logo.png differ diff --git a/docs/images/nfcore-hic_logo.svg b/docs/images/nfcore-hic_logo.svg new file mode 100644 index 0000000000000000000000000000000000000000..7a2086987e69e1529baf40fe3ea526c174b85ac1 --- /dev/null +++ b/docs/images/nfcore-hic_logo.svg @@ -0,0 +1,205 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + enable-background="new 0 0 1150.9 517" + version="1.1" + viewBox="0 0 1456.7841 522.44342" + xml:space="preserve" + id="svg2" + inkscape:version="0.91 r13725" + sodipodi:docname="EmptyName_logo.svg" + width="1456.7842" + height="522.44342"><sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1015" + id="namedview75" + showgrid="false" + inkscape:zoom="0.35757767" + inkscape:cx="253.20897" + inkscape:cy="13.773735" + inkscape:window-x="1920" + inkscape:window-y="724" + inkscape:window-maximized="1" + inkscape:current-layer="layer3" + fit-margin-left="62.25" + fit-margin-right="62.25" + fit-margin-top="62.25" + fit-margin-bottom="62.25" /><metadata + id="metadata4"><rdf:RDF><cc:Work + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs + id="defs6"><clipPath + id="e"><path + d="m 280.17,136.33 -21.5,-21.584 61,0 0,21.584 -39.5,0 z" + id="path9" + inkscape:connector-curvature="0" /></clipPath><linearGradient + id="f" + x2="1" + gradientTransform="matrix(37.935819,29.638391,-29.638391,37.935819,295.72019,166.19562)" + gradientUnits="userSpaceOnUse"><stop + stop-color="#0c542a" + offset="0" + id="stop12" /><stop + stop-color="#0c542a" + offset=".21472" + id="stop14" /><stop + stop-color="#25af64" + offset=".57995" + id="stop16" /><stop + stop-color="#25af64" + offset=".84663" + id="stop18" /><stop + stop-color="#25af64" + offset="1" + id="stop20" /></linearGradient></defs><style + type="text/css" + id="style22"> + .st0{fill:#24AF63;} + .st1{font-family:'Maven Pro';} + .st1{font-weight:'bold';} + .st2{font-size:209.8672px;} + .st3{fill:#21AF62;} + .st4{fill:#ECDC86;} + .st5{fill:#A0918F;} + .st6{fill:#3F2B29;} + .st7{fill:#396E35;} + .st8{fill:url(#d);} +</style><linearGradient + id="d" + x1="295.45999" + x2="333.34" + y1="150.75" + y2="180.35001" + gradientUnits="userSpaceOnUse"><stop + stop-color="#0D552B" + offset=".2147" + id="stop41" /><stop + stop-color="#176837" + offset=".311" + id="stop43" /><stop + stop-color="#1F8448" + offset=".4609" + id="stop45" /><stop + stop-color="#239A56" + offset=".604" + id="stop47" /><stop + stop-color="#24A860" + offset=".7361" + id="stop49" /><stop + stop-color="#25AF64" + offset=".8466" + id="stop51" /></linearGradient><g + inkscape:groupmode="layer" + id="layer2" + inkscape:label="Icon" + style="display:inline" + transform="translate(5.3761467,0)"><g + id="g4209"><path + style="fill:#24af63" + inkscape:connector-curvature="0" + id="path24" + d="m 1084.1,163.75 0,3.6 c -0.1,0 -0.1,0 -0.2,0.1 l -1.8,-1.5 c -4,-3.4 -8.3,-6.4 -13.1,-8.8 -0.8,-0.4 -1.6,-0.9 -2.5,-1.1 -0.1,-0.1 -0.2,-0.2 -0.3,-0.2 -1.8,-0.7 -3.6,-1.3 -5.5,-1.8 -4.1,-0.9 -8.2,-1 -12.3,-0.2 -5.3,1.1 -10,3.4 -14.5,6.4 -4.4,3 -8.4,6.5 -12.1,10.2 -0.7,0.7 -0.7,0.7 -1.1,-0.2 -2,-4.1 -4.2,-8.1 -6.9,-11.8 -2.1,-2.8 -4.4,-5.4 -7.4,-7.2 -3,-1.9 -6.3,-2.6 -9.8,-1.7 -4.3,1 -7.8,3.6 -11.1,6.4 -2,1.5 -3.8,3.3 -5.6,5 -1.7,1.5 -3.3,3 -5,4.5 -0.3,0.3 -0.5,0.3 -0.8,0 -1.7,-1.8 -3.5,-3.4 -5.6,-4.5 -3.1,-1.7 -6.3,-1.9 -9.6,-0.8 -2.8,0.9 -5.2,2.4 -7.7,4 -1,0.6 -1.9,1.3 -2.9,1.8 l 0,-0.2 c 0.1,-0.2 0.1,-0.4 0.1,-0.6 0.2,-4.4 0.5,-8.9 1.2,-13.3 1,-6.1 2.5,-12 5.2,-17.5 2,-4.1 4.7,-7.9 8.1,-11 4.5,-4.1 9.8,-6.7 15.6,-8.3 6.3,-1.8 12.7,-2.6 19.2,-2.9 2.6,-0.1 5.1,-0.2 7.7,-0.3 1.3,0.5 2.6,0.8 3.9,1.2 1.9,0.6 3.8,1.2 5.7,1.7 1,0.4 1.9,0.7 2.9,1.1 3.7,1.3 7.3,3 10.4,5.5 0.8,0.6 1.6,1.3 2.4,2 -0.2,-0.6 -0.4,-1.1 -0.6,-1.7 -1.4,-3.7 -3.5,-6.7 -6.9,-8.8 -1.4,-0.9 -2.9,-1.5 -4.4,-2.3 0.1,0 0.3,0 0.4,-0.1 4.5,-0.8 9.1,-1.2 13.7,-1.4 3.9,-0.2 7.9,-0.1 11.8,0.3 4.6,0.5 9.1,1.4 13.4,3 6.4,2.4 11.9,6.1 16.2,11.5 3.7,4.7 6.1,10.1 7.6,15.9 1.5,5.7 2.1,11.6 2.3,17.5 -0.1,2.1 -0.1,4.3 -0.1,6.5 z" + class="st0" /><path + style="fill:#ecdc86" + inkscape:connector-curvature="0" + id="path26" + d="m 1084.1,157.15 0.1,0 0,6.6 -0.1,0 0,-6.6 z" + class="st4" /><path + style="fill:#a0918f" + inkscape:connector-curvature="0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,7.8 -4.4,11.9 -0.9,3.5 -1.5,7.1 -1.8,10.7 -0.2,2.8 -0.3,5.6 -0.2,8.4 0.1,3.4 0.5,6.8 0.9,10.3 0.7,5.7 1.7,11.4 2.7,17.1 0.5,3.1 0.9,6.3 1.5,9.5 0.7,4.6 3.3,8 7,10.6 0,-0.1 0.2,0 0.3,0.1 z" + class="st4" /><path + style="fill:#3f2b29" + inkscape:connector-curvature="0" + id="path34" + d="m 1043.1,62.35 4.5,0 c 3.6,0.2 7.2,0.8 10.6,2 2.7,0.9 3.3,2.7 1.7,5 -1.1,1.6 -2.7,2.8 -4.4,3.9 -2.1,1.4 -4.4,2.6 -6.9,3.5 -2.5,1 -4.9,0 -6.5,-2.5 -0.5,-0.8 -0.9,-1.6 -1.1,-2.5 -0.1,-0.3 -0.2,-0.4 -0.5,-0.4 -5.6,-1 -10.6,0.3 -14.7,4.3 -3.4,3.2 -5.4,7.3 -6.8,11.7 -1.3,4 -1.9,8 -2.1,12.2 -0.2,3.7 0.1,7.4 0.6,11 0.1,0.6 0.3,1.2 0.3,1.9 0.1,0.8 -0.2,1.5 -0.8,1.9 -0.7,0.5 -1.5,0.4 -2.3,0.4 -1.9,-0.6 -3.8,-1.2 -5.7,-1.7 l 0,-1.3 c 0,-2 0,-3.9 0.1,-5.9 0.4,-7.7 1.6,-15.3 4.6,-22.5 2.2,-5.4 5.4,-10.1 9.9,-13.8 3.7,-3.1 7.9,-5.1 12.6,-6.2 2.4,-0.6 4.6,-0.9 6.9,-1 z" + class="st6" /><path + style="fill:#396e35" + inkscape:connector-curvature="0" + id="path36" + d="m 1014.8,114.65 c 0.8,0 1.6,0.1 2.3,-0.4 0.7,-0.5 0.9,-1.2 0.8,-1.9 -0.1,-0.6 -0.2,-1.3 -0.3,-1.9 0.4,0 0.7,-0.1 1.1,-0.1 1.4,0.8 2.9,1.5 4.4,2.3 3.4,2.1 5.5,5.1 6.9,8.8 0.2,0.6 0.4,1.1 0.6,1.7 -0.8,-0.7 -1.6,-1.4 -2.4,-2 -3.2,-2.4 -6.7,-4.1 -10.4,-5.5 -1.1,-0.3 -2,-0.6 -3,-1 z" + class="st7" /><path + style="fill:#396e35" + inkscape:connector-curvature="0" + id="path38" + d="m 1009.1,111.65 0,1.3 c -1.3,-0.4 -2.6,-0.7 -3.9,-1.2 1.4,-0.1 2.7,-0.1 3.9,-0.1 z" + class="st7" /></g></g><g + inkscape:groupmode="layer" + id="layer3" + inkscape:label="Text" + style="display:inline" + transform="translate(5.3761467,0)"><text + x="48.898899" + y="241.24541" + font-size="209.87px" + font-weight="bold" + id="text53" + style="font-weight:bold;font-size:209.86999512px;font-family:'Maven Pro'"><tspan + class="st0 st1 st2" + x="48.898899" + y="241.24541" + font-size="209.87px" + font-weight="bold" + id="tspan55" + style="font-weight:bold;font-size:209.86720276px;font-family:'Maven Pro';fill:#24af63">nf-<tspan + id="tspan57" + style="fill:#000000" /></tspan></text> +<text + x="357.14139" + y="241.24541" + font-size="209.87px" + font-weight="bold" + id="text69" + style="font-weight:bold;font-size:209.86999512px;font-family:'Maven Pro'"><tspan + class="st0 st1 st2" + x="357.14139" + y="241.24541" + font-size="209.87px" + font-weight="bold" + id="tspan71" + style="font-weight:bold;font-size:209.86720276px;font-family:'Maven Pro';fill:#24af63"><tspan + id="tspan73" + style="fill:#000000">core/</tspan></tspan></text> +<text + x="-260.05042" + y="457.04541" + font-weight="bold" + id="text59" + style="font-weight:bold;font-family:'Maven Pro'"><tspan + class="st1 st2" + x="47.849564" + y="457.04541" + font-size="209.87px" + font-weight="bold" + id="tspan61" + style="font-weight:bold;font-size:209.86720276px;font-family:'Maven Pro'">hic</tspan></text> +<path + d="m 300.43725,166.1155 -21.53224,21.61638 61.0915,0 0,-21.61638 -39.55926,0 z" + id="path67" + inkscape:connector-curvature="0" + style="fill:url(#f)" /></g></svg> \ No newline at end of file diff --git a/docs/usage.md b/docs/usage.md index 03acd69bbca376826643231be66742d4cc3a28e1..53d922a2fddf53e8b3924b16f7edc3fe97464d73 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -51,6 +51,11 @@ * [`--splitFastq`](#--splitFastq) * [`--saveReference`](#--saveReference) * [`--saveAlignedIntermediates`](#--saveAlignedIntermediates) +* [Skip options](#skip-options) + * [--skip_maps](#--skip_maps) + * [--skip_ice](#--skip_ice) + * [--skip_cool](#--skip_cool) + * [--skip_multiqc](#--skip_multiqc) * [Job resources](#job-resources) * [Automatic resubmission](#automatic-resubmission) * [Custom resource requests](#custom-resource-requests) @@ -457,6 +462,40 @@ If specified, all intermediate mapping files are saved and exported in the resul --saveReference ``` +## Skip options + +#### `--skip_maps` + +If defined, the workflow stops with the list of valid interactions, and the genome-wide maps are not built. Usefult for capture-C analysis. Default: false + +```bash +--skip_maps +``` + +#### `--skip_ice` + +If defined, the ICE normalization is not run on the raw contact maps. Default: false + +```bash +--skip_ice +``` + +#### `--skip_cool` + +If defined, cooler files are not generated. Default: false + +```bash +--skip_cool +``` + +#### `--skip_multiqc` + +If defined, the MultiQC report is not generated. Default: false + +```bash +--skip_multiqc +``` + ## Job resources ### Automatic resubmission Each step in the pipeline has a default set of requirements for number of CPUs, memory and time. For most of the steps in the pipeline, if the job exits with an error code of `143` (exceeded requested resources) it will automatically resubmit with higher requests (2 x original, then 3 x original). If it still fails after three times then the pipeline is stopped. diff --git a/main.nf b/main.nf index 0d51db3548aff9e55c2f3fd38b5ea9d42e722b57..1bd5a3a821f01b05887aa3dc1fefbee47a58fc34 100644 --- a/main.nf +++ b/main.nf @@ -64,6 +64,7 @@ def helpMessage() { -name Name for the pipeline run. If not specified, Nextflow will automatically generate a random mnemonic. Default: None Step options: + --skip_maps Skip generation of contact maps. Useful for capture-C. Default: false --skip_ice Skip ICE normalization. Default: false --skip_cool Skip generation of cool files. Default: false @@ -666,12 +667,17 @@ process remove_duplicates { if ( params.rm_dup ){ """ mkdir -p stats/${sample} + + ## Sort valid pairs and remove read pairs with same starts (i.e duplicated read pairs) sort -T /tmp/ -S 50% -k2,2V -k3,3n -k5,5V -k6,6n -m ${vpairs} | \ awk -F"\\t" 'BEGIN{c1=0;c2=0;s1=0;s2=0}(c1!=\$2 || c2!=\$5 || s1!=\$3 || s2!=\$6){print;c1=\$2;c2=\$5;s1=\$3;s2=\$6}' > ${sample}.allValidPairs + echo -n "valid_interaction\t" > stats/${sample}/${sample}_allValidPairs.mergestat cat ${vpairs} | wc -l >> stats/${sample}/${sample}_allValidPairs.mergestat echo -n "valid_interaction_rmdup\t" >> stats/${sample}/${sample}_allValidPairs.mergestat cat ${sample}.allValidPairs | wc -l >> stats/${sample}/${sample}_allValidPairs.mergestat + + ## Count short range (<20000) vs long range contacts awk 'BEGIN{cis=0;trans=0;sr=0;lr=0} \$2 == \$5{cis=cis+1; d=\$6>\$3?\$6-\$3:\$3-\$6; if (d<=20000){sr=sr+1}else{lr=lr+1}} \$2!=\$5{trans=trans+1}END{print "trans_interaction\\t"trans"\\ncis_interaction\\t"cis"\\ncis_shortRange\\t"sr"\\ncis_longRange\\t"lr}' ${sample}.allValidPairs >> stats/${sample}/${sample}_allValidPairs.mergestat """ @@ -683,6 +689,8 @@ process remove_duplicates { cat ${vpairs} | wc -l >> stats/${sample}/${sample}_allValidPairs.mergestat echo -n "valid_interaction_rmdup\t" >> stats/${sample}/${sample}_allValidPairs.mergestat cat ${sample}.allValidPairs | wc -l >> stats/${sample}/${sample}_allValidPairs.mergestat + + ## Count short range (<20000) vs long range contacts awk 'BEGIN{cis=0;trans=0;sr=0;lr=0} \$2 == \$5{cis=cis+1; d=\$6>\$3?\$6-\$3:\$3-\$6; if (d<=20000){sr=sr+1}else{lr=lr+1}} \$2!=\$5{trans=trans+1}END{print "trans_interaction\\t"trans"\\ncis_interaction\\t"cis"\\ncis_shortRange\\t"sr"\\ncis_longRange\\t"lr}' ${sample}.allValidPairs >> stats/${sample}/${sample}_allValidPairs.mergestat """ }