Here is some Python code I put together to convert a .haps file (and associated .sample file) into a .fasta file with an entry for each haploytpe sequence. Haplotypes are designated >ID_A and >ID_B for each ID in the .sample file. The program can easily be modified to accept a list of SNPs or IDs that you would like to extract from the .haps file. Also, this program removes indels that may be present in the .haps file to avoid alignment issues. This program was useful to feed haplotype input into phylogenetic tree programs, such as MEGA. Just run the program by typing python make_fasta.py data.haps in at the commnad prompt and you will get a data.fasta file as output. Hope it is useful.
Hi,
ReplyDeleteI have bed/bim/fam file.
How can I obtain .haps file?