Step: Read Mapping and Post-processing

Map trimmed reads using bwa mem

The raw FASTQ data files are available in sub_samples2. For this analysis, you will require the trimmed reads generated in the previous step.

The reference genome files are available in /data/PwaniGenomics/reference

The reads that were trimmed to remove adapters and low-quality bases need to be mapped to a reference genome.

📝 TASK 1: Map the reads to the GCF_018350215.1_P.leo_Ple1_pat1.1_genomic.fna reference genome.

The mapping creates a .sam file. This occupies lots of storage space on the server, so we should convert it to a .bam file.

.sam is an abbreviation for Sequence Alignment Map and .bam is an abbreviation for Binary Alignment Map.

📝 TASK 2: Convert the SAM file to BAM.

The reads are arranged randomly in the SAM and BAM files. They need to be sorted according to the genomic coordinates they occupy.

Sorting the reads improves the efficiency of downstream analyses, such as variant calling, by allowing access to specific regions of the genome.

📝 TASK 3: Sort the BAM files.

PCR duplicates and optical duplicates need to be removed or marked before downstream analysis because they may artificially inflate sequencing depth.

PCR duplicates: These are identical reads or read pairs resulting from over-amplification during the PCR step of library preparation rather than from independent biological DNA fragments. During sequencing, they can appear as though the same fragment was sequenced multiple times.

Some fragments may be amplified more efficiently due to their sequence or other properties. Poor-quality enzymes or unoptimized PCR conditions may also lead to non-specific amplification.

Optical duplicates: These arise from sequencing-machine imaging artifacts. When a single cluster is incorrectly interpreted as multiple nearby clusters because of how it fluoresces, the resulting reads can appear similar to PCR duplicates even though they were generated by an imaging artifact.

Note: This duplicate-removal step should generally be avoided for ddRAD, RAD-seq, and amplicon sequencing because many reads may naturally share the same initial sequence or represent PCR-derived fragments.

📝 TASK 4: Remove or mark duplicate reads.

INDEX AFTER MARKDUPLICATES

Indexing allows quick access to specific genomic regions and improves the performance of downstream analysis tools.

📝 TASK 5: Index the sorted and duplicate-marked BAM file for SNP calling.

Estimate some statistics from the BAM files.

📝 TASK 6: Estimate the sequencing depth and percentage of reads mapped to the reference genome.

Look for a section such as "Chromosome-wise coverage" or a similar coverage summary.

Extra note

The FASTQ files and other workshop files are also available for download for use later.


## The datasets are available at:
https://zenodo.org/records/21871083