-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
Isn't hic_bamtobed only filtering, not subsampling as thats the prior step?
|
|
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. |
There was a problem hiding this 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.
subworkflows/local/hic_mapping.nf
Outdated
@@ -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 |
There was a problem hiding this comment.
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
}
modules/local/subsample_bam.nf
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${percentage}
There was a problem hiding this comment.
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.
PR checklist
nf-core lint
).nextflow run . -profile test,docker --outdir <OUTDIR>
).docs/usage.md
is updated.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