Skip to content

pics

gentropy.pics.PICSStep

PICS finemapping of LD-annotated StudyLocus.

Source code in src/gentropy/pics.py
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
38
39
40
41
42
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
        (
            PICS.finemap(study_locus_ld_annotated)
            .filter_credible_set(credible_interval=CredibleInterval.IS99)
            # Flagging sub-significnat loci:
            .validate_lead_pvalue(
                pvalue_cutoff=WindowBasedClumpingStepConfig().gwas_significance
            )
            # Writing the output:
            .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
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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
    (
        PICS.finemap(study_locus_ld_annotated)
        .filter_credible_set(credible_interval=CredibleInterval.IS99)
        # Flagging sub-significnat loci:
        .validate_lead_pvalue(
            pvalue_cutoff=WindowBasedClumpingStepConfig().gwas_significance
        )
        # Writing the output:
        .df.write.mode(session.write_mode)
        .parquet(picsed_study_locus_out)
    )