collection
ensembl.io.genomio.seq_region.collection
¶
SeqCollection as a collection of seq_regions metadata.
SeqRegionDict = dict[str, Any]
module-attribute
¶
SeqCollection
¶
Represent a collection of seq_regions metadata.
Source code in src/python/ensembl/io/genomio/seq_region/collection.py
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 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 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
mock = mock
instance-attribute
¶
seqs = {}
instance-attribute
¶
add_mitochondrial_codon_table(taxon_id)
¶
Adds the mitochondrial codon table to each sequence region (when missing) based on the taxon ID.
If no mitochondrial genetic code can be found for the given taxon ID nothing will be changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
taxon_id
|
int
|
The species taxon ID. |
required |
Source code in src/python/ensembl/io/genomio/seq_region/collection.py
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
|
add_translation_table(location_codon=LOCATION_CODON)
¶
Adds the translation codon table to each sequence region (when missing) based on its location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
location_codon
|
Mapping[str, int]
|
Map of known codon tables for known locations. |
LOCATION_CODON
|
Source code in src/python/ensembl/io/genomio/seq_region/collection.py
187 188 189 190 191 192 193 194 195 196 197 198 |
|
from_gbff(gbff_path)
¶
Store seq_regions extracted from a GBFF file.
If a seq_region with the same ID exists in the collection, it will be replaced.
Source code in src/python/ensembl/io/genomio/seq_region/collection.py
48 49 50 51 52 53 54 55 56 57 58 59 |
|
from_report(report_path, is_refseq=False)
¶
Store seq_regions extracted from an INSDC assembly report file.
If a seq_region with the same id exists in the collection, it will be replaced.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
report_path
|
Path
|
Path to the sequence regions report file. |
required |
is_refseq
|
bool
|
True if the source of the report is RefSeq, false if INSDC. |
False
|
Source code in src/python/ensembl/io/genomio/seq_region/collection.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
make_seq_region_from_report(seq_data, is_refseq, synonym_map=SYNONYM_MAP, molecule_location=MOLECULE_LOCATION)
staticmethod
¶
Returns a sequence region from the information provided.
An empty sequence region will be returned if no accession information is found.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Dict from the report representing one line, where the key is the column name. |
required | |
is_refseq
|
bool
|
True if the source is RefSeq, false if INSDC. |
required |
synonym_map
|
Mapping[str, str]
|
Map of INSDC report column names to sequence region field names. |
SYNONYM_MAP
|
molecule_location
|
Mapping[str, str]
|
Map of sequence type to SO location. |
MOLECULE_LOCATION
|
Raises:
Type | Description |
---|---|
UnknownMetadata
|
If the sequence role or location is not recognised. |
Source code in src/python/ensembl/io/genomio/seq_region/collection.py
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 |
|
make_seqregion_from_gbff(record_data)
staticmethod
¶
Returns a seq_region dict extracted from a GBFF record.
Source code in src/python/ensembl/io/genomio/seq_region/collection.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|
remove(to_exclude)
¶
Remove seq_regions based on a provided list of accessions.
Source code in src/python/ensembl/io/genomio/seq_region/collection.py
179 180 181 182 183 184 185 |
|
to_list()
¶
Returns the sequences as a simple list of SeqRegionDict
objects.
Source code in src/python/ensembl/io/genomio/seq_region/collection.py
232 233 234 |
|