Menu

RandomSNPsWMode

Robert Kofler Christos Vlachos

1 Introduction

We provide a SNP that allows to randomly picking the targets of selection for the w-mode. As input the MimicrEE2 haplotypes are required.
The script provides two options

  • all selected SNPs may have the same effect size
  • the selected SNPs may follow a distribution of effect sizes as provided in a file

Note this is quite similar to randomly picking QTLs for the qt-mode and the qff-mode [RandomSNPsQTL]

Requirements

First download the MimicrEE2 haplotypes https://sourceforge.net/projects/mimicree2/files/starvation_resistance/mimicree_format_dgrp_snps_X_chromosome.gz/download

Than download the script https://sourceforge.net/projects/mimicree2/files/scripts/pick-SNPs-selcoef.py/download

the following parameters are important:

  • --mimhap the MimicrEE2 haplotype file; may be zipped or unzipped
  • --n the number of selected loci
  • --f the minimum allele frequency; For example if --f 0.05 is provided all SNPs will have an allele frequency betwee 0.05 and 0.95
  • --s the selection coefficients of the selected SNPs (either --s or --effect-file needs to be provided)
  • --h the heterozygous effect of the selected SNPs; default = 0.5
  • --effect-file provide a file with the effect size distribution of the selected SNPs (this will override any values provided in --s or --h)

The script will first select all loci that fullfill the frequency criteria (thus having a minimum frequency of --f). Then it selects the requested number of loci randomly from this set. Finally it randomly chooses one of the two alleles at each SNPs as the beneficial one.

2 Pick SNPs with identical effect size

python pick-SNPs-selcoef.py --mimhap mimicree_format_dgrp_snps_X_chromosome.gz --n 20 --s 0.1 --f 0.05 > sellocus.txt

and we for example obtain the following output (cat sellocus.txt)

[s]
3R  13879402    A/T 0.1 0.5
2R  9477466 C/T 0.1 0.5
3R  9328727 G/C 0.1 0.5
3L  16184512    T/C 0.1 0.5
2L  1969063 C/T 0.1 0.5
X   16445969    A/G 0.1 0.5
3L  13434376    C/T 0.1 0.5
X   2546369 G/C 0.1 0.5
2L  15610136    G/T 0.1 0.5
X   1737206 A/T 0.1 0.5
2R  10601625    T/G 0.1 0.5
3L  8504833 C/A 0.1 0.5
2R  10707643    T/G 0.1 0.5
2R  6685134 G/A 0.1 0.5
2R  612843  A/T 0.1 0.5
2R  7289434 T/C 0.1 0.5
3R  12359406    G/A 0.1 0.5
2L  4715803 A/C 0.1 0.5
2L  16304941    G/T 0.1 0.5
3R  634316  C/T 0.1 0.5

For details on this file format see [SelectedLoci]

3 Pick SNPs with an effect size drawn from a distribution

distribution of effect size

To obtain selected SNPs with effect sizes following a distribution you have to provide a file containing the desired distribution of effect sizes.

The file needs to have two column and may have an arbitrary number of rows:

  • column1: the selection coefficient
  • column2: the heterozygous effect

For examle given the following content stored in file effectsizedistr.txt

0.1     0.5
0.1     0.5
0.1     0.5
0.1     0.5
0.2     0.5
0.3     0.5
0.4     0.5
0.5     0.5

The script will assign a random effect sizes to each selected SNPs. The effect size is drawn from this file by picking random rows with replacement.
Thus the combination of selection coefficient and heterozygous effect as provided in the file will be maintained.
Based on this example most SNPs will have a selection coefficient of 0.1 and few will have a selection coefficient of 0.2 or 0.3. However, all SNPs will have a heterozygous effect of 0.5.

pick the loci

With the following command we randomly pick the loci

python pick-SNPs-selcoef.py --mimhap mimicree_format_dgrp_snps_X_chromosome.gz --n 20 --effect-file effectsizedistr.txt --f 0.05

and we obtain an output similiar to this one

[s]
3R  6941048 C/T 0.1 0.5
2R  12592831    C/G 0.1 0.5
3L  8315781 T/G 0.5 0.5
2L  15620577    T/C 0.5 0.5
3R  9870974 C/T 0.5 0.5
3R  7009549 T/A 0.5 0.5
3L  14816601    A/C 0.1 0.5
2R  19007146    G/A 0.5 0.5
2R  10030750    C/T 0.3 0.5
3L  12571197    C/T 0.1 0.5
3L  10579497    T/C 0.2 0.5
2L  17368433    T/A 0.3 0.5
3L  12988113    C/T 0.1 0.5
X   13161667    A/C 0.1 0.5
2L  2719442 T/C 0.3 0.5
3R  14201605    T/A 0.1 0.5
2R  10250433    C/A 0.4 0.5
2R  9251683 C/G 0.1 0.5
3R  21063725    C/A 0.4 0.5
2L  11212417    G/A 0.2 0.5

Related

Wiki: Home
Wiki: RandomSNPsQTL
Wiki: SelectedLoci

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.