Pedigree
- class hail.genetics.Pedigree[source]
Class containing a list of trios, with extra functionality.
- Parameters:
trios (list of
Trio
) – list of trio objects to include in pedigree
Attributes
List of trio objects in this pedigree.
Methods
List of trio objects that have a defined father and mother.
Filter the pedigree to a given list of sample IDs.
Read a PLINK .fam file and return a pedigree object.
Write a .fam file to the given path.
- complete_trios()[source]
List of trio objects that have a defined father and mother.
- Return type:
list of
Trio
- filter_to(samples)[source]
Filter the pedigree to a given list of sample IDs.
Notes
For any trio, the following steps will be applied:
If the proband is not in the list of samples provided, the trio is removed.
If the father is not in the list of samples provided, pat_id is set to
None
.If the mother is not in the list of samples provided, mat_id is set to
None
.
- classmethod read(fam_path, delimiter='\\s+')[source]
Read a PLINK .fam file and return a pedigree object.
Examples
>>> ped = hl.Pedigree.read('data/test.fam')
Notes
See PLINK .fam file for the required format.
- write(path)[source]
Write a .fam file to the given path.
Examples
>>> ped = hl.Pedigree.read('data/test.fam') >>> ped.write('output/out.fam')
Notes
This method writes a PLINK .fam file.
Caution
Phenotype information is not preserved in the Pedigree data structure in Hail. Reading and writing a PLINK .fam file will result in loss of this information. Use
import_fam()
to manipulate this information.- Parameters:
path (str) – output path