restructure
ensembl.io.genomio.gff3.restructure
¶
Restructure a gene model to a standard representation: gene -> [ mRNAs -> [CDSs, exons] ]
add_transcript_to_naked_gene(gene)
¶
Add an unspecific transcript to a gene without any sub features.
Source code in src/python/ensembl/io/genomio/gff3/restructure.py
70 71 72 73 74 75 76 77 78 79 |
|
move_cds_to_existing_mrna(gene)
¶
Move CDS child features of a gene to the mRNA.
This is to fix the case where we have the following structure:: gene -> [ mRNA, CDSs ]
and change it to:: gene -> [ mRNA -> [ CDSs ] ]
The mRNA itself might have exons, in which case check that they match the CDS coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gene
|
GFFSeqFeature
|
Gene feature to update. |
required |
Raises:
Type | Description |
---|---|
GFFParserError
|
If the feature structure is not recognized. |
Source code in src/python/ensembl/io/genomio/gff3/restructure.py
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 |
|
move_only_cdss_to_new_mrna(gene)
¶
Add intermediate mRNAs to a gene with only CDS children. Do nothing if some sub-features are not CDS.
Source code in src/python/ensembl/io/genomio/gff3/restructure.py
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 |
|
move_only_exons_to_new_mrna(gene)
¶
Add an mRNA for a gene that only has exons and move the exons under the mRNA. No change if the gene has other sub_features than exon.
Source code in src/python/ensembl/io/genomio/gff3/restructure.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
remove_cds_from_pseudogene(gene)
¶
Removes the CDSs from a pseudogene.
This assumes the CDSs are sub features of the transcript or the gene.
Source code in src/python/ensembl/io/genomio/gff3/restructure.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
|
remove_extra_exons(gene)
¶
Remove duplicated exons existing in both the gene and the mRNAs.
This is a special case where a gene contains proper mRNAs, etc. but also extra exons for the same features. Those exons usually have an ID starting with "id-", so that is what we use to detect them.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gene
|
GFFSeqFeature
|
Gene feature to update. |
required |
Raises:
Type | Description |
---|---|
GFFParserError
|
If not all exons of this gene start with "id-". |
Source code in src/python/ensembl/io/genomio/gff3/restructure.py
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 259 260 261 |
|
restructure_gene(gene)
¶
Standardize the structure of a gene model: - Add a transcript if there are no children - Move the CDS and exons to an mRNA if they are directly under the gene
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gene
|
GFFSeqFeature
|
Gene feature to restructure. |
required |
Raises:
Type | Description |
---|---|
GFFParserError
|
If there are CDSs/exons remaining under the gene after applying the fixes. |
Source code in src/python/ensembl/io/genomio/gff3/restructure.py
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 |
|