pandaspgs.file_operation

read_scoring_file

read_scoring_file(
    pgs_id: str = None, grch: str = "GRCh37"
) -> DataFrame

Download a scoring file and convert it to a DataFrame. The directory of the downloaded file is $HOME/pandaspgs_home.

Parameters:
  • pgs_id (str, default: None ) –

    Polygenic Score ID.

  • grch (str, default: 'GRCh37' ) –

    GRCh37 or GRCh38.

Returns:
  • DataFrame

    A DataFrame.

from pandaspgs import read_scoring_file

df = read_scoring_file(pgs_id='PGS000737')

write_csv

write_csv(
    path: str,
    o: AncestryCategory
    | Cohort
    | PerformanceMetric
    | Publication
    | Release
    | SampleSet
    | Score
    | Trait
    | TraitCategory,
) -> None

Create a directory and write the attributes of pandasPGS objects to the corresponding CSV files.

Parameters:
Returns:
  • None

    None

from pandaspgs import *
import os
home_path = os.path.expanduser('~') + os.sep + 'pandaspgs_home'
ancestry = get_ancestry_categories()
write_csv(home_path + os.sep + 'ancestry', ancestry)

write_xlsx

write_xlsx(
    path: str,
    o: AncestryCategory
    | Cohort
    | PerformanceMetric
    | Publication
    | Release
    | SampleSet
    | Score
    | Trait
    | TraitCategory,
) -> None

Create a directory and write the attributes of pandasPGS objects to the corresponding EXCEL files.

Parameters:
Returns:
  • None

    None

from pandaspgs import *
import os
home_path = os.path.expanduser('~') + os.sep + 'pandaspgs_home'
ancestry = get_ancestry_categories()
write_xlsx(home_path + os.sep + 'ancestry', ancestry)