Skip to content

yagdias/wib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wib: Mosquito Food Source Detection Pipeline

A Nextflow pipeline for detecting mosquito food sources from metagenomic sequencing data.

Overview

This pipeline processes paired-end FASTQ files to identify taxonomic sources of sequences. It supports two modes:

  1. Assembly Mode: Assembles reads into contigs using MEGAHIT.
  2. Merge Mode: Merges paired-end reads using VSEARCH/Seqtk.

The processed sequences are then aligned against a nucleotide database using blastn and taxonomically classified.

Prerequisites

Input Files

1. Samples CSV

A CSV file containing the sample information with the following headers: sample,r1,r2

Example:

sample,r1,r2
sample1,/path/to/sample1_R1.fastq.gz,/path/to/sample1_R2.fastq.gz
sample2,/path/to/sample2_R1.fastq.gz,/path/to/sample2_R2.fastq.gz

2. Taxonomy Mapping File

A file mapping accession numbers to TaxIDs (e.g., nucl_gb.accession2taxid.txt).

Warning

The full nucl_gb.accession2taxid file can be very large (>2GB). Ensure you have sufficient disk space.

You can download the latest version from NCBI: https://ftp.ncbi.nlm.nih.gov/pub/taxonomy/accession2taxid/nucl_gb.accession2taxid.gz

Note: The repository includes a nucl_gb.accession2taxid_TEST.txt for testing purposes only.

3. BLAST database

It's necessary to download sequences from NCBI for using the workflow.

Test command

For testing the instalation you can run the following command:

nextflow run main.nf

Usage

Run the pipeline with the following command:

nextflow run main.nf \
    --input_csv samples.csv \
    --db /path/to/blast_db \
    --taxon_names /path/to/nucl_gb.accession2taxid.txt \
    --mode 2 \
    --phred_score 30 \
    --min_pident 0 \
    --cut_evalue 0.001

Parameters

Parameter Description Default
--input_csv Path to the samples CSV file. ${projectDir}/assets/input.csv
--db Path to the BLAST nucleotide database (fasta). ${projectDir}/assets/db/db_TEST.fasta
--taxon_names Path to the accession to TaxID mapping file. ${projectDir}/assets/nucl_gb.accession2taxid_TEST.txt
--mode 1 for Assembly (MEGAHIT), 2 for Merge (VSEARCH). 2
--phred_score Minimum Phred score for quality control. 30
--min_pident Minimum percentage identity for BLAST hits. 0
--cut_evalue E-value cutoff for BLAST hits. 0.001
--taxonomy_db_path Path to directory where taxonomy SQLite DB will be stored ${projectDir}/assets/taxonomy_db/

Output

The pipeline generates results in the results/ directory:

  • results/fastp/{sample}/: Quality control reports (HTML/JSON) and filtered reads.
  • results/blast/{sample}/: BLASTn alignment results.
  • results/tax/{sample}/: Taxonomic classification CSV files.
  • results/assembly_classification_counts.txt: A file containing assembly and classification counts, located in the results directory.

Analysis Report

An RMarkdown script is provided in reports/taxonomic_analysis_report.Rmd to generate a summary HTML report of the findings.

Prerequisites for Report

  • R with libraries: readr, dplyr, purrr, ggplot2, stringr, tidyr, knitr, DT.
  • Note: The report requires the assembly_classification_counts.txt file which is automatically generated by the pipeline in the results/ folder.

Generating the Report

You can render the report using RStudio or R command line:

Rscript -e 'rmarkdown::render("reports/taxonomic_analysis_report.Rmd", knit_root_dir = getwd(), params = list(tax_dir = "results/tax", list_unif_file = "results/assembly_classification_counts.txt", output_dir = "results/plots"))'

About

Who is bitten?

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors