Skip to content

Commit

Permalink
Update and rename mapping.md to mapping_variantcalling.md
Browse files Browse the repository at this point in the history
  • Loading branch information
seppinho authored Apr 25, 2023
1 parent caa10ac commit 944fbd0
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions scripts/mapping.md → scripts/mapping_variantcalling.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
# Mapping and Variant Calling
## Mapping

## Task 1
### Task 1
In the first exerise we align data with `bwa mem`:
* Create a folder `mapping` under `genepi-teaching/students/<q-number>` and change to this folder. Substitute <q-number> with your q-number!
* Copy the files `4153_S13_L001_R1_001.fastq.gz` and `4153_S13_L001_R2_001.fastq.gz` from here: `/mnt/genepi-lehre/teaching/ngs-bioinformatics/data/fastq/exercises/miseq` using `cp <source> .`. (The point at the end of command means that the data is copied to the current location).
* Command should look something like this:
`bwa mem /mnt/genepi-lehre/teaching/ngs-bioinformatics/data/ref/kiv2_6.fasta <r1.fq> <r2.fq> > 4153.sam`

## Task 2
### Task 2
Now, we convert the file to the BAM format.
* Execute `samtools view -Sb 4153.sam > 4153.bam` to convert the file from SAM to BAM.
* Execute `samtools sort 4153.bam -o 4153_sorted.bam` to sort the file by position.
* Create an index with `samtools index 4153_sorted.bam`. This will create a index file (4153_sorted.bam.bai)

## Task 3
### Task 3
Run `samtools depth <aligned-file-sorted.bam>` on the file and interpret the output. Learn about the `-a` parameter and add it to your command.

## Tasks 4
### Tasks 4
Download the file to Windows
* Open a new Powershell and download the *.bam file and *.bam.bai file. Use your q-number instead of mine.
* `scp [email protected]:genepi-teaching/students/q141ss/mapping/4153_sorted.bam* .`

## Task 5
### Task 5
Install "Tablet" (*.exe availablle in the Shared Drive) and load the BAM file via *Open Assembly*. You also need to specify the reference, you can find the KIV_2.fasta reference in the Shared Drive.

## Variant Calling

### Task 1 - Use the aligned file and call variants
Checkout [freebayes](https://github.com/ekg/freebayes#usage) and call your variants. As an input the aligned file (`4153_sorted.bam`) is required. Write the output to a file ending with .vcf. (freebayes <ref> <bam> > out.vcf)

### Task 2 - Learn bcftools
[Bcftools](https://samtools.github.io/bcftools/bcftools.html) are utilities for variant calling and manipulating VCFs and BCFs. Try to learn the bcftools convert command extract a region from the vcf file.

0 comments on commit 944fbd0

Please sign in to comment.