cellink.resources.liftover_gwas_summary_stats#
- cellink.resources.liftover_gwas_summary_stats(df, source_build, target_build, chrom_col='chromosome', pos_col='base_pair_location', drop_failed=True)#
Translate SNP positions in a GWAS summary-statistics DataFrame between genome builds.
- Parameters:
df (pd.DataFrame) – GWAS summary statistics DataFrame containing at least
chrom_colandpos_col.source_build (str) – Genome build of the input positions. Accepts ‘GRCh38’/’hg38’ or ‘GRCh37’/’hg19’.
target_build (str) – Genome build to translate positions to.
chrom_col (str, default='chromosome') – Name of the chromosome column.
pos_col (str, default='base_pair_location') – Name of the position column.
drop_failed (bool, default=True) – If True, rows whose positions could not be lifted over are dropped. If False, failed positions are set to
pd.NA.
- Return type:
DataFrame- Returns:
pd.DataFrame Copy of
dfwithpos_colreplaced by translated positions.- Raises:
ImportError – If the
liftoverpackage is not installed.