2D Nanopore Alignment and Variant Calling - NU-CPGME/sl_workshop_2024 GitHub Wiki

July / August, 2024

Developed by:
Egon A. Ozer, MD PhD ([email protected])
Ramon Lorenzo Redondo, PhD ([email protected])


Long-Read Viral alignment, variant calling, consensus generation, and typing

Using long-read nanopore sequenncing we will assemble a SARS-CoV-2 sample, generate a variant report, and a consensus. We will then check our consensus and the one generated with Illumina to asign the clade and lineage of the virus.

Command line minimap2, samtools, and iVar analysis.

We will practice a command line assembly and analysis. We will use minimap2 (https://github.com/lh3/minimap2) that is one of the best options for long-read assemblies. Minimap2 will generate a sam file that we will process similar to yesterday's with samtools to generate a sorted and indexed bam file.

We activate the environment:

micromamba deactivate

micromamba activate nanopore

And run the pipeline

cd ~/sl_workshop_2024/demo_data/nanopore_reads

minimap2 \
  -ax map-ont \
  ~/sl_workshop_2024/demo_data/reference/nCoV-2019.reference.fasta \
  COV07735.nanopore.fastq.gz > COV07735.nanopore.sam

samtools view -bS -F 4 COV07735.nanopore.sam > COV07735.nanopore.bam

samtools sort -o COV07735.nanopore_sorted.bam COV07735.nanopore.bam

samtools index COV07735.nanopore_sorted.bam

Trimming and variant calling (check q value!) with iVar

Activate the alignment environment

micromamba deactivate

micromamba activate alignment

Trim primers

ivar trim \
	-q 0 \
	-i COV07735.nanopore_sorted.bam \
	-b ~/sl_workshop_2024/demo_data/reference/nCoV-2019.ivar.bed \
	-p COV07735.trimmed
samtools sort -o COV07735.trimmed_sorted.bam COV07735.trimmed.bam

samtools index COV07735.trimmed_sorted.bam

Generate pileup file

samtools mpileup \
	-aa \
	-A \
	-d 0 \
	-Q 0 \
	--reference ~/sl_workshop_2024/Downloads/demo_data/reference/nCoV-2019.reference.fasta \
	COV07735.trimmed_sorted.bam \
	> COV07735.pileup.txt

Call variants based on pileup output

ivar variants \
	-p COV07735.variants \
	-t 0.03 \
	< COV07735.pileup.txt

Generate a consenus sequence

ivar consensus \
	-m 10 \
	-q 0 \
	-t 0 \
	-p COV07735.consensus \
	< COV07735.pileup.txt

Clade assignment with Nextclade

We will now use Nextclade to assign the clade and the quality of our consensus.

  1. Go to https://clades.nextstrain.org/

  2. Select the SARS-CoV-2 reference

  3. Load our COV07735.consensus.fa and analyze

Exercise:

Let's discuss the results check the tree and repeat with our the SAR_CoV_2 consensus sequence from Illumina reads we generated earlier.

Explore Nextstrain

We will check Nextrain web to see the possible analyses we can perform that will be covered tomorrow in Phylogenetics



Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

⚠️ **GitHub.com Fallback** ⚠️