cellink.resources.get_1000genomes_frq#
- cellink.resources.get_1000genomes_frq(config_path='./cellink/resources/config/1000genomes.yaml', population='EUR', data_home=None, return_path=False, refresh=False)#
Download and extract 1000 Genomes allele frequency files.
Required for
ldsc.py --overlap-annot --frqfile-chr. Downloaded from Zenodo record 10515792 (1000G_Phase3_frq.tgz).- Parameters:
config_path (str or pathlib.Path) – Path to YAML configuration file.
population (str, default='EUR') – Population code. Currently only
'EUR'is available.data_home (str or pathlib.Path, optional) – Root directory where data will be stored.
return_path (bool, default=False) – If True, returns
(DATA, prefix)instead of loading DataFrames. For frq files,return_path=Trueis the typical usage since these files are passed as a prefix to ldsc.py rather than loaded into memory.refresh (bool, default=False) – If True, re-downloads and re-extracts files even if they already exist.
- Return type:
- Returns:
tuple If
return_path=True:(DATA, prefix)whereDATAis aPathto the directory containing the extracted.frqfiles andprefixis the file name prefix (e.g."1000G.EUR.QC.").If
return_path=False:(DATA, frq_df)wherefrq_dfis a concatenatedpd.DataFrameof all per-chromosome frq files.- Raises:
ValueError – If
populationis not listed in the configuration.
Examples
>>> frq_dir, frq_prefix = get_1000genomes_frq(population="EUR", return_path=True) >>> frqfile_chr = str(frq_dir / frq_prefix) # passed as --frqfile-chr