From 69453c3ee920d700bd091caa73b2ba70ce1071b2 Mon Sep 17 00:00:00 2001
From: Maina Vienne <maina.vienne@inrae.fr>
Date: Fri, 21 Jan 2022 18:18:59 +0100
Subject: [PATCH 1/7] Update host_filter.nf

---
 modules/host_filter.nf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/host_filter.nf b/modules/host_filter.nf
index e5f9328..c2b0ba0 100644
--- a/modules/host_filter.nf
+++ b/modules/host_filter.nf
@@ -25,7 +25,7 @@ process HOST_FILTER {
     mkdir host_filter_flagstat
     samtools flagstat ${sampleId}.bam > ${sampleId}.no_filter.flagstat
     samtools flagstat ${sampleId}.without_host.bam >> host_filter_flagstat/${sampleId}.host_filter.flagstat
-    bamToFastq -i ${sampleId}.without_host.bam -fq cleaned_${sampleId}_R1.fastq -fq2 cleaned_${sampleId}_R2.fastq
+    bamToFastq -i ${sampleId}.without_host.bam -fq cleaned_${sampleId}_R1.fastq -fq2 cleaned_${sampleId}_R2.fastq 
     gzip cleaned_${sampleId}_R1.fastq
     gzip cleaned_${sampleId}_R2.fastq
     rm ${sampleId}.bam
-- 
GitLab


From 97c1ff29d68677ac9acb99dc3033a47f005ad64f Mon Sep 17 00:00:00 2001
From: Maina Vienne <maina.vienne@inrae.fr>
Date: Mon, 24 Jan 2022 10:20:20 +0100
Subject: [PATCH 2/7] Update host_filter.nf (replace bamtofastq by samtools
 fastq )

---
 modules/host_filter.nf | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/host_filter.nf b/modules/host_filter.nf
index c2b0ba0..b412799 100644
--- a/modules/host_filter.nf
+++ b/modules/host_filter.nf
@@ -25,10 +25,10 @@ process HOST_FILTER {
     mkdir host_filter_flagstat
     samtools flagstat ${sampleId}.bam > ${sampleId}.no_filter.flagstat
     samtools flagstat ${sampleId}.without_host.bam >> host_filter_flagstat/${sampleId}.host_filter.flagstat
-    bamToFastq -i ${sampleId}.without_host.bam -fq cleaned_${sampleId}_R1.fastq -fq2 cleaned_${sampleId}_R2.fastq 
-    gzip cleaned_${sampleId}_R1.fastq
-    gzip cleaned_${sampleId}_R2.fastq
+    samtools sort -n -o ${sampleId}.without_host_sort.bam ${sampleId}.without_host.bam     
+    samtools fastq -N -1 cleaned_${sampleId}_R1.fastq.gz -2 cleaned_${sampleId}_R2.fastq.gz ${sampleId}.without_host.bam
     rm ${sampleId}.bam
     rm ${sampleId}.without_host.bam
+    rm ${sampleId}.without_host_sort.bam
     """
 }
\ No newline at end of file
-- 
GitLab


From a72fc84ca8269084065f877669446a83fc3d5acb Mon Sep 17 00:00:00 2001
From: VIENNE MAINA <maina.vienne@inrae.fr>
Date: Mon, 24 Jan 2022 10:26:22 +0100
Subject: [PATCH 3/7] Update host_filter.nf

---
 modules/host_filter.nf | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/host_filter.nf b/modules/host_filter.nf
index b412799..3d87b17 100644
--- a/modules/host_filter.nf
+++ b/modules/host_filter.nf
@@ -26,9 +26,9 @@ process HOST_FILTER {
     samtools flagstat ${sampleId}.bam > ${sampleId}.no_filter.flagstat
     samtools flagstat ${sampleId}.without_host.bam >> host_filter_flagstat/${sampleId}.host_filter.flagstat
     samtools sort -n -o ${sampleId}.without_host_sort.bam ${sampleId}.without_host.bam     
-    samtools fastq -N -1 cleaned_${sampleId}_R1.fastq.gz -2 cleaned_${sampleId}_R2.fastq.gz ${sampleId}.without_host.bam
+    samtools fastq -N -1 cleaned_${sampleId}_R1.fastq.gz -2 cleaned_${sampleId}_R2.fastq.gz ${sampleId}.without_host_sort.bam
     rm ${sampleId}.bam
     rm ${sampleId}.without_host.bam
     rm ${sampleId}.without_host_sort.bam
     """
-}
\ No newline at end of file
+}
-- 
GitLab


From a189d131a8c34696731f6ca71489a13b5d6d9a44 Mon Sep 17 00:00:00 2001
From: Jean Mainguy <jean.mainguy@inra.fr>
Date: Tue, 25 Jan 2022 18:04:51 +0100
Subject: [PATCH 4/7] add flagstat report of HiFi reads in multiqc report

---
 assets/hifi_multiqc_config.yaml |  3 +++
 main.nf                         | 47 ++++++++++++++++++---------------
 modules/multiqc.nf              |  6 ++---
 modules/read_alignment.nf       |  1 +
 subworkflows/hifi_reads.nf      |  5 +++-
 5 files changed, 36 insertions(+), 26 deletions(-)

diff --git a/assets/hifi_multiqc_config.yaml b/assets/hifi_multiqc_config.yaml
index ce6c011..3ca370b 100644
--- a/assets/hifi_multiqc_config.yaml
+++ b/assets/hifi_multiqc_config.yaml
@@ -11,6 +11,9 @@ extra_fn_clean_trim:
   - '.contigs'
   - '.sort'
 
+extra_fn_clean_exts:
+  - "_select_contigs_cpm"
+
 module_order:
     - fastqc:
         name: 'FastQC'
diff --git a/main.nf b/main.nf
index 67a944c..fa7ddfb 100644
--- a/main.nf
+++ b/main.nf
@@ -212,20 +212,24 @@ workflow {
   // SR only report
   ch_cutadapt_report = Channel.empty()
   ch_sickle_report = Channel.empty()
-  ch_before_filter_report = Channel.empty()
-  ch_after_filter_report = Channel.empty()
-  ch_fastqc_raw_report = Channel.empty()
+  ch_before_host_filter_report = Channel.empty()
+  ch_after_host_filter_report = Channel.empty()
+  
   ch_fastqc_clean_report = Channel.empty()
   ch_kaiju_report = Channel.empty()
-  ch_dedup_report = Channel.empty()
-  ch_assembly_report = Channel.empty()
-  ch_filtered_report = Channel.empty()
+  
 
   // HIFI only report
-  ch_hifi_fastqc_report = Channel.empty()
   ch_hifi_quast_report = Channel.empty()
 
   // Shared report
+  ch_fastqc_raw_report = Channel.empty()
+  ch_flagstat_report = Channel.empty()
+  
+  ch_quast_before_filter_report = Channel.empty()
+  ch_quast_after_filter_report = Channel.empty()
+
+  
   ch_prokka_report = Channel.empty()
   ch_quant_report = Channel.empty()
   ch_v_eggnogmapper = Channel.empty()
@@ -253,14 +257,14 @@ workflow {
 
     ch_cutadapt_report = SR.out.cutadapt_report
     ch_sickle_report = SR.out.sickle_report
-    ch_before_filter_report = SR.out.before_filter_report
-    ch_after_filter_report = SR.out.after_filter_report
+    ch_before_host_filter_report = SR.out.before_filter_report
+    ch_after_host_filter_report = SR.out.after_filter_report
     ch_fastqc_raw_report = SR.out.fastqc_raw_report
     ch_fastqc_clean_report = SR.out.fastqc_clean_report
     ch_kaiju_report = SR.out.kaiju_report
-    ch_dedup_report = SR.out.dedup_report
-    ch_assembly_report = SR.out.assembly_report
-    ch_filtered_report = SR.out.filtered_report
+    ch_flagstat_report = SR.out.dedup_report
+    ch_quast_before_filter_report = SR.out.assembly_report
+    ch_quast_after_filter_report = SR.out.filtered_report
   }
 
   else if ( params.type.toUpperCase() == "HIFI" ) {
@@ -278,9 +282,10 @@ workflow {
       ch_multiqc_config
       )
     
-    ch_hifi_fastqc_report = HIFI_READS.out.fastqc_report
-    ch_hifi_quast_report = HIFI_READS.out.quast_report
-    ch_filtered_report = HIFI_READS.out.quast_report_filtered
+    ch_fastqc_raw_report = HIFI_READS.out.fastqc_report
+    ch_flagstat_report = HIFI_READS.out.flagstat_report
+    ch_quast_before_filter_report = HIFI_READS.out.quast_report
+    ch_quast_after_filter_report = HIFI_READS.out.quast_report_filtered
     
     ch_assembly =  HIFI_READS.out.assembly
 	}
@@ -308,16 +313,14 @@ workflow {
     ch_software_versions,
     ch_cutadapt_report.collect().ifEmpty([]),
     ch_sickle_report.collect().ifEmpty([]),
-    ch_before_filter_report.collect().ifEmpty([]),
-    ch_after_filter_report.collect().ifEmpty([]),
+    ch_before_host_filter_report.collect().ifEmpty([]),
+    ch_after_host_filter_report.collect().ifEmpty([]),
     ch_fastqc_raw_report.collect().ifEmpty([]),
     ch_fastqc_clean_report.collect().ifEmpty([]),
     ch_kaiju_report.collect().ifEmpty([]),
-    ch_dedup_report.collect().ifEmpty([]),
-    ch_assembly_report.collect().ifEmpty([]),
-    ch_filtered_report.collect().ifEmpty([]),
-    ch_hifi_fastqc_report.collect().ifEmpty([]),
-    ch_hifi_quast_report.collect().ifEmpty([]),
+    ch_flagstat_report.collect().ifEmpty([]),
+    ch_quast_before_filter_report.collect().ifEmpty([]),
+    ch_quast_after_filter_report.collect().ifEmpty([]),
     ch_prokka_report.collect().ifEmpty([]),
     ch_quant_report.collect().ifEmpty([])
   )
diff --git a/modules/multiqc.nf b/modules/multiqc.nf
index d7334da..01aadbc 100644
--- a/modules/multiqc.nf
+++ b/modules/multiqc.nf
@@ -14,8 +14,6 @@ process MULTIQC {
     path dedup_report
     path 'quast_primary/*/report.tsv'
     path 'quast_filtered/*/report.tsv'
-    path hifi_fastqc_report
-    path 'quast_hifi/*/report.tsv'
     path prokka_report
     path quant_report
 
@@ -27,4 +25,6 @@ process MULTIQC {
     """
     multiqc . --config ${multiqc_config} -m custom_content -m fastqc -m cutadapt -m sickle -m kaiju -m quast -m prokka -m featureCounts -m samtools
     """
-}
\ No newline at end of file
+}
+
+
diff --git a/modules/read_alignment.nf b/modules/read_alignment.nf
index 7b86f79..94e6816 100644
--- a/modules/read_alignment.nf
+++ b/modules/read_alignment.nf
@@ -61,6 +61,7 @@ process MINIMAP2_FILTERING {
 
    output:
       tuple val(sampleId), path("${sampleId}.idxstats"), emit: sam_idxstat
+      path "${sampleId}.flagstat", emit: sam_flagstat
       path "${sampleId}*"
 
    script:
diff --git a/subworkflows/hifi_reads.nf b/subworkflows/hifi_reads.nf
index 373321e..6222c2d 100644
--- a/subworkflows/hifi_reads.nf
+++ b/subworkflows/hifi_reads.nf
@@ -32,6 +32,7 @@ workflow HIFI_READS {
             MINIMAP2_FILTERING(ch_contigs_and_reads)
             
             ch_idxstats  = MINIMAP2_FILTERING.out.sam_idxstat
+            ch_flagstat =  MINIMAP2_FILTERING.out.sam_flagstat
 
             ch_min_contigs_cpm = Channel.value(params.min_contigs_cpm)
 
@@ -53,15 +54,17 @@ workflow HIFI_READS {
             S04_FILTERED_QUAST( ch_assembly )
             
             ch_filtered_report = S04_FILTERED_QUAST.out.report
+            
 
       }
       
         
       emit:
         fastqc_report = ch_fastqc_zip
+        flagstat_report = ch_flagstat
         quast_report = ch_quast_report
         quast_report_filtered =  ch_filtered_report
         assembly = ch_assembly 
         
       }
-      
\ No newline at end of file
+      
-- 
GitLab


From 7077b531f3416833a41a695680ab05f49240794d Mon Sep 17 00:00:00 2001
From: Maina Vienne <maina.vienne@inrae.fr>
Date: Wed, 26 Jan 2022 12:37:41 +0100
Subject: [PATCH 5/7] update functional test : expected processes Hifi

---
 functional_tests/expected_processes_HiFi.tsv | 12 ++++++------
 functional_tests/functions.py                |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/functional_tests/expected_processes_HiFi.tsv b/functional_tests/expected_processes_HiFi.tsv
index a4c48ab..d96ce65 100644
--- a/functional_tests/expected_processes_HiFi.tsv
+++ b/functional_tests/expected_processes_HiFi.tsv
@@ -1,6 +1,6 @@
-cmd	outputdir	DATABASES:INDEX_KAIJU	DATABASES:DOWNLOAD_TAXONOMY_DB	DATABASES:EGGNOG_MAPPER_DB	HIFI_READS:S04_FILTERED_QUAST	SH:S04_STRUCTURAL_ANNOT:PROKKA	SH:S04_STRUCTURAL_ANNOT:RENAME_CONTIGS_AND_GENES	SH:S05_ALIGNMENT:DIAMOND	SH:S05_ALIGNMENT:MINIMAP2	SH:S06_FUNC_ANNOT:BEST_HITS	SH:S06_FUNC_ANNOT:CD_HIT:GLOBAL_CD_HIT	SH:S06_FUNC_ANNOT:CD_HIT:INDIVIDUAL_CD_HIT	SH:S06_FUNC_ANNOT:EGGNOG_MAPPER	SH:S06_FUNC_ANNOT:FUNCTIONAL_ANNOT_TABLE	SH:S06_FUNC_ANNOT:MERGE_QUANT_ANNOT_BEST	SH:S06_FUNC_ANNOT:QUANTIFICATION:FEATURE_COUNTS	SH:S06_FUNC_ANNOT:QUANTIFICATION:QUANTIFICATION_TABLE	SH:S07_TAXO_AFFI:ASSIGN_TAXONOMY	SH:S07_TAXO_AFFI:QUANTIF_AND_TAXONOMIC_TABLE_CONTIGS	GET_SOFTWARE_VERSIONS	MULTIQC
-mkdir $OUTDIR/hifi_all ; cd $OUTDIR/hifi_all ;nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd --eggnog_mapper_db_dir `echo $EGGNOG_DB` --accession2taxid `echo $DATABANK`/taxonomy_2021-12-7/prot.accession2taxid.FULL --taxdump `echo $DATABANK`/taxonomy_2021-12-7/new_taxdump	$OUTDIR/hifi_all	0	0	0	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1
-mkdir $OUTDIR/hifi_stop_at_structural_annot;cd $OUTDIR/hifi_stop_at_structural_annot; nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd --stop_at_structural_annot	$OUTDIR/hifi_stop_at_structural_annot	0	0	0	1	1	1	0	0	0	0	0	0	0	0	0	0	0	0	1	1
-mkdir $OUTDIR/skip_func_annot-skip_taxo_affi; cd $OUTDIR/skip_func_annot-skip_taxo_affi;cp ../nextflow.config .;  nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd --skip_func_annot --skip_taxo_affi	$OUTDIR/skip_func_annot-skip_taxo_affi	0	0	0	1	1	1	1	1	0	0	0	0	0	0	0	0	0	0	1	1
-mkdir $OUTDIR/skip_func_annot ; cd $OUTDIR/skip_func_annot;cp ../nextflow.config .;  nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --eggnog_mapper_db_dir `echo $EGGNOG_DB`  --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd  --accession2taxid `echo $DATABANK`/taxonomy_2021-12-7/prot.accession2taxid.FULL --taxdump `echo $DATABANK`/taxonomy_2021-12-7/new_taxdump --skip_func_annot	$OUTDIR/skip_func_annot	0	0	0	1	1	1	1	1	0	0	0	0	0	0	0	0	1	1	1	1
-mkdir $OUTDIR/skip_taxo_affi; cd $OUTDIR/skip_taxo_affi;nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd --eggnog_mapper_db_dir `echo $EGGNOG_DB` --skip_taxo_affi	$OUTDIR/skip_taxo_affi	0	0	0	1	1	1	1	1	1	1	1	1	1	1	1	1	0	0	1	1
+cmd	outputdir	DATABASES:INDEX_KAIJU	DATABASES:DOWNLOAD_TAXONOMY_DB	DATABASES:EGGNOG_MAPPER_DB	HIFI_READS:ASSEMBLY_QUAST	HIFI_READS:FASTQC_HIFI	HIFI_READS:MINIMAP2_FILTERING	HIFI_READS:S03_FILTERING:CHUNK_ASSEMBLY_FILTER	HIFI_READS:S03_FILTERING:MERGE_ASSEMBLY_FILTER	HIFI_READS:S04_FILTERED_QUAST	SH:S04_STRUCTURAL_ANNOT:PROKKA	SH:S04_STRUCTURAL_ANNOT:RENAME_CONTIGS_AND_GENES	SH:S05_ALIGNMENT:DIAMOND	SH:S05_ALIGNMENT:MINIMAP2	SH:S06_FUNC_ANNOT:BEST_HITS	SH:S06_FUNC_ANNOT:CD_HIT:GLOBAL_CD_HIT	SH:S06_FUNC_ANNOT:CD_HIT:INDIVIDUAL_CD_HIT	SH:S06_FUNC_ANNOT:EGGNOG_MAPPER	SH:S06_FUNC_ANNOT:FUNCTIONAL_ANNOT_TABLE	SH:S06_FUNC_ANNOT:MERGE_QUANT_ANNOT_BEST	SH:S06_FUNC_ANNOT:QUANTIFICATION:FEATURE_COUNTS	SH:S06_FUNC_ANNOT:QUANTIFICATION:QUANTIFICATION_TABLE	SH:S07_TAXO_AFFI:ASSIGN_TAXONOMY	SH:S07_TAXO_AFFI:QUANTIF_AND_TAXONOMIC_TABLE_CONTIGS	GET_SOFTWARE_VERSIONS	MULTIQC
+mkdir $OUTDIR/hifi_all ; cd $OUTDIR/hifi_all ;nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd --eggnog_mapper_db_dir `echo $EGGNOG_DB` --accession2taxid `echo $DATABANK`/taxonomy_2021-12-7/prot.accession2taxid.FULL --taxdump `echo $DATABANK`/taxonomy_2021-12-7/new_taxdump	$OUTDIR/hifi_all	0	0	0	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1
+mkdir $OUTDIR/hifi_stop_at_structural_annot;cd $OUTDIR/hifi_stop_at_structural_annot; nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd --stop_at_structural_annot	$OUTDIR/hifi_stop_at_structural_annot	0	0	0	1	1	1	1	1	1	1	1	0	0	0	0	0	0	0	0	0	0	0	0	1	1
+mkdir $OUTDIR/skip_func_annot-skip_taxo_affi; cd $OUTDIR/skip_func_annot-skip_taxo_affi;cp ../nextflow.config .;  nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd --skip_func_annot --skip_taxo_affi	$OUTDIR/skip_func_annot-skip_taxo_affi	0	0	0	1	1	1	1	1	1	1	1	1	1	0	0	0	0	0	0	0	0	0	0	1	1
+mkdir $OUTDIR/skip_func_annot ; cd $OUTDIR/skip_func_annot;cp ../nextflow.config .;  nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --eggnog_mapper_db_dir `echo $EGGNOG_DB`  --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd  --accession2taxid `echo $DATABANK`/taxonomy_2021-12-7/prot.accession2taxid.FULL --taxdump `echo $DATABANK`/taxonomy_2021-12-7/new_taxdump --skip_func_annot	$OUTDIR/skip_func_annot	0	0	0	1	1	1	1	1	1	1	1	1	1	0	0	0	0	0	0	0	0	1	1	1	1
+mkdir $OUTDIR/skip_taxo_affi; cd $OUTDIR/skip_taxo_affi;nextflow run -profile test,genotoul $METAG_PATH/main.nf --type HIFI --input `echo $DATASET`/hifi/input/samplesheet.csv --diamond_bank `echo $DATABANK`/refseq_bacteria_2021-05-20/refseq_bacteria_100000.dmnd --eggnog_mapper_db_dir `echo $EGGNOG_DB` --skip_taxo_affi	$OUTDIR/skip_taxo_affi	0	0	0	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	0	0	1	1
diff --git a/functional_tests/functions.py b/functional_tests/functions.py
index ba287dc..7c3ec66 100644
--- a/functional_tests/functions.py
+++ b/functional_tests/functions.py
@@ -82,7 +82,7 @@ def files_load(exp_dir, step):
 
     files_list = []
     files_dir = path.join(path.abspath(exp_dir), step)
-    for file in Path(files_dir).rglob('*.*'):
+    for file in Path(files_dir).rglob('*.[a-z]*'):
         files_list.append(path.relpath(file, start = files_dir))
 
     return sorted(files_list)
-- 
GitLab


From 5b588d44465b95b01a3d2c0ae88219cac06d4596 Mon Sep 17 00:00:00 2001
From: Maina Vienne <maina.vienne@inrae.fr>
Date: Wed, 26 Jan 2022 13:53:14 +0100
Subject: [PATCH 6/7] update doc and help: add  '--type' description

---
 docs/usage.md | 4 +++-
 main.nf       | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/docs/usage.md b/docs/usage.md
index cdccc87..5a400e1 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -144,10 +144,12 @@ The next parameters can be used when you run metagWGS.
 
 **NOTE:** the specific parameters of the pipeline are indicated by `--` in the command line.
 
-### 1. Mandatory parameter: `--input`
+### 1. Mandatory parameters:
 
 `--input "<PATH>/samplesheet.csv"`: indicate location of the samplesheet containing paths to the input reads `.fastq/.fastq.gz` and/or assembly `.fa/.fasta` files. For example, `--input "<PATH>/samplesheet.csv"` runs the pipeline with all the `R1.fastq.gz` and `R2.fastq.gz` files available in the indicated `<PATH>`. For a cleaner MultiQC html report at the end of the pipeline, raw data with extensions `_R1` and `_R2` are preferred to those with extensions `_1` and `_2`.
 
+`--type "SR" or "HIFI"` : indicate the type of the sequencing data, for short-read Illumina data use `"SR"`, for long-read data PacBio HiFi use `"HIFI"`.
+
 ### 2. `--stop_at_[STEP]` and `--skip_[STEP]` parameters:
 
 By default, all steps of metagWGS will be launched on the input data. From S01_CLEAN_QC to S07_TAXO_AFFI.
diff --git a/main.nf b/main.nf
index fa7ddfb..e4fab3b 100644
--- a/main.nf
+++ b/main.nf
@@ -32,6 +32,7 @@ include { MULTIQC } from './modules/multiqc'
 
      Mandatory arguments:
        --input [path]                Sample sheet: csv file with samples: sample,fastq_1,fastq_2,fasta[for HIFI]
+       --type                        Indicate the type of the sequencing data, "SR" : short-read Illumina data use, "HIFI" : long-read PacBio HiFi data 
 
      Options:
      
-- 
GitLab


From ec2eefa6953fba873cee5289260a9486b24cdc4c Mon Sep 17 00:00:00 2001
From: Jean Mainguy <jean.mainguy@inra.fr>
Date: Tue, 1 Feb 2022 12:28:57 +0100
Subject: [PATCH 7/7] fix plot issue: plot are only generated at the end.

---
 bin/aln2taxaffi.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/bin/aln2taxaffi.py b/bin/aln2taxaffi.py
index 1478fee..085c4fc 100755
--- a/bin/aln2taxaffi.py
+++ b/bin/aln2taxaffi.py
@@ -524,11 +524,11 @@ def main():
             out_contig.write(contig_affi_line)
             logging.debug(contig_affi_line)
 
-            with open(query_length_file) as fl:
-                nb_total_prot = len([line for line in fl])
-            nb_prot_annotated = len(matches)
-            plot_taxonomic_assignment(
-                output_name, count_rank_affiliation_protein,  count_rank_affiliation_contig, nb_total_prot, nb_prot_annotated, nb_prot_assigned)
+    with open(query_length_file) as fl:
+        nb_total_prot = len([line for line in fl])
+    nb_prot_annotated = len(matches)
+    plot_taxonomic_assignment(
+          output_name, count_rank_affiliation_protein,  count_rank_affiliation_contig, nb_total_prot, nb_prot_annotated, nb_prot_assigned)
 
 
 if __name__ == '__main__':
-- 
GitLab