> For the complete documentation index, see [llms.txt](https://shivom.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shivom.gitbook.io/documentation/covid-19/pipeline-2.md).

# SARS-CoV-2: Alignment

The variants study.

### Overview

One of the common analyses done on the newly sequenced genome is to perform an *alignment* with the available reference genome and check the variants in the current sample. This pipeline is intended to call the variants and the annotation associated with.

**Variants** are genetic differences between:

* healthy and diseased tissue,&#x20;
* individuals of a population,
* strains of an organism&#x20;

that can provide mechanistic insight into disease processes and the natural function of affected genes.

The normalization of a variant representation in VCF consists of two parts: *parsimony* and left *alignment* pertaining to the nature of a variant's length and position respectively.

### Workflow

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M5a5Tl5CAjzrrCBXIEX%2F-M5aP4EJ4bwsomwZuJ_W%2Filustration1.png?alt=media\&token=770522e1-8db1-4da0-9bd4-247d70445e2d)

The figure above shows the analysis of variation between the samples. The raw data from sequencing experiments are taken as input and checked for quality: then, the quality checked reads are mapped to hg19 human reference genome. The unaligned are next used for alignment with the coronavirus (NC\_05512) reference genome. The alignments are checked for duplicates and realigned using picard. The variants calling tools (lofreq) are used on these realigned files to get the variants. Finally, the variants are annotated with snpEff.

#### User Journey

As you can see, this pipeline also shares the same structure with the others; what you need to do to use it are a few simple steps:

1. once you have selected your pipeline of interest, upload your fastq files;
2. select the parameters;
3. run the pipeline;

then, you will be redirected to the result page.

As you can see, the pipeline design is divided into two parts: a first one dedicated to the overview of the pipeline itself, where you can name your analysis and view the estimated cost for use, and a second part concerned about data and parameters.

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-MDyS1FWcoGBv9kxmVLG%2F-MDyVVcr3-Kw9MoyMFEp%2Fimage.png?alt=media\&token=b9e6cd95-691a-472e-8d92-63ff5bfa7d0b)

Let's take a look at the **parameters**.

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-MDyS1FWcoGBv9kxmVLG%2F-MDyVfdIH2HtwQlchSoG%2Fimage.png?alt=media\&token=5d4f72ab-658c-4b4c-b641-7807d1ffbd84)

The first thing to do is to load your **Fastq Files**, where the Short Reads are noted; then, upload your metadata file containing:

* sample name;
* run;
* short reads;
* long reads.

As for **quality control**, whether the user wants to do it, just *switch on*.

For **Adapter Trimming**, the program used will be *fastp* too&#x6C;*.*

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-MDyS1FWcoGBv9kxmVLG%2F-MDyVnSvhsdF8F1zwtJx%2Fimage.png?alt=media\&token=f1100557-14fd-4fe6-a1c2-faa88d295505)

The chosen **reference genome** for these analyzes will be *hg19* (Homo sapiens (human) *genome* assembly GRCh37 (*hg19*) from *Genome* Reference Consortium).

The reference genome **index** that will be applied will be *bwa.*

The **Alignment** tool involved in this process will be *bwa\_mem,* the faster and more accurate of the Burrow-Wheeler Alignment tool algorithm&#x73;*.*

The number of **threads** for alignment is set to *16* and it is possible to save your .bam file by switching on.

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-MDyS1FWcoGBv9kxmVLG%2F-MDyVuca9oYCfkFE8-U1%2Fimage.png?alt=media\&token=7413bed2-ad63-464c-a4ce-2385bbf3ecfa)

The **SARS-CoV-2 Reference Genome** chosen to be aligned is *NC\_045512.*

As already mentioned, the programs used are:

* for mark duplicates: *picard;*
* for variant calling on realigned files: *lofreq;*
* for variant annotation on VCF files: *SnpEff*.

#### Default Parameters Set

QC:

* FastQC: *switch on.*

Adapter Trimming:

* Program for Short Reads: *fastp.*

Reference genomes, indexes and alignment:

* Reference genome: *hg19;*
* Reference genome index for Short Reads: *bwa;*
* Alignment program for Short Reads: *bwa\_mem;*
* Threads: *16;*
* Save the alignment files: *switch on*.

Alignment with Coronavirus Reference Genome:

* Duplicate Mark Program: *picard;*
* Variant Calling Program: *lofreq;*
* Variant Annotation Program: *SnpEff.*

### Results

Once you have selected the dataset to be used, chosen the pipeline and set all the parameters, you can start your analysis using the *Run Analysis* box; at this point you will be redirected to this page, where you can keep an eye on which works are *In Progress*, which are *Completed*, and choose to carry out a new analysis.&#x20;

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-ME3RTcdn0x8-jxQVEbq%2F-ME3S3HQbJfzDdiKFdRV%2FLight%20-%20Dashboard%402x.png?alt=media\&token=0092011a-43fb-4673-9d66-0b9942c4ab74)

