Bakta
annotate_aa(aas)
Combines IPS and PSC annotations and marks hypotheticals.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aas |
Sequence[dict]
|
A sequence of amino acid dictionaries to annotate. |
required |
Returns:
| Type | Description |
|---|---|
|
None |
Examples:
>>> aas = [{'sequence': 'ATG', 'start': 1, 'stop': 3, 'strand': '+'}]
>>> annotate_aa(aas)
>>> aas
[{'sequence': 'ATG', 'start': 1, 'stop': 3, 'strand': '+'}]
Source code in src/baktfold/bakta/annotation.py
calc_annotation_score(orf)
Calculates the annotation score for a given ORF.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
orf |
dict
|
The ORF to calculate the annotation score for. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The annotation score for the given ORF. |
Examples:
Source code in src/baktfold/bakta/annotation.py
combine_annotation(feature, fast)
Combines annotation information from different sources into a single feature.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature |
dict
|
The feature to combine annotation for. |
required |
fast |
bool
|
If True, skips AFDB |
required |
Returns:
| Type | Description |
|---|---|
|
None |
Examples:
Source code in src/baktfold/bakta/annotation.py
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 | |
extract_protein_gene_symbol(product)
Extracts a valid gene symbol from a protein name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
product |
str
|
The protein name to extract a gene symbol from. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The extracted gene symbol. |
Examples:
Source code in src/baktfold/bakta/annotation.py
mark_as_baktfold(feature)
Adds the baktfold key to the given feature dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature |
dict
|
The feature dictionary to add the baktfold key to. |
required |
Returns:
| Type | Description |
|---|---|
|
None |
Examples:
>>> feature = {'sequence': 'ATG', 'start': 1, 'stop': 3, 'strand': '+'}
>>> mark_as_baktfold(feature)
>>> feature
{'sequence': 'ATG', 'start': 1, 'stop': 3, 'strand': '+', 'baktfold': True}
Source code in src/baktfold/bakta/annotation.py
mark_as_hypothetical(feature)
Marks a feature as hypothetical.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature |
dict
|
The feature to mark as hypothetical. |
required |
Returns:
| Type | Description |
|---|---|
|
None |
Examples:
Source code in src/baktfold/bakta/annotation.py
revise_cds_gene_symbols(raw_genes)
Revises a list of gene symbols to ensure they are valid.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_genes |
Sequence[str]
|
The list of gene symbols to revise. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
list |
The revised list of gene symbols. |
Examples:
Source code in src/baktfold/bakta/annotation.py
revise_cds_product(product)
Revise product name for INSDC compliant submissions
Source code in src/baktfold/bakta/annotation.py
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | |
unmark_as_hypothetical(feature)
Removes the hypothetical key from the given feature dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature |
dict
|
The feature dictionary to remove the hypothetical key from. |
required |
Returns:
| Type | Description |
|---|---|
|
None |
Examples:
>>> feature = {'sequence': 'ATG', 'start': 1, 'stop': 3, 'strand': '+'}
>>> unmark_as_hypothetical(feature)
>>> feature
{'sequence': 'ATG', 'start': 1, 'stop': 3, 'strand': '+'}
Source code in src/baktfold/bakta/annotation.py
check_content_size(file_name, file_path)
Checks if a file is empty.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name |
str
|
The name of the file to check. |
required |
file_path |
Path
|
The path to the file to check. |
required |
Returns:
| Type | Description |
|---|---|
|
None. |
Examples:
Source code in src/baktfold/bakta/config.py
check_db_path(args)
Checks the path to the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args |
Namespace
|
The arguments passed to the program. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Path |
Path
|
The path to the database. |
Examples:
Source code in src/baktfold/bakta/config.py
check_output_path(output, force_override)
Check provided output path
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output |
string
|
The output directory destination path |
required |
force_override |
Bool
|
Whether to override existing output directories |
required |
Source code in src/baktfold/bakta/config.py
check_readability(file_name, file_Path)
Checks if a file is readable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name |
str
|
The name of the file to check. |
required |
file_Path |
Path
|
The path to the file to check. |
required |
Returns:
| Type | Description |
|---|---|
|
None. |
Examples:
Source code in src/baktfold/bakta/config.py
check_threads(args)
Checks the number of threads to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args |
Namespace
|
The arguments passed to the program. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The number of threads to use. |
Examples:
Source code in src/baktfold/bakta/config.py
check_tmp_path(args)
Checks the path to the temporary directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args |
Namespace
|
The arguments passed to the program. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Path |
Path
|
The path to the temporary directory. |
Examples:
Source code in src/baktfold/bakta/config.py
check_user_proteins(args)
Checks the path to the user proteins file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args |
Namespace
|
The arguments passed to the program. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Path |
The path to the user proteins file. |
Examples:
Source code in src/baktfold/bakta/config.py
setup(args)
Test environment and build a runtime configuration.
Source code in src/baktfold/bakta/config.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 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 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 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | |
fetch_db_pscc_result(conn, uniref50_id)
Fetches the PSCC result for a given uniref50_id from a sqlite3 database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn |
sqlite3.Connection
|
The connection to the sqlite3 database. |
required |
uniref50_id |
str
|
The uniref50_id to fetch the PSCC result for. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
The PSCC result for the given uniref50_id. |
Source code in src/baktfold/bakta/pstc.py
fetch_sql_description(conn, source, accession)
Fetches the product description for a given source and accession from a sqlite3 database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conn |
sqlite3.Connection
|
The connection to the sqlite3 database. |
required |
source |
str
|
The source of the accession. |
required |
accession |
str
|
The accession to fetch the description for. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
The product description for the given source and accession. |
Source code in src/baktfold/bakta/pstc.py
fetch_sql_description_threadsafe(db_path, source, accession)
makes new connection every time so don't have 2 CATH accessions colliding (for multi domain proteins)
Source code in src/baktfold/bakta/pstc.py
lookup_custom(features, baktfold_db, custom_annotations)
Lookup PSTC information from custom db
Source code in src/baktfold/bakta/pstc.py
lookup_sql(features, baktfold_db, threads)
Lookup PSTC information
Source code in src/baktfold/bakta/pstc.py
parse(features, foldseek_df, db_name='swissprot', has_duplicate_locus=False)
Update CDS in place with PSTC hits from foldseek_df if they pass filters.
has_duplicate_locus - some euks have multiple CDS per locus tag