Skip to main content

Statistical inference using IBD segments

License: CC0-1.0

isweep is a Python package and a series of automated workflows to study natural selection with identity-by-descent (IBD) segments. The Python package simulates IBD segments around a locus and estimates selection coefficients. The automated workflows perform selection scans, selection coefficient estimation, IBD case-control mapping, haplotype phasing, and local ancestry inference. Scripts in the workflows can be run individually in scripts/, with argparse documentation and inputs.

These methods are suitable for analyses for recent genetic/evolution events. For example,

  • By recent, we mean within the last 500 generations.
  • By strong, we mean selection coefficient s >= 0.015 (1.5%).
  • Scan may have moderate power for s >= 0.01 (1%).

Please review the Readthedocs for detailed support, including which relevant publications to cite if you use this software.

Please file an Issue on GitHub for troubleshooting.

Contact sethtem@umich.edu for support specific to your analysis, e.g., analyses of non-human genetic data.

The input data is:

  • Whole genome sequences
    • Probably at least > 500 diploids
    • Phased vcf data 0|1 of recombining chromosomes
    • Tab-separated genetic map (bp ---> cM)
      • Without headers!
      • Columns are chromosome, rsID, cM, bp
  • Access to cluster computing

workflow/phasing-ancestry provides support for phasing and selecting an ancestry cohort.

Primary pipelines:

The main workflows, workflow/scan-selection and workflow/model-selection do:

  1. Scan genome for extreme IBD rates
  2. Detect anomalously large IBD clusters
  3. Rank alleles based on evidence for selection
  4. Compute a cluster agglomeration measure
  5. Estimate frequency, location of unknown sweeping allele
  6. Estimate a selection coefficient (w/ CIs)

In general, you run workflows with

nohup snakemake -s Snakefile-*.smk -c1 --cluster "sbatch [options]" [options] --jobs XX --configfile *.yaml &

You modify the relevant YAML files, which define the method parameters. You should run the pipelines in the mamba activate isweep environment.

Step 1 may be standalone, depending on the analysis. (You may not care to model putative sweeps (Steps 2-6), which also requires demographic Ne estimation.)

Installation

To install the dependencies and our package:

  1. Clone the repository
git clone https://github.com/sdtemple/isweep.git 
  1. Get the Python package
mamba env create -f isweep-environment.yml
  1. Download some Java software.
bash get-software.sh 

You can test the workflows with our small Zenodo repository.

Picture of selection scan

The flow chart below shows the steps ("rules") in the selection scan pipeline.

Metadata

Release files for isweep 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for isweep 1.1.3
File Size Uploaded
isweep-1.1.3.tar.gz 647.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for isweep 1.1.3
File Interpreter ABI Platform
isweep-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 674.7 kB

Release files / isweep-1.1.3.tar.gz

Download URL isweep-1.1.3.tar.gz
Size 647.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3e55fe20edd0a829f0e9420e584d6fe4fb3be56187cd20b8108719403340a0a5
BLAKE2b-256 checksum
How to use checksums
e3948fd265f72fc51fa95b2199bda9375c2224064e8154fc5d22df50ac4904ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release files / isweep-1.1.3-py3-none-any.whl

Download URL isweep-1.1.3-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3656c7ee50bfc1ed25bb95e22222d22477d5ce7798d556a8684a0096a349e7a1
BLAKE2b-256 checksum
How to use checksums
0a77a8d02605212c19052376956f50d1e83c417c2889c6a20928ee4239ab0244
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page