By clicking on your *JobName*, you will have access to this page, where you can monitor all the processes involved in your analysis:

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-ME3RTcdn0x8-jxQVEbq%2F-ME3Rj_M3uekxa18wcRx%2FLight%20-%20Pipeline%20Job%402x.png?alt=media\&token=1ec23184-4d03-4aee-9030-ed55bb200481)

Now, selecting the *Results* box on the right, let's take a look at the demo results obtained using the Default Parameters Set:

**Sequence Counts**

Sequence counts for each sample. Duplicate read counts are an estimate only.

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M5v930uAISaz3AvIEJq%2F-M5vBpx_JXRHyBmwXaXi%2Fimage.png?alt=media\&token=21aa5722-07f3-4d6e-b934-2da4e3635e4d)

**GC Content** (or **guanine-cytosine content**)&#x20;

is the percentage of nitrogenous bases guanine (G) or cytosine (C) in a DNA or RNA molecule. This measure indicates the proportion of G and C bases out of an implied four total bases, considering:&#x20;

* adenine and thymine in DNA,&#x20;
* adenine and uracil in RNA.

This module measures the GC content across the whole length of each sequence in a file and compares it to the distribution of GC content in another file.

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M5aVubBmP_z1rQFou62%2F-M5ab07I5jUVcXzaKUmA%2Fimage.png?alt=media\&token=92ecdcf8-74b5-41b4-b66d-7a5487e56d8c)

**Hg19 Alignment Stats**

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M5aVubBmP_z1rQFou62%2F-M5abBrF-2Z8GHeIMIbZ%2Fimage.png?alt=media\&token=46259734-1c5b-47ce-95e1-2cb3ea448400)

This graph is obtained from BWA-MEM algorithm, one of the three algorithms of Burrows-Wheeler Alignment Tool. BWA-MEM is generally recommended for high-quality queries as it is faster and more accurate than the others.&#x20;

BWA is a software package for mapping low-divergent sequences against a large reference genome, such as the human genome.&#x20;

The BWA-MEM algorithm performs local alignment and it may produce multiple primary alignments for different parts of a query sequence: this indicates a critical characteristic for long sequences.

The execution of the algorithm is as follows:

* seeding alignments with maximal exact matches (MEMs);
* &#x20;extending seeds with the affine-gap Smith-Waterman algorithm (SW).

**Corona Alignment Stats**

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M5bZtXqfQDjQjHFlyPJ%2F-M5b_td31CYCcHxAQ0KR%2Fimage.png?alt=media\&token=2f760360-1d8f-4569-b463-12709a2a4436)

**Variant Stats**

![Here an example of the first rows of variant stats.](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M6Uwg3JiszYb5HljjrS%2F-M6Uwxkv70bAeznywW0C%2Fimage.png?alt=media\&token=7e612cdd-bd55-4fb8-829d-b587984d9b86)

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M5bb-PxGk6sK7iR6i9E%2F-M5bbMZ1DOUnqSpgOj1D%2Fimage.png?alt=media\&token=b6939929-9e10-4432-84ad-5fef26f265dd)

By clicking on the Interactive Graphs option, another way of displaying the results is available:

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M60IEdhnyLkgSOIcF2m%2F-M60IkC5bFSdppiWrPKB%2Fimage.png?alt=media\&token=b33ddfe8-5086-48c8-a94f-086530d75999)

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M60IEdhnyLkgSOIcF2m%2F-M60IreiPYxSxrZaFbMJ%2Fimage.png?alt=media\&token=cc5d4122-4cb7-445d-a9a1-47e273654356)

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M60IEdhnyLkgSOIcF2m%2F-M60Jez1g8FAUMXp_HkF%2Fimage.png?alt=media\&token=b2192fbb-88a9-48a9-b524-4104716abfd2)

![](https://335305010-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Sm7H8vvZ4Rwarnfru%2F-M60IEdhnyLkgSOIcF2m%2F-M60Jo56_8inQ1uxYE9h%2Fimage.png?alt=media\&token=9a3b2773-5a9b-4752-80ca-eee3d1d87a49)

Finally, using the *Export* box, you will be able to download the results of your analysis in a *.pdf* format file.

**Pipeline reference:**

This pipeline is based on analysis of variants between samples.&#x20;

<https://github.com/galaxyproject/SARS-CoV-2/tree/master/genomics/4-Variation>

#### Reference

1. [**Aligning sequence reads, clone sequences and assembly contigs with BWA-MEM**](https://arxiv.org/abs/1303.3997), Li H., 2013
2. [**Assembling genomes and mini-metagenomes from highly chimeric reads**](https://link.springer.com/chapter/10.1007/978-3-642-37195-0_13), Nurk S. et al, 2013
