Skip to main content

A python pipeline for implementing smcpp package to decipher demographic history of populations

Project description

SMCPP pipeline

A python pipeline for implementing smcpp to decipher demographic history of populations of interest

All the functions assume that the user has generated population population-specific chromosome file and stored it in a directory popname_vcf present in the current working directory. all the chromosome files should be bgzipped and tabix indexed.

If the user has a single genotype file, then user can make use of bcftools to generate population-specific bgzipped and tabix index VCFs.

The original package can be found here https://github.com/popgenmethods/smcpp

The original article can be found here

Terhorst, J., Kamm, J. & Song, Y. Robust and scalable inference of population history from hundreds of unphased whole genomes. Nat Genet 49, 303–309 (2017). https://doi.org/10.1038/ng.3748

The package can be installed through Pypi (https://pypi.org/project/smcpp-pipeline/)

A tutorial has been provided in a blog (https://medium.com/@devashishtripathi697/population-history-inference-using-whole-genome-sequence-data-9cf99821cd1f) using the simulated data hosted at figshare (https://figshare.com/articles/dataset/msprime_single_population_simulated_dataset/25234849)

pip install smcpp-pipeline


from smcpp_pipeline.smcpp_pipeline import vcf2smc,estimate,plot

1) Function to convert vcf file to smc format
  def vcf2smc(popfile,chromosome_info,gaps_bed,num_workers):
2) Function to estimate the demographic history of a single population
   def estimate(popfile,mu = 1.25e-8,spline = "piecewise",start_time = 100, end_time=100000,knots = 8):
3) Function to generate plots from the model.json file obtained using estimate function
   def plot(popfile,time_start=100,time_end=15000):

popfile should be a tab separated file containing two columns

sample.id  population
i1          pop1
i2          pop1
i3          pop2  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

smcpp_pipeline-0.3.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smcpp_pipeline-0.3.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file smcpp_pipeline-0.3.0.tar.gz.

File metadata

  • Download URL: smcpp_pipeline-0.3.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for smcpp_pipeline-0.3.0.tar.gz
Algorithm Hash digest
SHA256 86cadb88b74cb2ffe8037ee751b9239245f2f7894ba24006b5e10525ee375795
MD5 407467472a97623cc00b5fb303c5f8ab
BLAKE2b-256 4c1b90230f7be83429e4c9ae4b33ba825699418c6a9c2a4b3f705ba2c8eb2071

See more details on using hashes here.

File details

Details for the file smcpp_pipeline-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: smcpp_pipeline-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.18

File hashes

Hashes for smcpp_pipeline-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d392e72021262e415abfbb2960b31792dbc236cbe7b9b7f0f26623d4036b9a66
MD5 c21c03c432ac5418388672baaeda83a5
BLAKE2b-256 4f7e572ae0a732dcd1293d4902040f8cb1ae00e0adf6c6dea0593f533debf750

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page