DNA Cauldron Reference manual

Public classes for library users

SequenceRepository

class dnacauldron.SequenceRepository(collections=None, name='repo')[source]

Sequence repositories store and provide sequence records.

The records are organized into collections, for instance “parts” to host parts, “constructs” for records created during assembly plan simulation, or any other collection name like “emma_connectors” to store EMMA connectors.

The suggested initialization of a sequence repository is:

>>> repository = SequenceRepository()
>>> repository.import_records(files=['part.fa', 'records.zip', etc.])
Parameters

collections

A dict {‘collection_name’: {‘record_id’: record, …}, …} giving for each collection a dict of Biopython records.

name

The name of the repository as it may appear in error messages and other reports.

add_record(record, collection='parts')[source]

Add one record to a collection, using its record.id as key.

The collection is created if it doesn’t exist.

The record can also be a pair (id, “ATGTGCC…”).

add_records(records, collection='parts')[source]

Add

contains_record(record_id)[source]

Return whether the repo has a record corresponding to the given id

get_part_names_by_collection(format='dict')[source]

Return a dictionnary or a string representing the repo’s content.

Format: “dict” or “string”

get_record(record_id)[source]

Return the record from the repository from its ID.

get_records(record_ids)[source]

Get a list of records from a list of record IDs.

import_records(files=None, folder=None, collection='parts', use_file_names_as_ids=True, topology='default_to_linear')[source]

Import records into the repository, from files and zips and folders.

Parameters

files

A list of file paths, either Genbank, Fasta, Snapgene (.dna), or zips containing any of these formats.

folder

Path to a folder which can be provided instead of files.

collection

Name of the collection under which to import the new records.

use_file_names_as_ids

If True, the file name will be used as ID for any record obtained from a single-record file (fasta files with many records will still use the internal ID).

topology

Can be “circular”, “linear”, “default_to_circular” (will default to circular if annotations['topology'] is not already set) or “default_to_linear”.

Assembly Classes

class dnacauldron.BioBrickStandardAssembly(parts, name='unnamed_assembly', connectors_collection=None, expected_constructs=1, max_constructs=40, dependencies=None)[source]

Representation and simulation of the Biobrick 2-part assembly standard.

Parameters

parts

A list of parts names corresponding to records in a repository. There must be exactly 2 parts and they must be represented on a backbone (i.e. circular constructs), and the first part will be inserted in the backbone of the second part, upstream of the second part.

name

Name of the assembly as it will appear in reports.

max_constructs

None or a number of maximum assemblies to compute (avoids complete freeze for combinatorial assemblies with extremely many possibilities).

expected_constructs

Either a number or a string 'any_number'. If the number of constructs doesn’t match this value, the assembly will be considered invalid in reports and summaries

connectors_collection

Name of a collection in the repository from which to get candidates for connector autocompletion.

dependencies

(do not use). Metadata indicating which assemblies depend on this assembly, or are depended on by it.

simulate(sequence_repository, annotate_parts_homologies=True)[source]

Simulate the assembly, return an AssemblySimulation.