backend package

Submodules

backend.cif_file module

Cif file wriing backend for fapswitch.

class backend.cif_file.CifFileBackend[source]

Bases: object

Abstraction for writing cif files in a pluggable manner.

add_freeform_structure(base_structure, functions, cif_file)[source]

Write a cif file with an md5 fixed-length name based on the functionalisation.

add_symmetry_structure(base_structure, functions, cif_file)[source]

Write out the cif file with a name derived from the base structure and the functionalisations.

backend.sql module

Sqlite backend to save generated structures in a database.

class backend.sql.AlchemyBackend(db_name)[source]

Bases: object

Abstraction for fapswitch+sql interface.

add_freeform_structure(base_structure, functions, cif_file)[source]

Insert a structure with freeform functionalisation into the database. Will try to associate all the different functional groups contained.

add_symmetry_structure(base_structure, functions, cif_file)[source]

Insert a structure with symmetry based functionalisation into the database. Will try not to duplicate the “group@site” association designations.

populate_groups(groups)[source]

Initialise or update the available groups table from the library.

start_cif(structure_type, structure_id)[source]

Return the cif file for the given structure and mark it as started in the database.

store_results(structure_type, structure_id, structure)[source]

Save the uptake data in an appropriate table. Will create tables if they do not exist.

class backend.sql.FreeFunctionalisedStructure(base_structure, name, cif_file)[source]

Bases: sqlalchemy.ext.declarative.api.Base

SQLAlchemy model for structures that have freeform functionalisation over all the sites of the base structure. Each .base_structure .name (or .fullname) should be the same structure but rotations may change each generation.

base_structure
cif_file
functional_groups
id
name
status
unique_name

Return the unique composite name

class backend.sql.FunctionalGroup(id, name)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Essentially the names and identifiers of available groups

functionalisations
id
name
class backend.sql.Functionalisation(functional_group_id, site)[source]

Bases: sqlalchemy.ext.declarative.api.Base

Pairs of functional groups and attachment sites. Note that sites with the same name will have no relationship between structures.

functional_group_id
id
site
class backend.sql.SymFunctionalisedStructure(base_structure, name, cif_file)[source]

Bases: sqlalchemy.ext.declarative.api.Base

SQLAlchemy model for structures that have been derived with the symmetry of the base structure. Each .base_structure .name (or .fullname) should be the same structure.

base_structure
cif_file
fullname

Return the unique composite name

functionalisations
id
name
status

Module contents