Skip to content

Mapping, Structural Variants

Lavadav edited this page Oct 18, 2022 · 7 revisions

Long Read Alignment

We will use Minimap to align long reads back to Hap1 and Hap2 to look at structural variants.

mkdir 6_structural_variants
cd 6_structural_variants

ln -s /pickett_shared/teaching/EPP622_Fall2022/long_read/analysis/4_busco/hap1_subset_9.fa
ln -s /pickett_shared/teaching/EPP622_Fall2022/long_read/raw_data/CherBrave_Run1_m64310e_211208_183918.fastq.gz .

/sphinx_local/software/minimap2-2.24_x64-linux/minimap2 \
        -ax asm5 \
        --eqx \
        -o Dogwood_SV_hap1.sam \
        -t 2 \
        hap1_subset_9.fa \
        CherBrave_Run1_m64310e_211208_183918.fastq.gz \
        >& minimap2_output

Calling SV's

spack load /r67sol
samtools view -b -@ 2 Dogwood_SV_hap1.sam > Dogwood_SV_hap1.bam
samtools sort -@ 2 Dogwood_SV_hap1.bam -o Dogwood_SV_hap1.sorted.bam
samtools index Dogwood_SV_hap1.sorted.bam

conda create -n sniffles
conda activate sniffles
conda install sniffles=2.0

sniffles --input Dogwood_SV_hap1.sorted.bam --vcf Dogwood_SV_hap1.vcf -t 2
conda deactivate

VCF Stats

conda create -n tabix -c bioconda tabix 
conda activate tabix
bgzip Dogwood_SV_hap1.vcf
tabix Dogwood_SV_hap1.vcf.gz
conda deactivate

spack load bcftools
bcftools stats Dogwood_SV_hap1.vcf.gz > Dogwood_SV_hap1.vchk
plot-vcfstats Dogwood_SV_hap1.vchk -p plots/

IGV: to view the SV's.

It's a GUI software that can be installed on your computer using the link: IGV (Integrative Genomics Viewer)