Skip to content

pics

gentropy.pics.PICSStep

PICS finemapping of LD-annotated StudyLocus.

Source code in src/gentropy/pics.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class PICSStep:
    """PICS finemapping of LD-annotated StudyLocus."""

    def __init__(
        self,
        session: Session,
        study_locus_ld_annotated_in: str,
        picsed_study_locus_out: str,
    ) -> None:
        """Run PICS on LD annotated study-locus.

        Args:
            session (Session): Session object.
            study_locus_ld_annotated_in (str): Input LD annotated study-locus path.
            picsed_study_locus_out (str): Output PICSed study-locus path.
        """
        # Extract
        study_locus_ld_annotated = StudyLocus.from_parquet(
            session, study_locus_ld_annotated_in
        )
        # PICS
        picsed_sl = (
            PICS.finemap(study_locus_ld_annotated)
            .annotate_credible_sets()
            .filter_credible_set(credible_interval=CredibleInterval.IS99)
        )
        # Write
        picsed_sl.df.write.mode(session.write_mode).parquet(picsed_study_locus_out)

__init__(session: Session, study_locus_ld_annotated_in: str, picsed_study_locus_out: str) -> None

Run PICS on LD annotated study-locus.

Parameters:

Name Type Description Default
session Session

Session object.

required
study_locus_ld_annotated_in str

Input LD annotated study-locus path.

required
picsed_study_locus_out str

Output PICSed study-locus path.

required
Source code in src/gentropy/pics.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(
    self,
    session: Session,
    study_locus_ld_annotated_in: str,
    picsed_study_locus_out: str,
) -> None:
    """Run PICS on LD annotated study-locus.

    Args:
        session (Session): Session object.
        study_locus_ld_annotated_in (str): Input LD annotated study-locus path.
        picsed_study_locus_out (str): Output PICSed study-locus path.
    """
    # Extract
    study_locus_ld_annotated = StudyLocus.from_parquet(
        session, study_locus_ld_annotated_in
    )
    # PICS
    picsed_sl = (
        PICS.finemap(study_locus_ld_annotated)
        .annotate_credible_sets()
        .filter_credible_set(credible_interval=CredibleInterval.IS99)
    )
    # Write
    picsed_sl.df.write.mode(session.write_mode).parquet(picsed_study_locus_out)