diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/.dockstore.yml b/workflows/epigenetics/correlation-of-samples-on-peaks/.dockstore.yml new file mode 100644 index 0000000000..5ea14e00cc --- /dev/null +++ b/workflows/epigenetics/correlation-of-samples-on-peaks/.dockstore.yml @@ -0,0 +1,15 @@ +version: 1.2 +workflows: +- name: correlation-of-samples-on-peaks + subclass: Galaxy + publish: true + primaryDescriptorPath: /correlation-of-samples-on-peaks.ga + testParameterFiles: + - /correlation-of-samples-on-peaks-tests.yml + authors: + - name: Lucille Delisle + orcid: 0000-0002-1964-4960 + - name: Alexandre Mayran + orcid: 0000-0002-1228-0308 + - name: Olusegun E. Adebayo + orcid: 0009-0003-9444-3944 diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/CHANGELOG.md b/workflows/epigenetics/correlation-of-samples-on-peaks/CHANGELOG.md new file mode 100644 index 0000000000..e4746af821 --- /dev/null +++ b/workflows/epigenetics/correlation-of-samples-on-peaks/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## [0.1] 20206-07-06 + +First release. \ No newline at end of file diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/README.md b/workflows/epigenetics/correlation-of-samples-on-peaks/README.md new file mode 100644 index 0000000000..9c2eb9b83c --- /dev/null +++ b/workflows/epigenetics/correlation-of-samples-on-peaks/README.md @@ -0,0 +1,21 @@ +# correlation of samples on peaks: + +## Input datasets + +- A collection (list) of peak files. +- A collection (list) of BAM or CRAM files + +## Inputs values + +- Reference genome: this field will be adapted to the genomes for bedtools sort (dbkeys table) + +## Processing + +- The workflow will concatenate the list of peak files given as input +- Sorts and merges the concatenated BED file by Chromosome using `bedtools sortBED` and `bedtools mergeBED`, respectively. +- Computes the read coverages for each BAM/CRAM file on the sorted and merged list of genomic region present in the bed files using `multiBamSummary`. +- Calculate and visualize pairwise correlation values between the read coverages using the tool `plotCorrelation`. +- The workflow produces three outputs: + - a compressed numpy array containing the raw count of the read coverages (i.e., the output of `multiBamSummary`) in .npz format + - The same raw count of the read coverages (i.e., the output of `multiBamSummary`) in .tabular format + - a plot of pairwise correlation values between the read coverages (i.e., the output of `plotCorrelation`). diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/correlation-of-samples-on-peaks-tests.yml b/workflows/epigenetics/correlation-of-samples-on-peaks/correlation-of-samples-on-peaks-tests.yml new file mode 100644 index 0000000000..5fcc4e4012 --- /dev/null +++ b/workflows/epigenetics/correlation-of-samples-on-peaks/correlation-of-samples-on-peaks-tests.yml @@ -0,0 +1,32 @@ +- doc: Test outline for correlation-of-samples-on-peaks + job: + Collection of peak files: + class: Collection + collection_type: list + elements: + - class: File + identifier: peak2 + path: test-data/peak2.bed + - class: File + identifier: peak1 + path: test-data/peak1.bed + BAM or CRAM files: + class: Collection + collection_type: list + elements: + - class: File + identifier: sample2 + path: test-data/sample2.bam + - class: File + identifier: sample1 + path: test-data/sample1.bam + Reference genome: mm39 + outputs: + correlation plot: + path: test-data/correlation plot.png + deeptool raw counts: + path: test-data/deeptool raw counts.tabular + sort: true + deeptools coverage matrix: + path: test-data/deeptools coverage matrix.deeptools_coverage_matrix + compare: sim_size diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/correlation-of-samples-on-peaks.ga b/workflows/epigenetics/correlation-of-samples-on-peaks/correlation-of-samples-on-peaks.ga new file mode 100644 index 0000000000..885d7e913e --- /dev/null +++ b/workflows/epigenetics/correlation-of-samples-on-peaks/correlation-of-samples-on-peaks.ga @@ -0,0 +1,377 @@ +{ + "a_galaxy_workflow": "true", + "annotation": "Takes a list of peak files, sorts and merges them using bedtools. Then it counts the number of reads per regions for each BAM files, calculates their correlation and returns the deeptools raw counts, coverage matrix and the correlation plot.", + "comments": [], + "creator": [ + { + "class": "Person", + "identifier": "https://orcid.org/0000-0002-1964-4960", + "name": "Lucille Delisle" + }, + { + "class": "Person", + "identifier": "https://orcid.org/0000-0002-1228-0308", + "name": "Alexandre Mayran" + }, + { + "class": "Person", + "identifier": "https://orcid.org/0009-0003-9444-3944", + "name": "Olusegun E. Adebayo" + } + ], + "format-version": "0.1", + "license": "MIT", + "release":"0.1", + "name": "correlation of samples on peaks", + "readme": "# correlation of samples on peaks:\n\n## Input datasets\n\n- A collection (list) of peak files.\n- A collection (list) of BAM or CRAM files\n\n## Inputs values\n\n- Reference genome: this field will be adapted to the genomes for bedtools sort (dbkeys table)\n\n## Processing\n\n- The workflow will concatenate the list of peak files given as input\n- Sorts and merges the concatenated BED file by Chromosome using `bedtools sortBED` and `bedtools mergeBED`, respectively.\n- Computes the read coverages for each BAM/CRAM file on the sorted and merged list of genomic region present in the bed files using `multiBamSummary`.\n- Calculate and visualize pairwise correlation values between the read coverages using the tool `plotCorrelation`.\n- The workflow produces three outputs:\n - a compressed numpy array containing the raw count of the read coverages (i.e., the output of `multiBamSummary`) in .npz format\n - The same raw count of the read coverages (i.e., the output of `multiBamSummary`) in .tabular format\n - a plot of pairwise correlation values between the read coverages (i.e., the output of `plotCorrelation`).", + "report": { + "markdown": "\n# Workflow Execution Report\n\n## Workflow Inputs\n```galaxy\ninvocation_inputs()\n```\n\n## Workflow Outputs\n```galaxy\ninvocation_outputs()\n```\n\n## Workflow\n```galaxy\nworkflow_display()\n```\n" + }, + "steps": { + "0": { + "annotation": "Here we are taking a collection of all peak files you wish to use.", + "content_id": null, + "errors": null, + "id": 0, + "input_connections": {}, + "inputs": [ + { + "description": "Here we are taking a collection of all peak files you wish to use.", + "name": "Collection of peak files" + } + ], + "label": "Collection of peak files", + "name": "Input dataset collection", + "outputs": [], + "position": { + "left": 0, + "top": 4.906208594894025 + }, + "tool_id": null, + "tool_state": "{\"optional\": false, \"format\": [\"bed\", \"encodepeak\"], \"tag\": null, \"collection_type\": \"list\", \"fields\": null, \"column_definitions\": null}", + "tool_version": null, + "type": "data_collection_input", + "uuid": "798ed613-1dcd-46b1-99b6-1881dc6ae68e", + "when": null, + "workflow_outputs": [] + }, + "1": { + "annotation": "Select reference genome of your choice", + "content_id": null, + "errors": null, + "id": 1, + "input_connections": {}, + "inputs": [ + { + "description": "Select reference genome of your choice", + "name": "Reference genome" + } + ], + "label": "Reference genome", + "name": "Input parameter", + "outputs": [], + "position": { + "left": 0.9320604717288035, + "top": 114.05922959764115 + }, + "tool_id": null, + "tool_state": "{\"multiple\": false, \"validators\": [], \"restrictOnConnections\": true, \"parameter_type\": \"text\", \"optional\": false}", + "tool_version": null, + "type": "parameter_input", + "uuid": "06dee00a-a02e-47d8-aff9-5ef58d0519a9", + "when": null, + "workflow_outputs": [] + }, + "2": { + "annotation": "This takes the BAM /CRAM formated peak files ", + "content_id": null, + "errors": null, + "id": 2, + "input_connections": {}, + "inputs": [ + { + "description": "This takes the BAM /CRAM formated peak files ", + "name": "BAM or CRAM files" + } + ], + "label": "BAM or CRAM files", + "name": "Input dataset collection", + "outputs": [], + "position": { + "left": 3.3762628479699686, + "top": 253.99402266636798 + }, + "tool_id": null, + "tool_state": "{\"optional\": false, \"tag\": \"\", \"collection_type\": \"list\", \"fields\": null, \"column_definitions\": null}", + "tool_version": null, + "type": "data_collection_input", + "uuid": "f772380f-1b20-45f8-b0f2-5f4a2c0238a2", + "when": null, + "workflow_outputs": [] + }, + "3": { + "annotation": "This step concatenate multiple datasets into one", + "content_id": "toolshed.g2.bx.psu.edu/repos/bgruening/text_processing/tp_cat/9.5+galaxy3", + "errors": null, + "id": 3, + "input_connections": { + "inputs": { + "id": 0, + "output_name": "output" + } + }, + "inputs": [], + "label": "Concatenate all files into one", + "name": "Concatenate datasets", + "outputs": [ + { + "name": "out_file1", + "type": "input" + } + ], + "position": { + "left": 306.7937026785099, + "top": 3.3977051244017105 + }, + "post_job_actions": { + "HideDatasetActionout_file1": { + "action_arguments": {}, + "action_type": "HideDatasetAction", + "output_name": "out_file1" + } + }, + "tool_id": "toolshed.g2.bx.psu.edu/repos/bgruening/text_processing/tp_cat/9.5+galaxy3", + "tool_shed_repository": { + "changeset_revision": "ab83aa685821", + "name": "text_processing", + "owner": "bgruening", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"inputs\": {\"__class__\": \"ConnectedValue\"}, \"queries\": [], \"__page__\": 0, \"__rerun_remap_job_id__\": null}", + "tool_uuid": null, + "tool_version": "9.5+galaxy3", + "type": "tool", + "uuid": "90edcb8c-3655-4f44-b55e-3c1d80edb0f5", + "when": null, + "workflow_outputs": [] + }, + "4": { + "annotation": "This sorts the bed files by chosen rules", + "content_id": "toolshed.g2.bx.psu.edu/repos/iuc/bedtools/bedtools_sortbed/2.31.1+galaxy0", + "errors": null, + "id": 4, + "input_connections": { + "genome_file_opts|genome": { + "id": 1, + "output_name": "output" + }, + "input": { + "id": 3, + "output_name": "out_file1" + } + }, + "inputs": [ + { + "description": "runtime parameter for tool bedtools SortBED", + "name": "genome_file_opts" + } + ], + "label": "Sort bed files", + "name": "bedtools SortBED", + "outputs": [ + { + "name": "output", + "type": "input" + } + ], + "position": { + "left": 605.0864927261093, + "top": 0 + }, + "post_job_actions": { + "HideDatasetActionoutput": { + "action_arguments": {}, + "action_type": "HideDatasetAction", + "output_name": "output" + } + }, + "tool_id": "toolshed.g2.bx.psu.edu/repos/iuc/bedtools/bedtools_sortbed/2.31.1+galaxy0", + "tool_shed_repository": { + "changeset_revision": "2892111d91f8", + "name": "bedtools", + "owner": "iuc", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"genome_file_opts\": {\"genome_file_opts_selector\": \"loc\", \"__current_case__\": 0, \"genome\": {\"__class__\": \"ConnectedValue\"}}, \"input\": {\"__class__\": \"ConnectedValue\"}, \"option\": \"\", \"__page__\": 0, \"__rerun_remap_job_id__\": null}", + "tool_uuid": null, + "tool_version": "2.31.1+galaxy0", + "type": "tool", + "uuid": "870344a2-a7ee-491f-a0e8-ffb4bb722092", + "when": null, + "workflow_outputs": [] + }, + "5": { + "annotation": "Merges with the sorted bed file", + "content_id": "toolshed.g2.bx.psu.edu/repos/iuc/bedtools/bedtools_mergebed/2.31.1+galaxy2", + "errors": null, + "id": 5, + "input_connections": { + "input": { + "id": 4, + "output_name": "output" + } + }, + "inputs": [], + "label": "Merge bed file", + "name": "bedtools MergeBED", + "outputs": [ + { + "name": "output", + "type": "bed" + } + ], + "position": { + "left": 902.4818556497356, + "top": 4.474324538251267 + }, + "post_job_actions": { + "HideDatasetActionoutput": { + "action_arguments": {}, + "action_type": "HideDatasetAction", + "output_name": "output" + } + }, + "tool_id": "toolshed.g2.bx.psu.edu/repos/iuc/bedtools/bedtools_mergebed/2.31.1+galaxy2", + "tool_shed_repository": { + "changeset_revision": "2892111d91f8", + "name": "bedtools", + "owner": "iuc", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"c_and_o_argument_repeat\": [], \"distance\": \"0\", \"header\": false, \"input\": {\"__class__\": \"ConnectedValue\"}, \"strand\": \"\", \"__page__\": 0, \"__rerun_remap_job_id__\": null}", + "tool_uuid": null, + "tool_version": "2.31.1+galaxy2", + "type": "tool", + "uuid": "fa82b514-9304-4c7c-b847-8e3f98d9e9b0", + "when": null, + "workflow_outputs": [] + }, + "6": { + "annotation": "", + "content_id": "toolshed.g2.bx.psu.edu/repos/bgruening/deeptools_multi_bam_summary/deeptools_multi_bam_summary/3.5.2+galaxy0", + "errors": null, + "id": 6, + "input_connections": { + "mode|region_file": { + "id": 5, + "output_name": "output" + }, + "multibam_conditional|bamfiles": { + "id": 2, + "output_name": "output" + } + }, + "inputs": [ + { + "description": "runtime parameter for tool multiBamSummary", + "name": "mode" + }, + { + "description": "runtime parameter for tool multiBamSummary", + "name": "multibam_conditional" + } + ], + "label": "multiBam summary", + "name": "multiBamSummary", + "outputs": [ + { + "name": "outFile", + "type": "deeptools_coverage_matrix" + }, + { + "name": "outFileRawCounts", + "type": "tabular" + } + ], + "position": { + "left": 1201.677284108745, + "top": 1.3972221596870895 + }, + "post_job_actions": {}, + "tool_id": "toolshed.g2.bx.psu.edu/repos/bgruening/deeptools_multi_bam_summary/deeptools_multi_bam_summary/3.5.2+galaxy0", + "tool_shed_repository": { + "changeset_revision": "1fcb7adc39b8", + "name": "deeptools_multi_bam_summary", + "owner": "bgruening", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"__input_ext\": \"input\", \"advancedOpt\": {\"showAdvancedOpt\": \"no\", \"__current_case__\": 0}, \"chromInfo\": \"/data/galaxy/galaxy/var/tool-data/mm10_UCSC/len/mm10_UCSC.len\", \"custom_sample_labels_conditional\": {\"custom_labels_select\": \"No\", \"__current_case__\": 0}, \"mode\": {\"modeOpt\": \"BED-file\", \"__current_case__\": 1, \"region_file\": {\"__class__\": \"ConnectedValue\"}}, \"multibam_conditional\": {\"orderMatters\": \"No\", \"__current_case__\": 0, \"bamfiles\": {\"__class__\": \"ConnectedValue\"}}, \"outRawCounts\": true, \"region\": \"\", \"scalingFactors\": false, \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_uuid": null, + "tool_version": "3.5.2+galaxy0", + "type": "tool", + "uuid": "6486b3e8-5e36-4678-970e-f65cd3213f36", + "when": null, + "workflow_outputs": [ + { + "label": "deeptools coverage matrix", + "output_name": "outFile", + "uuid": "91131b1a-2471-4e71-8013-688bb48cda8c" + }, + { + "label": "deeptool raw counts", + "output_name": "outFileRawCounts", + "uuid": "1102d9c7-0b87-4388-bca5-dea638d35ad3" + } + ] + }, + "7": { + "annotation": "", + "content_id": "toolshed.g2.bx.psu.edu/repos/bgruening/deeptools_plot_correlation/deeptools_plot_correlation/3.5.2+galaxy0", + "errors": null, + "id": 7, + "input_connections": { + "corData": { + "id": 6, + "output_name": "outFile" + } + }, + "inputs": [], + "label": "Plot correlation", + "name": "plotCorrelation", + "outputs": [ + { + "name": "outFileName", + "type": "png" + } + ], + "position": { + "left": 1504.6919348478332, + "top": 5.764769589732765 + }, + "post_job_actions": {}, + "tool_id": "toolshed.g2.bx.psu.edu/repos/bgruening/deeptools_plot_correlation/deeptools_plot_correlation/3.5.2+galaxy0", + "tool_shed_repository": { + "changeset_revision": "2c66e43f1c86", + "name": "deeptools_plot_correlation", + "owner": "bgruening", + "tool_shed": "toolshed.g2.bx.psu.edu" + }, + "tool_state": "{\"corData\": {\"__class__\": \"ConnectedValue\"}, \"corMethod\": \"spearman\", \"outFileCorMatrix\": false, \"outFileFormat\": \"png\", \"plotting_type\": {\"whatToPlot\": \"heatmap\", \"__current_case__\": 0, \"zMin\": \"\", \"zMax\": \"\", \"colorMap\": \"RdYlBu\", \"plotTitle\": \"\", \"plotNumbers\": true, \"plotHeight\": \"9.5\", \"plotWidth\": \"11.0\"}, \"removeOutliers\": false, \"skipZeros\": false, \"__page__\": null, \"__rerun_remap_job_id__\": null}", + "tool_uuid": null, + "tool_version": "3.5.2+galaxy0", + "type": "tool", + "uuid": "43017614-cf22-453a-830c-098c2e3d0e4d", + "when": null, + "workflow_outputs": [ + { + "label": "correlation plot", + "output_name": "outFileName", + "uuid": "5a847bf5-94fa-446a-b1fc-558a02fd8138" + } + ] + } + }, + "tags": [], + "uuid": "82eb76a0-004f-4780-9e38-868d13d66b6c", + "version": 35 +} \ No newline at end of file diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/correlation plot.png b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/correlation plot.png new file mode 100644 index 0000000000..9e84f75d31 Binary files /dev/null and b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/correlation plot.png differ diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/deeptool raw counts.tabular b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/deeptool raw counts.tabular new file mode 100644 index 0000000000..893e03e45a --- /dev/null +++ b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/deeptool raw counts.tabular @@ -0,0 +1,21 @@ +#'chr' 'start' 'end' 'sample2' 'sample1' +chr19 104000 106000 3.0 7.0 +chr19 114000 116000 4.0 11.0 +chr19 124000 126000 1.0 1.0 +chr19 134000 136000 8.0 8.0 +chr19 144000 146000 9.0 16.0 +chr19 154000 156000 2.0 1.0 +chr19 164000 166000 20.0 20.0 +chr19 174000 176000 2.0 6.0 +chr19 184000 186000 3.0 2.0 +chr19 194000 196000 2.0 10.0 +chr19 4000 6000 7.0 5.0 +chr19 14000 16000 4.0 1.0 +chr19 24000 26000 21.0 19.0 +chr19 34000 36000 7.0 6.0 +chr19 44000 46000 2.0 1.0 +chr19 54000 56000 1.0 0.0 +chr19 64000 66000 10.0 10.0 +chr19 74000 76000 2.0 4.0 +chr19 84000 86000 11.0 5.0 +chr19 94000 96000 3.0 4.0 diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/deeptools coverage matrix.deeptools_coverage_matrix b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/deeptools coverage matrix.deeptools_coverage_matrix new file mode 100644 index 0000000000..86f431b262 Binary files /dev/null and b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/deeptools coverage matrix.deeptools_coverage_matrix differ diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/peak1.bed b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/peak1.bed new file mode 100644 index 0000000000..0a8e2427ce --- /dev/null +++ b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/peak1.bed @@ -0,0 +1,10 @@ +chr19 4000 6000 r00 0 + +chr19 14000 16000 r01 0 + +chr19 24000 26000 r02 0 + +chr19 34000 36000 r03 0 + +chr19 44000 46000 r04 0 + +chr19 54000 56000 r05 0 + +chr19 64000 66000 r06 0 + +chr19 74000 76000 r07 0 + +chr19 84000 86000 r08 0 + +chr19 94000 96000 r09 0 + diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/peak2.bed b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/peak2.bed new file mode 100644 index 0000000000..3a08da2b2b --- /dev/null +++ b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/peak2.bed @@ -0,0 +1,10 @@ +chr19 104000 106000 r10 0 + +chr19 114000 116000 r11 0 + +chr19 124000 126000 r12 0 + +chr19 134000 136000 r13 0 + +chr19 144000 146000 r14 0 + +chr19 154000 156000 r15 0 + +chr19 164000 166000 r16 0 + +chr19 174000 176000 r17 0 + +chr19 184000 186000 r18 0 + +chr19 194000 196000 r19 0 + diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/sample1.bam b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/sample1.bam new file mode 100644 index 0000000000..b926736ee1 Binary files /dev/null and b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/sample1.bam differ diff --git a/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/sample2.bam b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/sample2.bam new file mode 100644 index 0000000000..388a2e7fd9 Binary files /dev/null and b/workflows/epigenetics/correlation-of-samples-on-peaks/test-data/sample2.bam differ