Package: isweep
Seeannouncements.mdfor high-level updates on this repo.Seeusage.mdto evaluate if this methodology fits your study.CitationPlease cite if you use this package.Temple, S.D., Waples, R.K., Browning, S.R. (2023) "Modeling recent positive selection in Americans of European ancestry"https://www.biorxiv.org/content/10.1101/2023.11.13.566947v1MethodologyAcronym: Incomplete Selective sweep With Extended haplotypes Estimation ProcedureThis software presents statistical methods to study very recent, very strong positive selection.By very recent, we mean within the last 500 generationsBy very strong, we mean selection coefficient s >= 0.015 (1.5%)The methods relate the lengths of IBD tracts to a coalescent model under selection.We assume 1 selected allele at a biallelic locus.There are ~ seven major ideas.A genome-wide selection scan that looks for anomalously large IBD ratesInferring anomalously large IBD clustersRanking alleles based on evidence for selectionComputing a measure of cluster agglomeration (an IBD information entropy)Estimating allele frequency of unknown sweeping alleleEstimating selection coefficients (w/ nice statistical properties)Estimating a confidence interval (w/ nice statistical properties)These steps are implemented automatically in asnakemakepipeline.Installationgit clone https://github.com/sdtemple/isweep.gitconda env create -f isweep-environment.ymlconda activate isweeppython -c 'import site; print(site.getsitepackages())'Download softwareYou need to cite these softwarebash get-software.sh softwarePuts these in a folder calledsoftware/Requires wgetFor simulation study, download SLiM yourselfPut insoftware/https://messerlab.org/slim/Use IBDkin (https://github.com/YingZhou001/IBDkin) to remove close relatives.Use PCA or ADMIXTURE to subset based on ancestry.If you want to compare against other methods (using our pipelines), you require more software.Seeworkflow/other-methods/folder.OverviewThis repository contains a Python package and some Snakemake bioinformatics pipelines.The package ---> src/The pipelines ---> workflow/You should run allsnakemakepipelines in theirworkflow/some-pipeline/.You should be in theconda activate isweepenvironment for analyses.You should run the analyses using cluster jobs.We have made README.md files in most subfolders.The input data is:Whole genome sequencesProbably at least > 500 diploidsPhased vcf data 0|1No apparent population structureNo apparent close relatednessA genetic map (bp ---> cM)Recombining diploid chromosomesNot extended to human X chromosome (yet?)Access to cluster computingYou should have at least 25 Gb of RAM and 6 CPUs on a nodeMore for larger datasetsHave not extended to cloud computing (yet?)Running the procedure:This is the overall procedure. You will see more details for each step in workflow/some-pipeline/README.md files.Phase data w/ Beagle or Shapeit beforehand.Make pointers to large (phased) vcf filesEdit yaml files in the different workflow directoriesRun the selection scan (workflow/scan)nohup snakemake -s Snakefile-scan.smk -c1 --cluster "[options]" --jobs X --configfile *.yaml &Recommendation: Do a test run with your 2 smallest chromosomes.Check the *.log files from ibd-ends. If it recommends an estimated err, change the error rate in yaml.Then, run with all your chromosomes.Estimate recent effective sizes (workflow/scan)workflow/scan/scripts/run-ibdne.shMake the Manhattan plot (workflow/scan)workflow/scan/scripts/manhattan.pyCheckout the roi.tsv filecat roi.tsvEdit it with locus names if you wantRun the region of interest analysis (workflow/roi)nohup snakemake -s Snakefile-roi.smk -c1 --cluster "[options]" --jobs X --configfile *.yaml &Tip: define variables for file, folder names, e.g.,variable1=1224thenecho $variable1ConsiderationsPositive selections >= 0 for estimation (use bounds in scipy.optimize.minimize_scalar)Development things to doProvide option for model selection, standing variation, etc. inroi.tsvProvide some scripts to summarize analysesTest performance in array data, less dense sequence dataTest performance in dominance selection (sequence data)Time varying selection coefficients?Not designed for ploidy != 2 (yet)Current bugs