-
Notifications
You must be signed in to change notification settings - Fork 387
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
implementation of goleft/indexcov #1312
Open
lindenb
wants to merge
11
commits into
nf-core:dev
Choose a base branch
from
lindenb:pl_indexcov
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
59026dc
Merge pull request #1244 from nf-core/dev
FriederikeHanssen f034b73
Merge pull request #1264 from nf-core/dev
maxulysse 57c10f6
1st commit indexcov
lindenb 5f69ad8
update schema
lindenb 4ac388d
fix include in subworkflows/local/bam_variant_calling_germline_all/ma…
lindenb 33d20f6
fix module
lindenb 05359a4
indexcov implementation
lindenb 147c449
publish doesn work
lindenb cc092f8
Merge branches 'master' and 'master' of https://github.com/lindenb/sarek
lindenb 431b044
merge with upstream/dev
lindenb 3c7ef81
Merge branch 'dev' into pl_indexcov
maxulysse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Config file for defining DSL2 per module options and publishing paths | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Available keys to override module options: | ||
ext.args = Additional arguments appended to command in module. | ||
ext.prefix = File name prefix for output files. | ||
ext.when = When to run the module. | ||
---------------------------------------------------------------------------------------- | ||
*/ | ||
|
||
|
||
process { | ||
if (params.tools && params.tools.split(',').contains('indexcov')) { | ||
withName: 'GOLEFT_INDEXCOV' { | ||
ext.when = { !params.wes } | ||
ext.args = {""} | ||
ext.prefix = { "indexcov" } | ||
publishDir = [ | ||
mode: params.publish_dir_mode, | ||
path: { "${params.outdir}/variant_calling/indexcov" }, | ||
pattern: "*.png" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Config file for defining DSL2 per module options and publishing paths | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Available keys to override module options: | ||
ext.args = Additional arguments appended to command in module. | ||
ext.prefix = File name prefix for output files. | ||
ext.when = When to run the module. | ||
---------------------------------------------------------------------------------------- | ||
*/ | ||
|
||
|
||
process { | ||
if (params.tools && params.tools.split(',').contains('indexcov')) { | ||
withName: 'SAMTOOLS_INDEX_FOR_INDEXCOV' { | ||
ext.when = { !params.wes } | ||
ext.args = {"-F 3844 -q 30"} | ||
ext.prefix = { "${meta.id}" } | ||
publishDir = [ | ||
enabled : false | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
process GOLEFT_INDEXCOV { | ||
label 'process_single' | ||
|
||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/goleft:0.2.4--h9ee0642_1': | ||
'biocontainers/goleft:0.2.4--h9ee0642_1' }" | ||
|
||
input: | ||
val(meta) | ||
path(bams) | ||
path(fasta) | ||
path(fai) | ||
output: | ||
path("${prefix}/*"),emit:output | ||
path("versions.yml"),emit:versions | ||
script: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.id}" | ||
def input_files = bams.findAll{it.name.endsWith(".bam")} + bams.findAll{it.name.endsWith(".crai")} | ||
def extranormalize = input_files.any{it.name.endsWith(".crai")} ? " --extranormalize " : "" | ||
""" | ||
goleft indexcov \\ | ||
--fai "${fai}" \\ | ||
--directory "${prefix}" \\ | ||
${extranormalize} \\ | ||
$args \\ | ||
${input_files.join(" ")} | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
goleft: \$(goleft --version 2>&1 | head -n 1 | sed 's/^.*goleft Version: //') | ||
END_VERSIONS | ||
""" | ||
Comment on lines
+2
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you indent so it is similar to the other modules? |
||
|
||
stub: | ||
def args = task.ext.args ?: '' | ||
prefix = task.ext.prefix ?: "${meta.id}" | ||
""" | ||
mkdir "${prefix}" | ||
touch "${prefix}/${prefix}-indexcov.bed.gz" | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
goleft: \$(goleft --version 2>&1 | head -n 1 | sed 's/^.*goleft Version: //') | ||
END_VERSIONS | ||
""" | ||
} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
process SAMTOOLS_INDEX_FOR_INDEXCOV { | ||
tag "$meta.id" | ||
label 'process_low' | ||
|
||
conda "bioconda::samtools=1.17" | ||
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? | ||
'https://depot.galaxyproject.org/singularity/samtools:1.17--h00cdaf9_0' : | ||
'biocontainers/samtools:1.17--h00cdaf9_0' }" | ||
|
||
input: | ||
tuple val(meta), path(input), path(bai) | ||
path(fasta) | ||
path(fai) | ||
|
||
output: | ||
tuple path("${meta.id}.indexcov.bam"),path("${meta.id}.indexcov.bam.bai"), emit: output | ||
path "versions.yml" , emit: versions | ||
|
||
script: | ||
def args = task.ext.args ?: '' | ||
|
||
""" | ||
# write BAM header only | ||
samtools view --header-only -O BAM \ | ||
--threads ${task.cpus} \ | ||
-o "${meta.id}.indexcov.bam" \ | ||
--reference "${fasta}" \ | ||
"${input}" | ||
|
||
# create index without writing BAM (redirecting to /dev/null) | ||
samtools view ${args} --uncompressed \ | ||
--threads ${task.cpus} \ | ||
-o "/dev/null##idx##${meta.id}.indexcov.bam.bai" \ | ||
--write-index \ | ||
-O BAM \ | ||
--reference "${fasta}" \ | ||
"${input}" | ||
|
||
|
||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') | ||
END_VERSIONS | ||
""" | ||
|
||
stub: | ||
""" | ||
touch "${meta.id}.indexcov.bam" | ||
touch "${meta.id}.indexcov.bam.bai" | ||
|
||
cat <<-END_VERSIONS > versions.yml | ||
"${task.process}": | ||
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') | ||
END_VERSIONS | ||
""" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,29 @@ | ||||||
// | ||||||
// INDEXCOV : call large CNVs using goleft indexcov | ||||||
// | ||||||
// For all modules here: | ||||||
// A when clause condition is defined in the conf/modules.config to determine if the module should be run | ||||||
|
||||||
include { SAMTOOLS_INDEX_FOR_INDEXCOV } from '../../../modules/local/samtools_index_for_indexcov/main' | ||||||
include { GOLEFT_INDEXCOV } from '../../../modules/local/goleft/indexcov/main' | ||||||
|
||||||
|
||||||
workflow BAM_GOLEFT_INDEXCOV { | ||||||
take: | ||||||
bam // channel: [mandatory] [ meta, bam, bai ] | ||||||
fasta // channel: [mandatory] [ fasta ] | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
fai // channel: [mandatory] [ fai ] | ||||||
|
||||||
main: | ||||||
versions = Channel.empty() | ||||||
|
||||||
samtools_index = SAMTOOLS_INDEX_FOR_INDEXCOV(bam, fasta, fai) | ||||||
versions = versions.mix(samtools_index.versions.first()) | ||||||
|
||||||
indexcov_ch = GOLEFT_INDEXCOV([id:"PREFIX"], samtools_index.output.flatten().collect(), fasta, fai) | ||||||
versions = versions.mix(indexcov_ch.versions) | ||||||
|
||||||
emit: | ||||||
versions | ||||||
} | ||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is the tool run on all bams for all samples in one job?
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.
nevermind I see it further down. The docs say 30sec per 30 WGS 🤯 . Any idea how it scales with number of genomes?