---
# System prepended metadata

title: 'Session 6: Variant Calling'

---


# Session 6: Variant Calling

### Variant Calling with Target Capture Data

To begin, we will need to download IGV Viewer  which will be used to view .vcf (variant call files) at the end of the lesson.

### Getting Started: Software Download and Singularity Activation
#### Action 3.1.1
Download IGV Viewer: https://software.broadinstitute.org/software/igv/download
- requires Java 11 

#### Action 3.1.2
Activate Singularity container, which contains the following software for population genetics software: 
 - BWA 0.7.17
 - GATK 4.2.2.0
 - SamTools (latest version)

HELP! Messaged Yanni 

```
code to activate singularity here
```

### Create A Reference File
#### Action 3.2.1
Concatenate all supercontigs into one single reference file for your species.

```
prefix/*/prefix/sequences/intron/*_supercontig.fasta > prefix.supercontigs.fasta
```

*Note: "prefix.supercontigs.fasta" will be used as an input on command line along with* ```samplename```


### Call SNP Variants Against Reference
#### Action 3.3.1
We will use ```bwa mem``` to map paired-end reads to supercontigs. Read groups will be replaced for mapped and unmapped bam files for downstream processing, and duplicate reads will be removed. We will remove intermediate BAM files, and then we will use GATK HaplotypeCaller to produce a .GVCF (group variant call file) and .idx (index file) we will use to view SNP variants in IGV Viewer. 

```
bash variantcall.sh prefix.supercontigs.fasta samplename
```