Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subsample and branch hic_mapping #192

Merged
merged 14 commits into from
Jan 12, 2024
Merged

Add subsample and branch hic_mapping #192

merged 14 commits into from
Jan 12, 2024

Conversation

weaglesBio
Copy link
Contributor

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • Make sure your code lints (nf-core lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).
    Closes Hi-C Mapping - Subset for juicer hi-c #158

@weaglesBio weaglesBio self-assigned this Jan 10, 2024
Copy link
Contributor

DLBPointon commented Jan 10, 2024

Isn't hic_bamtobed only filtering, not subsampling as thats the prior step?

    //
    // SUBWORKFLOW: BAM TO BED FOR JUICER - INCLUDES SUBSAMPLING
    //

Copy link

github-actions bot commented Jan 10, 2024

nf-core lint overall result: Passed ✅ ⚠️

Posted for pipeline commit 178c32a

+| ✅ 127 tests passed       |+
#| ❔  17 tests were ignored |#
!| ❗   7 tests had warnings |!

❗ Test warnings:

  • files_exist - File not found: conf/igenomes.config
  • files_exist - File not found: .github/workflows/awstest.yml
  • files_exist - File not found: .github/workflows/awsfulltest.yml
  • nextflow_config - Config manifest.version should end in dev: '1.0.2'
  • pipeline_todos - TODO string in methods_description_template.yml: ## Update the HTML below to your prefered methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in WorkflowMain.groovy: Add Zenodo DOI for pipeline after first release
  • system_exit - System.exit in WorkflowTreeval.groovy: System.exit(1) [line 17]

❔ Tests ignored:

  • files_exist - File is ignored: assets/nf-core-treeval_logo_light.png
  • files_exist - File is ignored: conf/test_full.config
  • files_exist - File is ignored: docs/images/nf-core-treeval_logo_light.png
  • files_exist - File is ignored: docs/images/nf-core-treeval_logo_dark.png
  • nextflow_config - Config variable ignored: manifest.name
  • nextflow_config - Config variable ignored: manifest.homePage
  • files_unchanged - File ignored due to lint config: LICENSE or LICENSE.md or LICENCE or LICENCE.md
  • files_unchanged - File ignored due to lint config: .github/CONTRIBUTING.md
  • files_unchanged - File ignored due to lint config: .github/ISSUE_TEMPLATE/bug_report.yml
  • files_unchanged - File ignored due to lint config: .github/workflows/linting.yml
  • files_unchanged - File ignored due to lint config: assets/sendmail_template.txt
  • files_unchanged - File does not exist: assets/nf-core-treeval_logo_light.png
  • files_unchanged - File does not exist: docs/images/nf-core-treeval_logo_light.png
  • files_unchanged - File does not exist: docs/images/nf-core-treeval_logo_dark.png
  • files_unchanged - File ignored due to lint config: lib/NfcoreTemplate.groovy
  • files_unchanged - File ignored due to lint config: .gitignore or .prettierignore or pyproject.toml
  • actions_awstest - 'awstest.yml' workflow not found: /home/runner/work/treeval/treeval/.github/workflows/awstest.yml

✅ Tests passed:

Run details

  • nf-core/tools version 2.8
  • Run at 2024-01-11 16:43:40

@weaglesBio
Copy link
Contributor Author

Isn't hic_bamtobed only filtering, not subsampling as thats the prior step?

    //
    // SUBWORKFLOW: BAM TO BED FOR JUICER - INCLUDES SUBSAMPLING
    //

I was just trying to indicate that this use of bam to bed, incorporated the subsampling step, to distinguish from the version used for cooler. I will reword to clarify.

Copy link
Contributor

@DLBPointon DLBPointon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, just one comment to think about maybe.

@@ -210,32 +210,37 @@ workflow HIC_MAPPING {
// ch_versions = ch_versions.mix ( SNAPSHOT_HRES.out.versions )

//
// MODULE: MERGE POSITION SORTED BAM FILES AND MARK DUPLICATES
// MODULE: SUBSAMPLE BAM IF OVER 50G
Copy link
Contributor

@DLBPointon DLBPointon Jan 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to check file size and use an if block if size over 50G prior to the module. This would then stop a container being spun up just to mv a file (in the case file < 50G). Then the module can focus on subsampling.

Something akin to:

file = input.map{ it -> it[1] }
if ( file.size() > 50G ) {
    SUB_SAMPLE(input)
    fixed_ch = SUB_SAMPLE.out.subsampled
} else {
    fixed_ch = input
}

@yumisims yumisims changed the base branch from dev to galaxy_dev January 11, 2024 15:57
percentage=`wc -c !{mergedbam} | cut -d$' ' -f1 | awk '{printf "%.2f\\n", 50000000000 / $0}'`

if awk "BEGIN {exit !($percentage <= 1 )}"; then
samtools view -s $percentage -b !{mergedbam} > !{meta.id}_subsampled.bam
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${percentage}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which to change? The one in the if is being removed. The samtools parameter is referencing a shell variable, whilst {mergedbam} is a nextflow.

@DLBPointon DLBPointon merged commit 8cb5c9b into galaxy_dev Jan 12, 2024
6 checks passed
@DLBPointon DLBPointon deleted the subset_juicer branch January 12, 2024 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hi-C Mapping - Subset for juicer hi-c
3 participants