- sushie.io.read_ld(path: str) Array[source]
Read in LD (linkage disequilibrium) matrix from a TSV file.
The LD matrix should be a symmetric correlation matrix where rows and columns represent SNPs. The file should be tab-separated with SNP IDs as column headers. Rows with infinite or NaN values are automatically removed.
- Parameters:
- Returns:
LD correlation matrix with SNP IDs as index and columns.
- Return type:
pd.DataFrame
Example
Read LD matrix for fine-mapping:
from sushie.io import read_ld # Read LD matrix ld = read_ld("path/to/ld_matrix.tsv") print(ld.shape) # Should be (n_snps, n_snps)Note
The LD matrix must be computed using the same reference alleles as the GWAS summary statistics for correct fine-mapping results.