Skip to content

Commit

Permalink
refactor: Move primer3 to a subworkflow
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller committed Jul 29, 2024
1 parent 3c4aef5 commit ca1aed0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
25 changes: 2 additions & 23 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ log.info paramsSummaryLog(workflow)
// Create a new channel of metadata from a sample sheet passed to the pipeline through the --input parameter
ch_input = Channel.fromList(samplesheetToList(params.input, "assets/schema_input.json"))

include { seqkit_fetch_target } from "./modules/seqkit_fetch_target"
include { primer3_conf } from "./modules/primer3_conf/"
include { primer3_index } from "./modules/primer3_index/"
include { primer3_calc } from "./modules/primer3_calc/"
include { primer3_results2fasta } from "./modules/primer3_results2fasta/"

include { PRIMER3 } from './subworkflows/primer3'

workflow {
// Read in bed file(s)
Expand All @@ -32,21 +29,3 @@ workflow {
Channel.fromPath(params.fasta),
)
}
workflow PRIMER3 {
take:
seq
ref

main:
seq.view()
seqkit_fetch_target(seq,ref)
target = seqkit_fetch_target.out.fasta

primer3_conf(target,ref)
primer3_index(ref)
primer3_calc(primer3_conf.out,primer3_index.out)
primer3_results2fasta(primer3_calc.out)

emit:
primer3_results2fasta.out
}
24 changes: 24 additions & 0 deletions subworkflows/primer3/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
include { seqkit_fetch_target } from "../../modules/seqkit_fetch_target"
include { primer3_conf } from "../../modules/primer3_conf/"
include { primer3_index } from "../../modules/primer3_index/"
include { primer3_calc } from "../../modules/primer3_calc/"
include { primer3_results2fasta } from "../../modules/primer3_results2fasta/"

workflow PRIMER3 {
take:
seq // = Channel.of(params.targetseq)
ref // = Channel.fromPath(params.fasta)

main:
seq.view()
seqkit_fetch_target(seq,ref)
target = seqkit_fetch_target.out.fasta

primer3_conf(target,ref)
primer3_index(ref)
primer3_calc(primer3_conf.out,primer3_index.out)
primer3_results2fasta(primer3_calc.out)

emit:
primer3_results2fasta.out
}

0 comments on commit ca1aed0

Please sign in to comment.