Realistic synthetic pedigree generation, visualization, and file export.
Project description
Pedigree Generation Package
PedGen is a python package that can be used to generate genetically realistic pedigrees. Generated pedigrees can be visualized as directed acyclic graphs and exported in PED file format.
Prerequisites
Some functionality included in PedGen relies on system-level dependencies, namely in instalation of Graphviz. Please ensure Graphviz is installed before using the pedigree visualization functionality:
Unix
sudo apt install graphviz libgraphviz-dev
macOS(Homebrew)
brew install graphviz
Installation
All required Python dependencies will be installed automatically with this package using pip.
pip install PedGen
Usage
The primary function included in this package, pedigree_generator, works to contruct a realistic pedigree based on mendelian inheritance patterns and alternate allele frequencies in accordance with Hardy-Weinberg equilibrium. The generated pedigree is represented as Pandas dataframe object followign PED file formatting.
Pedigree Generation:
'pedigree_generator(FamilyID, max_children, mode, generation_count, SpouseLikelihood = 0.6, AffectedSpouse = True, BackpropLikelihood = 0.25, alt_freq = 0.1)' - returns a dataframe with familial relation, sex, and phenotype information for individuals in the generated pedigree.
Parameters
- FamilyID(string): the ID name to be attached to the generated family pedigree
- max_children(int): the maximum number of children that should be generated for any reproductive pair within the pedigree
- mode['AD','AR']: the mode of inheritence to be used in generating the pedigree based on mendelian inheritance patters (AR= Autosomal Recessive, AD= Austosmal Dominant)
- generation_count(int): the number of generations to be represented in the generated pedigree
- SpouseLikelihood(float[0-1]): the likelihood that a reproductive partner will be generated for any offspring entry made over the course of pedigree forward propigation (default: 0.6)
- AffectedSpouse(bool): determines if any ofthe generated reproductive partners have a non-zero chance of being carriers of the alternate allele (default: true)
- BackpropLikelihood(float[0-1]): the likelihood that a parental history will be generated for any generated reproductive partner over the course of reverse pedigree propigation (default: 0.1)
Additional Functionality:
gen_PED_export(df, output_dir='.'): exports the generated family pedigree as a formatted PED file named after assigned FamilyID found in dataframe (i.e. 'FamilyID'.ped).
- df(DataFame): generated family pedigree dataframe object
- output_dir(string): destination directory for exported PED file, default is working directory
plot_pedigree_tree(df, title="Pedigree (Tree Layout)"): displays directed graphical representation of the generated pedigree.
- df(DataFame): generated family pedigree dataframe object
- title(string): title to be displayed with pedigree graph
construct_pedigree_graph(df): contructs a networkx.DiGraph object representing the given pedigree dataframe to be used in further graphical analysis of pedigrees
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pedgen-0.1.3.tar.gz.
File metadata
- Download URL: pedgen-0.1.3.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08dcf2e07b8bc59fc4e990ad415cdf5ef3c34e94e8fd16c508c6bb059057b153
|
|
| MD5 |
4701e283cda192d645bd3ea83936a497
|
|
| BLAKE2b-256 |
3e5e813cd9998d8a789a5fde1795ceb42b8327b5f1d1e5391d15ed4848e9458b
|
File details
Details for the file pedgen-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pedgen-0.1.3-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c28a6ad62b5c813894c96df8e7f60926a07762b688fab17e24f80bb8d127f1e
|
|
| MD5 |
a56fd71bfb231b5ebd59b258a49d7e4e
|
|
| BLAKE2b-256 |
c277053f0801cdac23d56380c94b901404513ccea6c4a14ddb0afe69c37b9694
|