Study Index
gentropy.dataset.study_index.StudyIndex
dataclass
¶
Bases: Dataset
Study index dataset.
A study index dataset captures all the metadata for all studies including GWAS and Molecular QTL.
Source code in src/gentropy/dataset/study_index.py
21 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 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
aggregate_and_map_ancestries(discovery_samples: Column) -> Column
classmethod
¶
Map ancestries to populations in the LD reference and calculate relative sample size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
discovery_samples |
Column
|
A list of struct column. Has an |
required |
Returns:
Name | Type | Description |
---|---|---|
Column |
Column
|
A list of struct with mapped LD population and their relative sample size. |
Source code in src/gentropy/dataset/study_index.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
get_schema() -> StructType
classmethod
¶
Provide the schema for the StudyIndex dataset.
Returns:
Name | Type | Description |
---|---|---|
StructType |
StructType
|
The schema of the StudyIndex dataset. |
Source code in src/gentropy/dataset/study_index.py
80 81 82 83 84 85 86 87 |
|
has_mapped_trait() -> Column
¶
Return a boolean column indicating if a study has mapped disease.
Returns:
Name | Type | Description |
---|---|---|
Column |
Column
|
True if the study has mapped disease. |
Source code in src/gentropy/dataset/study_index.py
159 160 161 162 163 164 165 |
|
has_summarystats() -> Column
¶
Return a boolean column indicating if a study has harmonized summary statistics.
Returns:
Name | Type | Description |
---|---|---|
Column |
Column
|
True if the study has harmonized summary statistics. |
Source code in src/gentropy/dataset/study_index.py
179 180 181 182 183 184 185 |
|
is_gwas() -> Column
¶
Return a boolean column with true values for GWAS studies.
Returns:
Name | Type | Description |
---|---|---|
Column |
Column
|
True if the study is a GWAS study. |
Source code in src/gentropy/dataset/study_index.py
151 152 153 154 155 156 157 |
|
is_qtl() -> Column
¶
Return a boolean column with true values for QTL studies.
Returns:
Name | Type | Description |
---|---|---|
Column |
Column
|
True if the study is a QTL study. |
Source code in src/gentropy/dataset/study_index.py
143 144 145 146 147 148 149 |
|
is_quality_flagged() -> Column
¶
Return a boolean column indicating if a study is flagged due to quality issues.
Returns:
Name | Type | Description |
---|---|---|
Column |
Column
|
True if the study is flagged. |
Source code in src/gentropy/dataset/study_index.py
167 168 169 170 171 172 173 174 175 176 177 |
|
study_type_lut() -> DataFrame
¶
Return a lookup table of study type.
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
A dataframe containing |
Source code in src/gentropy/dataset/study_index.py
135 136 137 138 139 140 141 |
|
Schema¶
root
|-- studyId: string (nullable = false)
|-- projectId: string (nullable = false)
|-- studyType: string (nullable = false)
|-- traitFromSource: string (nullable = true)
|-- traitFromSourceMappedIds: array (nullable = true)
| |-- element: string (containsNull = true)
|-- geneId: string (nullable = true)
|-- tissueFromSourceId: string (nullable = true)
|-- pubmedId: string (nullable = true)
|-- publicationTitle: string (nullable = true)
|-- publicationFirstAuthor: string (nullable = true)
|-- publicationDate: string (nullable = true)
|-- publicationJournal: string (nullable = true)
|-- backgroundTraitFromSourceMappedIds: array (nullable = true)
| |-- element: string (containsNull = true)
|-- initialSampleSize: string (nullable = true)
|-- nCases: integer (nullable = true)
|-- nControls: integer (nullable = true)
|-- nSamples: integer (nullable = true)
|-- cohorts: array (nullable = true)
| |-- element: string (containsNull = true)
|-- ldPopulationStructure: array (nullable = true)
| |-- element: struct (containsNull = false)
| | |-- ldPopulation: string (nullable = true)
| | |-- relativeSampleSize: double (nullable = true)
|-- discoverySamples: array (nullable = true)
| |-- element: struct (containsNull = false)
| | |-- sampleSize: integer (nullable = true)
| | |-- ancestry: string (nullable = true)
|-- replicationSamples: array (nullable = true)
| |-- element: struct (containsNull = false)
| | |-- sampleSize: integer (nullable = true)
| | |-- ancestry: string (nullable = true)
|-- qualityControls: array (nullable = true)
| |-- element: string (containsNull = true)
|-- analysisFlags: array (nullable = true)
| |-- element: string (containsNull = true)
|-- summarystatsLocation: string (nullable = true)
|-- hasSumstats: boolean (nullable = true)