graphld.vcf_io¶
I/O functions for GWAS-VCF format summary statistics.
For broader loading workflows, see the I/O and Merging guide.
vcf_io
¶
validate_vcf_format_columns
¶
Validate and describe VCF FORMAT columns according to GWAS-VCF specification.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
columns
|
list
|
List of column names from VCF FORMAT |
required |
verbose
|
bool
|
If True, print detailed information about columns. Defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Dictionary of validated columns with their descriptions and requirements |
Source code in src/graphld/vcf_io.py
read_gwas_vcf
¶
read_gwas_vcf(file_path: str, num_rows: Optional[int] = None, maximum_missingness: float = 0.1, verbose: bool = False) -> pl.DataFrame
Reads a GWAS-VCF file using Polars and returns a DataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Path to the VCF file. |
required |
num_rows
|
Optional[int]
|
Number of rows to read. Defaults to None. |
None
|
maximum_missingness
|
float
|
Maximum fraction of missing samples allowed. Defaults to 0.1. |
0.1
|
verbose
|
bool
|
Print detailed information about FORMAT columns. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pl.DataFrame: DataFrame containing the VCF data. |