wrapapi
api_database_factory
module-attribute
api_database_factory: Annotated[APIDatabaseFactory, 'Calling this factory method returns the single instance of the Database class located at the "source" keyword argument'] = APIDatabaseFactory()
Calling this factory method returns the single instance of the Database class located at the "source" keyword argument
APIDatabase
APIDatabase(sequences: AnyStr | Path = None, hhblits_profiles: AnyStr | Path = None, pdb: AnyStr | Path = None, uniprot: AnyStr | Path = None, **kwargs)
Bases: Database
A Database which stores general API queries
Parameters:
-
sequences
(AnyStr | Path
, default:None
) –The path the data stored for these particular queries
-
hhblits_profiles
(AnyStr | Path
, default:None
) –The path the data stored for these particular queries
-
pdb
(AnyStr | Path
, default:None
) –The path the data stored for these particular queries
-
uniprot
(AnyStr | Path
, default:None
) –The path the data stored for these particular queries
-
**kwargs
–
Source code in symdesign/resources/wrapapi.py
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 |
|
APIDatabaseFactory
APIDatabaseFactory(**kwargs)
Return a APIDatabase instance by calling the Factory instance with the APIDatabase source name
Handles creation and allotment to other processes by saving expensive memory load of multiple instances and allocating a shared pointer to the named APIDatabase
Source code in symdesign/resources/wrapapi.py
78 79 |
|
__call__
__call__(source: str = os.path.join(os.getcwd(), f'{putils.program_name}{putils.data.title()}'), sql: bool = False, **kwargs) -> APIDatabase
Return the specified APIDatabase object singleton
Parameters:
-
source
(str
, default:join(getcwd(), f'{program_name}{title()}')
) –The APIDatabase source path, or name if SQL database
-
sql
(bool
, default:False
) –Whether the APIDatabase is a SQL database
Returns: The instance of the specified Database
Source code in symdesign/resources/wrapapi.py
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 |
|
get
get(**kwargs) -> APIDatabase
Return the specified APIDatabase object singleton
Other Parameters:
-
source
–str = 'current_working_directory/Data' - The APIDatabase source path, or name if SQL database
-
sql
–bool = False - Whether the Database is a SQL database
Returns:
-
APIDatabase
–The instance of the specified Database
Source code in symdesign/resources/wrapapi.py
121 122 123 124 125 126 127 128 129 130 131 |
|
PDBDataStore
PDBDataStore(location: str = None, extension: str = '.json', sql=None, log: Logger = logger)
Bases: DataStore
Source code in symdesign/resources/wrapapi.py
208 209 |
|
entity_thermophilicity
entity_thermophilicity(name: str = None, **kwargs) -> float
Return the extent to which the EntityID in question is thermophilic
Parameters:
-
name
(str
, default:None
) –The EntityID
Returns: Value ranging from 0-1 where 1 is completely thermophilic
Source code in symdesign/resources/wrapapi.py
217 218 219 220 221 222 223 224 225 226 227 228 229 |
|
retrieve_entity_data
retrieve_entity_data(name: str = None, **kwargs) -> dict | None
Return data requested by PDB EntityID. If in the Database, load, otherwise, query the PDB API and store
Parameters:
-
name
(str
, default:None
) –The name of the data to be retrieved. Will be found with location and extension attributes
Returns: If data is available, the JSON object from PDB API will be returned, else None
Source code in symdesign/resources/wrapapi.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 |
|
retrieve_assembly_data
retrieve_assembly_data(name: str = None, **kwargs) -> dict | None
Return data requested by PDB AssemblyID. If in the Database, load, otherwise, query the PDB API and store
Parameters:
-
name
(str
, default:None
) –The name of the data to be retrieved. Will be found with location and extension attributes
Returns: If data is available, the JSON object from PDB API will be returned, else None
Source code in symdesign/resources/wrapapi.py
250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
|
retrieve_data
retrieve_data(entry: str = None, assembly_id: str = None, assembly_integer: int | str = None, entity_id: str = None, entity_integer: int | str = None, chain: str = None, **kwargs) -> dict | list[list[str]] | None
Return data requested by PDB identifier. Loads into the Database or queries the PDB API
Parameters:
-
entry
(str
, default:None
) –The 4 character PDB EntryID of interest
-
assembly_id
(str
, default:None
) –The AssemblyID to query with format (1ABC-1)
-
assembly_integer
(int | str
, default:None
) –The particular assembly integer to query. Must include entry as well
-
entity_id
(str
, default:None
) –The PDB formatted EntityID. Has the format EntryID_Integer (1ABC_1)
-
entity_integer
(int | str
, default:None
) –The entity integer from the EntryID of interest
-
chain
(str
, default:None
) –The polymer "chain" identifier otherwise known as the "asym_id" from the PDB EntryID of interest
Returns: If the data is available, the object requested will be returned, else None The possible return formats include: If entry {'entity': {'EntityID': {'chains': ['A', 'B', ...], 'dbref': {'accession': ('Q96DC8',), 'db': 'UniProt'}, 'reference_sequence': 'MSLEHHHHHH...', 'thermophilicity': 1.0}, ...} 'method': xray, 'res': resolution, 'struct': {'space': space_group, 'a_b_c': (a, b, c), 'ang_a_b_c': (ang_a, ang_b, ang_c)} } If entity_id OR entry AND entity_integer {'EntityID': {'chains': ['A', 'B', ...], 'dbref': {'accession': ('Q96DC8',), 'db': 'UniProt'}, 'reference_sequence': 'MSLEHHHHHH...', 'thermophilicity': 1.0}, ...} If assembly_id OR entry AND assembly_integer [['A', 'A', 'A', ...], ...]
Source code in symdesign/resources/wrapapi.py
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 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 |
|
UniProtDataStore
UniProtDataStore(location: str = None, extension: str = '.json', sql=None, log: Logger = logger)
Bases: DataStore
Source code in symdesign/resources/wrapapi.py
383 384 |
|
retrieve_data
retrieve_data(name: str = None, **kwargs) -> dict | None
Return data requested by UniProtID. Loads into the Database or queries the UniProt API
Parameters:
-
name
(str
, default:None
) –The name of the data to be retrieved. Will be found with location and extension attributes
Returns: If the data is available, the object requested will be returned, else None
Source code in symdesign/resources/wrapapi.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
|
thermophilicity
thermophilicity(uniprot_id: str) -> float
Query if a UniProtID is thermophilic
Parameters:
-
uniprot_id
(str
) –The formatted UniProtID which consists of either a 6 or 10 character code
Returns: 1 if the UniProtID of interest is a thermophilic organism according to taxonomic classification, else 0
Source code in symdesign/resources/wrapapi.py
405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 |
|
UniProtEntity
Bases: Base
id
class-attribute
instance-attribute
id = Column(String(uniprot_accession_length), primary_key=True, autoincrement=False)
The UniProtID
reference_sequence
property
reference_sequence: str
Get the sequence from the UniProtID