happer is a minimal Python library for generating complete haplotype sequences.
Given a reference sequence and haplotype alleles annotated in BED format, happer will mutate the reference and produce sequences to match the specified haplotypes.
Installation
To install:
pip3 install happer
To make sure the package installed correctly:
pip3 install pytest
py.test --pyargs happer
happer requires Python version 3.
Usage
Reference sequences must be provided in Fasta format, and haplotype alleles must be specified in BED format as follows.
Alleles corresponding to different haplotypes at the locus are separated by a | character, so for example a diploid individual should have 2 |-separated alleles annotated at each locus, while a tetraploid would have 4 alleles.
In the example below, the CCGA alleles are phased and represent one haplotype, while the TATG alleles are phased and represent another haplotype.
>>> import happer
>>> seqfile = open('refr.fasta', 'r')
>>> alleles = open('alleles.bed', 'r')
>>> for label, haploseq in happer.mutate.mutate(seqfile, alleles):
... # do whatever you'd like with the sequences
happer
Daniel Standage, 2018
https://github.com/bioforensics/happer
happer is a minimal Python library for generating complete haplotype sequences. Given a reference sequence and haplotype alleles annotated in BED format, happer will mutate the reference and produce sequences to match the specified haplotypes.
Installation
To install:
To make sure the package installed correctly:
happer requires Python version 3.
Usage
Reference sequences must be provided in Fasta format, and haplotype alleles must be specified in BED format as follows. Alleles corresponding to different haplotypes at the locus are separated by a
|character, so for example a diploid individual should have 2|-separated alleles annotated at each locus, while a tetraploid would have 4 alleles. In the example below, theCCGAalleles are phased and represent one haplotype, while theTATGalleles are phased and represent another haplotype.To invoke happer from the command line:
To invoke happer directly in Python: