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

Update CNVkit/batch #9

Merged
merged 3 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"sample": {
"type": "string",
"pattern": "^\\S+$",
"meta": ["id"],
"errorMessage": "Sample name must be provided and cannot contain spaces"
},
"bam": {
Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"nf-core": {
"cnvkit/batch": {
"branch": "master",
"git_sha": "603ecbd9f45300c9788f197d2a15a005685b4220",
"git_sha": "016397249f05f5af7b97e3ea8d64458a07df2928",
"installed_by": ["modules"]
},
"custom/dumpsoftwareversions": {
Expand Down
14 changes: 7 additions & 7 deletions modules/nf-core/cnvkit/batch/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 27 additions & 3 deletions modules/nf-core/cnvkit/batch/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/pipeline/cnvkit.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/pipeline/default.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 18 additions & 8 deletions workflows/createpanelrefs.nf
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,11 @@ for (param in checkPathParamList) if (param) file(param, checkIfExists: true)
ch_from_samplesheet = Channel.fromSamplesheet("input")

ch_input = ch_from_samplesheet.map{meta, bam, bai, cram, crai ->
if (bam) return [ [id:"panel", data_type:"bam" ], bam ]
if (cram) return [ [id:"panel", data_type:"cram" ], cram ]
}.groupTuple().branch{
bam: it[0].data_type == "bam"
cram: it[0].data_type == "cram"
if (bam) return [ meta + [data_type:"bam"], bam ]
if (cram) return [ meta + [data_type:"cram" ], cram ]
}

// Initialize file channels based on params, defined in the params.genomes[params.genome] scope
ch_fasta = params.fasta ? Channel.fromPath(params.fasta).first() : Channel.empty()
ch_fasta = params.fasta ? Channel.fromPath(params.fasta).map { fasta -> [[id:fasta.baseName],fasta]}.collect() : Channel.empty()

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -97,7 +93,21 @@ workflow CREATEPANELREFS {
ch_versions = Channel.empty()

if (params.tools && params.tools.split(',').contains('cnvkit')) {
CNVKIT_BATCH ( ch_input.bam.map{meta, bam -> [ meta, [], bam ]}, ch_fasta, [], [], [], true )

ch_input
.map{ meta, bam ->
new_meta = meta + [id:"panel"]
[new_meta, bam]
}
.groupTuple()
.branch{
bam: it[0].data_type == "bam"
}
.bam
.map {meta, bam -> [ meta, [], bam ]}
.set { ch_cnvkit_input }

CNVKIT_BATCH ( ch_cnvkit_input, ch_fasta, [[:],[]], [[:],[]], [[:],[]], true )
ch_versions = ch_versions.mix(CNVKIT_BATCH.out.versions)
}

Expand Down
Loading