-
Notifications
You must be signed in to change notification settings - Fork 0
/
2_WhatsHap.sh
36 lines (32 loc) · 1.08 KB
/
2_WhatsHap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#INPUTS:
#input VCF is the filtered VCF with unphased haplotypes. It should contain ONLY the individuals to be phased
#input BAM contains reads of individuals to be phased - must contain at least the individuals that are being phased.
#####################
# Read-base phasing #
#####################
whatshap phase \
--ped $ped \
-o $phased.vcf \
--reference $ref \
--indels \
$input.vcf.gz \
$bam.bam
# Zip VCF file
bcftools view $phased.vcf -O z -o $phased_zipped.vcf.gz
#Index VCF file
bcftools index $phased_zipped.vcf.gz
####################
# Pedigree phasing #
####################
# ADDITIONAL INPUT:
#ped: PED file containing pedigree information of individuals (Offspring ID | Dad ID | Mom ID | Sex). This file is required for pedigree phasing but not for read-base phasing.
whatshap phase \
-o $phased.vcf \
--reference $ref \
--indels \
$input.vcf.gz \
$bam.bam
# Zip VCF file
bcftools view $phased.vcf -O z -o $phased_zipped.vcf.gz
#Index VCF file
bcftools index $phased_zipped.vcf.gz