cellink.resources.get_1000genomes_plink_files#
- cellink.resources.get_1000genomes_plink_files(config_path='./cellink/resources/config/1000genomes.yaml', population='EUR', data_home=None, refresh=False)#
Download and extract 1000 Genomes PLINK files (BED/BIM/FAM format).
This function downloads population-specific PLINK files from the 1000 Genomes project, extracts them to a local directory, and returns the path to the extracted files.
- Parameters:
config_path (str or pathlib.Path, default='./cellink/resources/config/1000genomes.yaml') – Path to YAML configuration file specifying URLs and file names for PLINK files.
population (str, default='EUR') – Population code for PLINK files. Currently only ‘EUR’ is supported.
data_home (str or pathlib.Path, optional) – Root directory where data will be stored. Defaults to user-specific cache directory.
refresh (bool, default=False) – If True, re-downloads and re-extracts files even if they already exist locally.
- Return type:
- Returns:
- pathlib.Path
Path to the directory containing extracted PLINK files (.bed, .bim, .fam). Files are named as: {prefix}{chrom}.bed/bim/fam where chrom ranges from 1-22.
- prefixstr
File name prefix used in the extracted data.
- Raises:
ValueError – If
populationis not supported in the configuration.
Examples
>>> plink_dir = get_1000genomes_plink_files(population="EUR") >>> # Access chromosome 1 files at: >>> # plink_dir / "1000G.EUR.QC.1.bed" >>> # plink_dir / "1000G.EUR.QC.1.bim" >>> # plink_dir / "1000G.EUR.QC.1.fam"