dump
ensembl.io.genomio.seq_region.dump
¶
Fetch all the sequence regions from a core database and print them in JSON format.
add_attribs(seq_region, seq_region_attrib)
¶
Map seq_regions attribs to a specific name and type defined below.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seq_region
|
dict
|
A seq_region dict to modify. |
required |
seq_region_attrib
|
dict
|
The attribs for this seq_region. |
required |
Source code in src/python/ensembl/io/genomio/seq_region/dump.py
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 |
|
fetch_coord_systems(session)
¶
Retrieve the coord_system metadata from the current core.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
Session
|
Session for the current core database. |
required |
Yields:
Type | Description |
---|---|
CoordSystem
|
All default coord_systems in the core database. |
Source code in src/python/ensembl/io/genomio/seq_region/dump.py
44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
fetch_seq_regions(session, coord_system)
¶
Retrieve the seq_region metadata for a given coord_system, with accessory tables cached.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
Session
|
Session for the current core database. |
required |
coord_system
|
CoordSystem
|
Coord_system to get seq regions. |
required |
Yields:
Type | Description |
---|---|
SeqRegion
|
All seq_regions for the coord_system. |
Source code in src/python/ensembl/io/genomio/seq_region/dump.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
get_added_sequence(seq_region)
¶
Extracts added sequence information of the given sequence region.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seq_region
|
SeqRegion
|
Sequence region. |
required |
Returns:
Type | Description |
---|---|
dict[str, str | dict[str, str]]
|
Accession as well as assembly and annotation provider information of the added sequence. |
Source code in src/python/ensembl/io/genomio/seq_region/dump.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
get_attribs_dict(seq_region)
¶
Returns a dict of attrib code-value for all the attributes of the given sequence region.
Source code in src/python/ensembl/io/genomio/seq_region/dump.py
83 84 85 |
|
get_karyotype(seq_region)
¶
Given a seq_region, extract the karyotype bands.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seq_region
|
SeqRegion
|
The seq_region from which the karyotype bands are extracted. |
required |
Returns:
Type | Description |
---|---|
list[dict[str, str]]
|
List of all karyotype bands as a dict with values 'start', 'end', 'name' 'stain', 'structure'. |
Source code in src/python/ensembl/io/genomio/seq_region/dump.py
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 |
|
get_seq_regions(session, external_db_map)
¶
Returns all the sequence regions from the current core database.
Include synonyms, attribs and karyotypes. Only the top level sequences are exported.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
session
|
Session
|
Session from the current core database. |
required |
external_db_map
|
dict
|
Mapping of external_db names for the synonyms. |
required |
Source code in src/python/ensembl/io/genomio/seq_region/dump.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
get_synonyms(seq_region, external_db_map)
¶
Get all synonyms for a given seq_region. Use the mapping for synonym source names.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seq_region
|
SeqRegion
|
Seq_region from which the synonyms are extracted. |
required |
external_db_map
|
dict[str, str]
|
To map the synonym source names. |
required |
Returns:
Type | Description |
---|---|
list[dict[str, str]]
|
List of all synonyms as a dict with 'name' and 'source' keys. |
Source code in src/python/ensembl/io/genomio/seq_region/dump.py
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 |
|
main()
¶
Main script entry-point.
Source code in src/python/ensembl/io/genomio/seq_region/dump.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
|