This pipeline is a series of three Python scripts that determine if both haplotypes in a long IBD segment have the same local ancestry. The final files are of the type chr.lai.ibd.overlap.gz under the folder you specify in the config.yaml file.
- The
ANCESTRYcolumn is a number that corresponds to those panels in the FLAREanc.vcf.gzoutput. - The
ANCESTRYis -1 if one or both of the haplotypes have an ancestry switch in the IBD stretch. - The file format mirrors that of
hap-ibd.jarbut with anANCESTRYcolumn and a header.
In config.yaml, you need to adjust the file paths to where your genetic map, FLARE, and IBD segment data are.
You can run the script with snakemake -c1 --configfile config.yaml. Use -n to make a dry-run and see if the files are specified correctly. Visit isweep for more advice.
I have not designed the scripts/overlap-flare-lai-and-ibd.py script for chunked dataframe processing. If you have a large IBD file (say from a biobank-scale) analysis, the program may crash.
Some assumptions of the scripts are:
- There are less than 11 ancestry groups in the FLARE analysis.
- The FLARE optional parameter is probs=false (hard calls not ancestry dosages).
- You have used the file format of
hap-ibd.jarto call IBD. - You have Python
pandasinstalled in your current environment. - You have Snakemake installed in your current environment.
This code is part of a Snakemake workflow.
For more information about Snakemake workflows, rules, and configuration, see the official documentation: https://snakemake.readthedocs.io/.
This code is written and tested on output data from
This code can be run after the isweep local ancestry pipeline.