-
Notifications
You must be signed in to change notification settings - Fork 112
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
Include lofreq module, and merge lofreq and ivar results #432
base: dev
Are you sure you want to change the base?
Conversation
add lofreq module and subworkflow 'LOFREQ_IVAR'
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.
Resolve the merge conflicts, then the CI testing, will help you clarify a couple of the bugs. Let me know if you need any help with this.
saveAs: { filename -> filename.equals('versions.yml') ? null : filename } | ||
] | ||
} | ||
withName: 'VARIANTS_IVAR:IVAR_VARIANTS' { |
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.
withName: 'VARIANTS_IVAR:IVAR_VARIANTS' { | |
withName: 'IVAR_VARIANTS' { |
@@ -6,7 +6,7 @@ | |||
|
|||
def valid_params = [ | |||
protocols : ['metagenomic', 'amplicon'], | |||
variant_callers : ['ivar', 'bcftools'], | |||
variant_callers : ['ivar', 'bcftools'. 'lofreq'], |
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.
update parameter schema nf-core schema build
as wel
include { LOFREQ_CALLPARALLEL } from '../modules/nf-core/lofreq/callparallel/main' | ||
include { BCFTOOLS_MERGE } from '../modules/nf-core/bcftools/merge/main' | ||
include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main' |
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.
include { LOFREQ_CALLPARALLEL } from '../modules/nf-core/lofreq/callparallel/main' | |
include { BCFTOOLS_MERGE } from '../modules/nf-core/bcftools/merge/main' | |
include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main' | |
include { CUSTOM_DUMPSOFTWAREVERSIONS } from '../modules/nf-core/custom/dumpsoftwareversions/main' |
No need to call modules in the main workflow if they are not used in that workflow. You already call them in the LOFREQ_IVAR
subworkflow.
|
||
|
||
|
||
// SUBWORKFLOW: Call variants with Lofreq | ||
ch_lofreq_vcf = Channel.empty() | ||
//ch_vcf = Channel.empty() | ||
//ch_lofreq_tbi = Channel.empty() | ||
ch_bam | ||
.join(ch_bai, by: [0]) | ||
.map{ meta,bam,bai -> [meta, bam, bai, []] } | ||
.set{ ch_lofreq_bam_bai } | ||
if (!params.skip_variants && variant_caller == 'lofreq') { | ||
LOFREQ_CALLPARALLEL ( | ||
ch_lofreq_bam_bai, | ||
PREPARE_GENOME.out.fasta, | ||
PREPARE_GENOME.out.fai | ||
) | ||
ch_lofreq_vcf = LOFREQ_CALLPARALLEL.out.vcf | ||
//ch_lofreq_tbi = LOFREQ_CALLPARALLEL.out.tbi | ||
ch_versions = ch_versions.mix(LOFREQ_CALLPARALLEL.out.versions) | ||
|
||
// SUBWORKFLOW: Call variants with ivar | ||
VARIANTS_IVAR ( | ||
ch_bam, | ||
PREPARE_GENOME.out.fasta, | ||
(params.protocol == 'amplicon' || !params.skip_asciigenome || !params.skip_markduplicates) ? PREPARE_GENOME.out.fai : [], | ||
(params.protocol == 'amplicon' || !params.skip_asciigenome || !params.skip_markduplicates) ? PREPARE_GENOME.out.chrom_sizes : [], | ||
params.gff ? PREPARE_GENOME.out.gff : [], | ||
(params.protocol == 'amplicon' && params.primer_bed) ? PREPARE_GENOME.out.primer_bed : [], | ||
PREPARE_GENOME.out.snpeff_db, | ||
PREPARE_GENOME.out.snpeff_config, | ||
ch_ivar_variants_header_mqc | ||
) | ||
ch_vcf = VARIANTS_IVAR.out.vcf | ||
ch_tbi = VARIANTS_IVAR.out.tbi | ||
ch_ivar_counts_multiqc = VARIANTS_IVAR.out.multiqc_tsv | ||
ch_bcftools_stats_multiqc = VARIANTS_IVAR.out.stats | ||
ch_snpeff_multiqc = VARIANTS_IVAR.out.snpeff_csv | ||
ch_snpsift_txt = VARIANTS_IVAR.out.snpsift_txt | ||
ch_versions = ch_versions.mix(VARIANTS_IVAR.out.versions) | ||
|
||
|
||
// MODULE: Merge ivar and lofreq variants | ||
BCFTOOLS_MERGE( | ||
ch_lofreq_vcf, | ||
ch_vcf, | ||
//ch_vcf, | ||
//ch_tbi, | ||
PREPARE_GENOME.out.fasta, | ||
PREPARE_GENOME.out.fai | ||
) | ||
ch_merged_vcf = BCFTOOLS_MERGE.out.merged_variants | ||
ch_versions = ch_versions.mix(BCFTOOLS_MERGE.out.versions) | ||
} | ||
|
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.
Think you forgot to refactor this by calling the subworkflow
lofreq_bam // channel: [ val(meta), [ bam ], [ bai ] ] | ||
bam // channel: [ val(meta), [ bam ] ] // for ivar | ||
fasta // channel: /path/to/genome.fasta | ||
fai // channel: /path/to/genome.fai | ||
sizes // channel: /path/to/genome.sizes | ||
gff // channel: /path/to/genome.gff | ||
bed // channel: /path/to/primers.bed | ||
snpeff_db // channel: /path/to/snpeff_db/ | ||
snpeff_config // channel: /path/to/snpeff.config | ||
ivar_multiqc_header // channel: /path/to/multiqc_header for ivar variants | ||
|
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.
Only call what you need.
nf-core/viralrecon pull request