TITLE: Introgression
AUTHORS: Graham Etherington

[DESCRIPTION]
The European polecat (Mustela putorius) is a mammalian predator which breeds across much of Europe east to central Asia. In Great Britain, following years of persecution the European polecat has recently undergone a population increase due to legal protection and its range now overlaps that of feral domestic ferrets (Mustela putorius furo). During this range expansion, European polecats hybridised with feral domestic ferrets producing viable offspring. Here we carry out population-level whole genome sequencing on domestic ferrets, British European polecats, and European polecats from the European mainland and find high degrees of genome introgression in British polecats outside their previous stronghold, even in those individuals phenotyped as ‘pure’ polecats. 

[STEPS]
SECTION: HyDe analyses
1. Note: Due to a bug, HyDe can't handle sequences > 2.1Gb (the size of a 32-bit signed integer), so you'll need to use Sanger snp-sites to create a snp-only dataset.
The following uses the consensus sequences created in Step 2.4 at:
https://www.protocols.io/edit/gatk-nuclear-variant-discovery-and-consensus-assem-bqzgmx3w

SECTION: DSuite analyses
2. Dsuite calculates ABBA-BABA tests for quartets of samples, providing the D-statistic
Weasel will be used as the Outgroup
Firstly I need a population file. This is practically identical to the Hyde sample map (see sample.map above), other than having the keyword 'Outgroup' as the population name for weasel.
Dsuite can be run with a tree.  The tree is a population-level one. Here's mine.


 

SECTION: HyDe analyses
1.1. Create an alignment with variant sites only
 

SECTION: HyDe analyses
1.3. Next, the input to Hyde is Phylip, so we need to change our .fasta file  into a .ph file. The order of the sequences input into Hyde has to be in the same order as the sample.map, so we also need to sort the sequences whilst we're re-formatting them.

sort_fasta_to_phylip.py3
 

Run with:

 

SECTION: HyDe analyses
1.2. Hyde requires a tab-delimited sample-population file, e.g.

sample.map
 


SECTION: Allele sharing
3. I want to extract loci where all the domestic ferret samples are  homozygous ref and all the high-coverage (>10x coverage) European  polecat samples are homozygous var (alt), using the GenotypeGVCFs file  that I generated from the all_samples_GenomicsDB. I also want all the  sites to have at least 5x coverage.

select_dom_hom_polcat_alt_hiqual.sh

 

SECTION: HyDe analyses
1.4. Run HyDe


 

SECTION: HyDe analyses
1.5. Once we have our trios that involve hybridisation/introgression, we can examine every individual in those trios.


 

SECTION: DSuite analyses
2.2. Run Dsuite


 

SECTION: Allele sharing
3.1. A quick check to make sure that all the sites are high quality.


 

Count the number of loci

 

SECTION: Allele sharing
3.2. Fixed alleles in other samples

Using  the dom_ep_fixed.vcf file as an interval file, we can now make sample-specific vcf files that only contain the 8288 sites that are fixed.
In the script bdlow  $sample is the sample_name found in the vcf file, $vcf is the output vcf
e.g. sbatch make_vcfs.sh domestic_LIB8733 ./m_putorius/furo/LIB8733.vcf.gz


 

Next, compare the genotypes and alleles in the output vcf files to those in dom_ep_fixed.sh using a custom python script, where the input is the same as above.


 

The output from this is a comma-delimited file providing information such as count and proportion of homozygous ref and alt, and heterozygous alleles. I created a combined file as follows:


 

SECTION: Allele sharing
3.3. False discovery rate

Now that we have the list of fixed alleles in ferrets vs polecats, we  can test the false discovery rate by looking at these snps in the 12 Mb  Broad Sequence array.

The Broad array was mapped to the Broad reference and I'm using the Bionano reference.

Create a new reference sequence

I  extracted the 6 x 2Mb fasta sequences from the Broad reference, blasted it against the Bionano reference and identified the sequence array co-ordinates on the Bionano reference.

Get the fasta sequences for the  array:
 

I also need to create a version of the dom_ep_fixed.vcf file that only contains the variants within the sequence array.

 


Then, use the output fastq files to map to the Bionano sequence array, and output SNPs within the sequence array co-ordinates.

 

Then create a GATK genomicsDB, joint genotype all the samples and  extract sites in the fixed homozygous ref/var dom_ep_fiexed.vcf file


 

The output from this is a VCF file that contains all 76 samples from  the Broad array, covering each site that is called as fixed in the  dom_ep_fixed_broad_array.vcf.gz file (250 sites).

Next I want to see how many sites, along with how many samples are not called as homozygous ref.


 

SECTION: DSuite analyses
2.1. First, I want to select only bi-allelic snps