sgkit.io.plink.plink_to_zarr#
- sgkit.io.plink.plink_to_zarr(*, path=None, bed_path=None, bim_path=None, fam_path=None, output, chunks='auto', fam_sep=' ', bim_sep='\\t', bim_int_contig=False, lock=False, persist=True, storage_options=None)#
Convert a PLINK file to a Zarr on-disk store.
A convenience for
read_plink()
followed bysgkit.save_dataset()
.Refer to
read_plink()
for details and limitations.- Parameters:
- path
str
|Path
|None
Union
[str
,Path
,None
] (default:None
) Path to PLINK file set. This should not include a suffix, i.e. if the files are at data.{bed,fam,bim} then only ‘data’ should be provided (suffixes are added internally). Either this path must be provided or all 3 of bed_path, bim_path and fam_path.
- bed_path
str
|Path
|None
Union
[str
,Path
,None
] (default:None
) Path to PLINK bed file. This should be a full path including the .bed extension and cannot be specified in conjunction with path.
- bim_path
str
|Path
|None
Union
[str
,Path
,None
] (default:None
) Path to PLINK bim file. This should be a full path including the .bim extension and cannot be specified in conjunction with path.
- fam_path
str
|Path
|None
Union
[str
,Path
,None
] (default:None
) Path to PLINK fam file. This should be a full path including the .fam extension and cannot be specified in conjunction with path.
- output
str
|Path
|MutableMapping
[str
,bytes
]Union
[str
,Path
,MutableMapping
[str
,bytes
]] Zarr store or path to directory in file system.
- chunks
str
|int
|tuple
Union
[str
,int
,tuple
] (default:'auto'
) Chunk size for genotype (i.e. .bed) data, by default “auto”
- fam_sep
str
(default:' '
) Delimiter for .fam file, by default “ “
- bim_sep
str
(default:'\\t'
) Delimiter for .bim file, by default “ “
- bim_int_contig
bool
(default:False
) Whether or not the contig/chromosome name in the .bim file should be interpreted as an integer, by default False. If False, then the variant/contig field in the resulting dataset will contain the indexes of corresponding strings encountered in the first .bim field.
- lock
bool
(default:False
) Whether or not to synchronize concurrent reads of .bed file blocks, by default False. This is passed through to [dask.array.from_array](https://docs.dask.org/en/latest/array-api.html#dask.array.from_array).
- persist
bool
(default:True
) Whether or not to persist .fam and .bim information in memory, by default True. This is an important performance consideration as the plain text files for this data will be read multiple times when False. This can lead to load times that are upwards of 10x slower.
- storage_options {
str
:str
} |None
Optional
[Dict
[str
,str
]] (default:None
) Any additional parameters for the storage backend (see
fsspec.open
).
- path
- Return type: