Metagenomics

Overview & Terminology

Microbiota organism within a set environment mainly focused on bacteria * exluding viruses & mobile elements

Microbiome includes all factors of an environment (organism, genetic elements, metabolites, proteins)

Holobiont assemblages of different species that form a ecological unit divided into: virome, microbiome and macrobiological hosts

Whole Metagenome Sequencing - practical

Software used: - FastQC - Kraken - R - Pavian

Data used:

curl -O -J -L https://osf.io/h9x6e/download
tar xvf subset_wms.tar.gz

1. Taxonomic read assignment with Kraken

#create a databases directory and download the database
wget https://ccb.jhu.edu/software/kraken/dl/minikraken_20171019_4GB.tgz
tar xzf minikraken_20171019_4GB.tgz
# for the script you need to declare the KRAKEN_DB path
KRAKEN_DB="/mnt/databases/minikraken_20171013_4GB"
for i in *_1.fastq
do
    prefix=$(basename $i _1.fastq)
    # print which sample is being processed
    echo $prefix
    kraken --db $KRAKEN_DB --threads 2 --fastq-input ${prefix}_1_corr.fastq ${prefix}_2_corr.fastq > /home/student/wms/results/${prefix}.tab
    kraken-report --db $KRAKEN_DB /home/student/wms/results/${prefix}.tab > /home/student/wms/results/${prefix}_tax.txt
done

2. Visualization with Pavian in R

#one time only installations and setup
options(repos = c(CRAN = "http://cran.rstudio.com"))
if (!require(remotes)) { install.packages("remotes") }
remotes::install_github("fbreitwieser/pavian")
#Start up command
pavian::runApp(port=5000)

Example results in one sample as a sankey chart using pavian

Metagenome assembly and binning - practical

AIM: inspect and assemble metagenomic data and retrieve draft genomes

1. Correction and assembly of the illumina reads

sickle pe -f tara_reads_R1.fastq.gz -r tara_reads_R2.fastq.gz -t sanger -o tara_trimmed_R1.fastq -p tara_trimmed_R2.fastq -s /dev/null
megahit -1 tara_trimmed_R1.fastq -2 tara_trimmed_R2.fastq -o tara_assembly

2. Binning

ln -s tara_assembly/final.contigs.fa . #link contigs to current folder
bowtie2-build final.contigs.fa final.contigs #index
bowtie2 -x final.contigs -1 tara_trimmed_R1.fastq -2 tara_trimmed_R2.fastq | samtools view -bS -o tara_to_sort.bam #alignment and bam conversion
samtools sort tara_to_sort.bam -o tara.bam
samtools index tara.bam
runMetaBat.sh -m 1500 final.contigs.fa tara.bam
mv final.contigs.fa.metabat-bins1500 metabat

3. QC of the bins

sudo checkm data setRoot ~/.local/data/checkm
checkm lineage_wf -x fa metabat checkm/
checkm bin_qa_plot -x fa checkm metabat plots

4. Get organism information and plot it

#tells you which organism, saves under checkm/lineage needs folder checkm
checkm qa checkm/lineage.ms checkm
#plots its
checkm bin_qa_plot -x fa checkm metabat plots

5. Barrnap