Colocalisation
gentropy.dataset.colocalisation.Colocalisation
dataclass
¶
Bases: Dataset
Colocalisation results for pairs of overlapping study-locus.
Source code in src/gentropy/dataset/colocalisation.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
append_study_metadata(study_locus: StudyLocus, study_index: StudyIndex, *, metadata_cols: list[str], colocalisation_side: str = 'right') -> DataFrame
¶
Appends metadata from the study to the requested side of the colocalisation dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
study_locus
|
StudyLocus
|
Dataset containing study loci that links the colocalisation dataset and the study index via the studyId |
required |
study_index
|
StudyIndex
|
Dataset containing study index that contains the metadata |
required |
metadata_cols
|
list[str]
|
List of study columns to append |
required |
colocalisation_side
|
str
|
Which side of the colocalisation dataset to append metadata to. Must be either 'right' or 'left' |
'right'
|
Returns:
| Name | Type | Description |
|---|---|---|
DataFrame |
DataFrame
|
Colocalisation dataset with appended metadata of the study from the requested side |
Raises:
| Type | Description |
|---|---|
ValueError
|
if colocalisation_side is not 'right' or 'left' |
Source code in src/gentropy/dataset/colocalisation.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | |
drop_trans_effects(study_locus: StudyLocus) -> Colocalisation
¶
Filters the colocalisation dataset to only include cis effects from QTLs (right study locus).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
study_locus
|
StudyLocus
|
Dataset containing study loci that has metadata about the type of credible set |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Colocalisation |
Colocalisation
|
Colocalisation dataset filtered to only include cis effects from QTLs (right study locus) |
Source code in src/gentropy/dataset/colocalisation.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
get_schema() -> StructType
classmethod
¶
Provides the schema for the Colocalisation dataset.
Returns:
| Name | Type | Description |
|---|---|---|
StructType |
StructType
|
Schema for the Colocalisation dataset |
Source code in src/gentropy/dataset/colocalisation.py
26 27 28 29 30 31 32 33 | |
Schema¶
root
|-- leftStudyLocusId: string (nullable = false)
|-- rightStudyLocusId: string (nullable = false)
|-- rightStudyType: string (nullable = false)
|-- chromosome: string (nullable = false)
|-- colocalisationMethod: string (nullable = false)
|-- numberColocalisingVariants: long (nullable = false)
|-- h0: double (nullable = true)
|-- h1: double (nullable = true)
|-- h2: double (nullable = true)
|-- h3: double (nullable = true)
|-- h4: double (nullable = true)
|-- clpp: double (nullable = true)
|-- betaRatioSignAverage: double (nullable = true)