Commit 5702351d authored by MARTIN Pierre's avatar MARTIN Pierre
Browse files

merge

parents d1b70ff9 9413b928
process INDIVIDUAL_CD_HIT {
tag "${replicateId}"
tag "${sampleId}"
publishDir "${params.outdir}/06_func_annot/06_1_clustering", mode: 'copy'
label 'CD_HIT'
input:
tuple val(replicateId), file(assembly_ffn_file)
tuple val(sampleId), file(assembly_ffn_file)
val percentage_identity_cdhit
output:
path("${replicateId}.cd-hit-est.${percentage_identity_cdhit}.fasta"), emit: clstr_fasta
path("${replicateId}.cd-hit-est.${percentage_identity_cdhit}.table_cluster_contigs.txt"), emit: individual_clstr_table
path("${replicateId}.cd-hit-est.${percentage_identity_cdhit}.fasta.clstr")
path("${sampleId}.cd-hit-est.${percentage_identity_cdhit}.fasta"), emit: clstr_fasta
path("${sampleId}.cd-hit-est.${percentage_identity_cdhit}.table_cluster_contigs.txt"), emit: individual_clstr_table
path("${sampleId}.cd-hit-est.${percentage_identity_cdhit}.fasta.clstr")
// when: ('06_func_annot' in step)
script:
"""
cd-hit-est -c ${percentage_identity_cdhit} -i ${assembly_ffn_file} -o ${replicateId}.cd-hit-est.${percentage_identity_cdhit}.fasta -T ${task.cpus} -M ${task.mem} -d 150
cat ${replicateId}.cd-hit-est.${percentage_identity_cdhit}.fasta.clstr | cd_hit_produce_table_clstr.py > ${replicateId}.cd-hit-est.${percentage_identity_cdhit}.table_cluster_contigs.txt
cd-hit-est -c ${percentage_identity_cdhit} -i ${assembly_ffn_file} -o ${sampleId}.cd-hit-est.${percentage_identity_cdhit}.fasta -T ${task.cpus} -M ${task.mem} -d 150
cat ${sampleId}.cd-hit-est.${percentage_identity_cdhit}.fasta.clstr | cd_hit_produce_table_clstr.py > ${sampleId}.cd-hit-est.${percentage_identity_cdhit}.table_cluster_contigs.txt
"""
}
......
// Quantification of reads on each gene in each sample.
process quantification {
tag "${replicateId}"
process QUANTIFICATION {
tag "${sampleId}"
publishDir "${params.outdir}/06_func_annot/06_2_quantification", mode: 'copy'
input:
tuple val(replicateId), file(gff_prokka), file(bam), file(bam_index)
tuple val(sampleId), file(gff_prokka), file(bam), file(bam_index)
output:
path "${replicateId}.featureCounts.tsv", emit: count_table
path "${replicateId}.featureCounts.tsv.summary", emit: summary
path "${replicateId}.featureCounts.stdout"
// when: ('06_func_annot' in step)
path "${sampleId}.featureCounts.tsv", emit: count_table
path "${sampleId}.featureCounts.tsv.summary", emit: summary
path "${sampleId}.featureCounts.stdout"
script:
"""
featureCounts -T ${task.cpus} -p -O -t gene -g ID -a ${gff_prokka} -o ${replicateId}.featureCounts.tsv ${bam} &> ${replicateId}.featureCounts.stdout
featureCounts -T ${task.cpus} -p -O -t gene -g ID -a ${gff_prokka} -o ${sampleId}.featureCounts.tsv ${bam} &> ${sampleId}.featureCounts.stdout
"""
}
......@@ -43,8 +41,6 @@ process quantification {
"""
}
workflow FEATURE_COUNTS {
take:
......
......@@ -18,7 +18,8 @@ params {
metaspades_mem = 440
min_contigs_cpm = 1000
diamond_bank = ""
percentage_identity = 0.95
// Skip step or sub-step.
skip_clean = false
skip_sickle = false
......
include { CD_HIT } from '../modules/cd_hit'
//include {FEATURE_COUNTS} from './modules/feature_counts'
// cd_hit + quantification + quantification_table + eggnog_mapper_db + eggnog_mapper
// + best_hit_diamond + mergeçquandtif and functionnal annot + make_functionnal_annotation_tables
workflow STEP_06_FUNC_ANNOT {
take:
assembly_ch // channel: [ val(sampleid), path(assemblyfasta) ]
main:
CD_HIT(assembly_ch, params.percentage_identity)
}
......@@ -2,7 +2,7 @@
include { FILTERED_QUAST } from '../modules/metaquast'
include { STEP_04_STRUCTURAL_ANNOT } from './04_structural_annot'
include { STEP_05_ALIGNMENT } from './05_alignment'
include { STEP_06_FUNC_ANNOT } from './06_functionnal_annot'
workflow SHARED {
take:
......@@ -10,25 +10,24 @@ workflow SHARED {
ch_assembly
main:
FILTERED_QUAST (
ch_assembly
)
ch_prokka_and_reads = Channel.empty()
ch_faa = Channel.empty()
if ( ! params.skip_structural_annot ) {
STEP_04_STRUCTURAL_ANNOT ( ch_assembly )
ch_gff = STEP_04_STRUCTURAL_ANNOT.out.gff
ch_fna = STEP_04_STRUCTURAL_ANNOT.out.fna
ch_faa = STEP_04_STRUCTURAL_ANNOT.out.faa
ch_prokka_and_reads = ch_gff.join(ch_fna, remainder: true).join(ch_reads, remainder: true)
}
if ( ! params.skip_alignment) {
STEP_05_ALIGNMENT( ch_prokka_and_reads, ch_faa )
}
FILTERED_QUAST (
ch_assembly
)
ch_prokka_reads = Channel.empty()
ch_prokka_faa = Channel.empty()
if ( ! params.skip_structural_annot ) {
PROKKA_AND_RENAME (ch_assembly)
ch_prokka_reads = PROKKA_AND_RENAME.out.gff.join(PROKKA_AND_RENAME.out.fna, remainder: true).join(ch_reads, remainder: true)
ch_prokka_faa = PROKKA_AND_RENAME.out.faa
}
if ( ! params.skip_alignment) {
STEP_05_ALIGNMENT(ch_prokka_reads, ch_prokka_faa)
}
if ( ! params.skip_func_annot) {
STEP_06_FUNC_ANNOT(PROKKA_AND_RENAME.out.fna)
}
emit:
report_prokka = STEP_04_STRUCTURAL_ANNOT.out.report
report_quast = FILTERED_QUAST.out.report
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment