Genedom - Reference manual

Domesticators

class genedom.PartDomesticator(name='unnamed domesticator', left_flank='', right_flank='', constraints=(), objectives=(), description=None, simultaneous_mutations=1, minimize_edits=True, logger=None)[source]

Generic domesticator.

Parameters:

name

Domesticator name as it will appear in reports etc.

description

Short domesticator description as it will appear in reports etc.

left_flank

String. Left addition to the sequence (homology arms, enzymes sites etc.)

right_flank

String. Right addition to the sequence (homology arms, enz. sites etc.)

constraints

Either Dnachisel constraints or functions (sequence => constraint) to be applied to the sequence for optimization

objectives

Either Dnachisel objectives or functions (sequence => objective) to be applied to the sequence for optimization.

simultaneous_mutations

Number of sequences mutations to be applied simulatenously during optimization. A larger number creates more noise but could allow to solve tougher problems.

minimize_edits

If true, the optimizer will attempt to minimize changes while making sure the constraints hold (each edit incurs a penalty of 1 in the total optimization score).

logger

A proglog logger or ‘bar’ or None for no logger at all.

Methods

class genedom.GoldenGateDomesticator(left_overhang, right_overhang, left_addition='', right_addition='', enzyme='BsmBI', extra_avoided_sites=(), description='Golden Gate domesticator', name='unnamed_domesticator', constraints=(), objectives=())[source]

Special domesticator class for Golden-Gate standards

Parameters:

left_overhang

4bp overhang to be added on the left

right_overhang

4bp overhang to be added on the right

left_addition

Extra sequence of DNA to be systematically added on the left of each part between the enzyme site and the rest of the sequence.

right_addition

Extra sequence to be systematically added on the right of each part between the enzyme site and the rest of the sequence.

enzyme

Enzyme used for the Golden Gate assembly. This enzyme will be added on the flanks of the sequence, and the internal sequence will be protected against sites from this enzyme during optimization.

extra_avoided_sites

Other enzymes from which the sequence should be protected during optimization in addition to the assembly enzyme.

description

Description of the domesticator as it will appear in reports.

name

Name of the domesticator as it will appear in reports

constraints

Either Dnachisel constraints or functions (sequence => constraint) to be applied to the sequence for optimization

objectives

Either Dnachisel objectives or functions (sequence => objective) to be applied to the sequence for optimization.

Methods

Standards

class genedom.StandardDomesticatorsSet(domesticators)[source]

Class to gather several domesticators defining an assembly standard.

Parameters:

domesticators

A dictionnary {name: domesticator} of PartDomesticators.

Methods

batch_domestication

genedom.batch_domestication(records, target, domesticator=None, standard=None, allow_edits=False, domesticated_suffix='', include_optimization_reports=True, include_original_records=True, barcodes=(), barcode_order='same_as_records', barcode_spacer='AA', logger='bar')[source]

Domesticate a batch of parts according to some domesticator/standard.

Parameters:

records

List of Bioython records to be domesticated

target

Path to a folder, to a zip file, or “@memory” for in-memory report generatio (the raw binary data of a zip archive is then returned)

domesticator

Either a single domesticator, to be used for all parts in the batch, or a function f(record) => appropriate_domesticator. Note that a “standard” can be provided instead

standard

A StandardDomesticatorsSet object which will be used to attribute a specific domesticator to each part. See BUILTIN_STANDARDS for examples.

allow_edits

If False, sequences cannot be edited by the domesticator, only extended with flanks. If a sequence has for instance forbidden restriction sites, the domesticaton will fail for this sequence (and this will be noted in the report.

domesticated_suffix

Suffix to give to the domesticated parts names to differentiate them from the original parts (this is optional).

include_optimization_reports

If yes, some genbanks and pdfs will be produced to show how each part was domesticated. This is in particular informative when a domestication fails and you want to understand why.

include_original_records

Will include the input records into the final report folder/archive, for traceability.

barcodes

Either a list [(barcode_name, barcode),…] or a dictionary {name: bc} or a BarcodesCollection instance. If any of this is provided, the final parts will have a barcode added on the left (this barcode will be “outside” the part and won’t appear in final constructs, but can be used to check that the part is the one you think if your samples get mixed up). Note that if there are less barcodes than parts, the barcodes will cycle and several parts may get the same barcode (which is generally fine).

barcode_order

Either “same_as_records”, or “by_size” if you want your barcodes to be attributed from the smallest to the longest part in the batch.

barcode_spacer

Sequence to appear between the barcode and the left flank of the domesticated part.

logger

Either “bar” or None for no logger or any Proglog ProgressBarLogger.

Examples

>>> from genedom import BUILTIN_STANDARDS, batch_domestication
>>> batch_domestication(some_records, standard=BUILTIN_STANDARDS.EMMA)

BarcodesCollection

class genedom.BarcodesCollection(barcodes)[source]

Class representing a set of named barcode sequences.

These barcodes are meant to be annealed with same-sequence primers for PCR or sequencing.

The constructor taked a list [(name, barcode), …] as an input.

Use BarcodesCollection.from_specs(n_barcodes=25) to generate an instance with 25 compatible barcodes.

Methods

Tools

These tools are either used by

genedom.load_record(filename, linear=True, name='unnamed', capitalize=True)[source]
genedom.load_records(path, capitalize=True)[source]
genedom.write_record(record, target, fmt='genbank')[source]

Write a record as genbank, fasta, etc. via Biopython, with fixes

genedom.random_dna_sequence(length, probas=None, seed=None)[source]

Return a random DNA sequence (“ATGGCGT…”) with the specified length.

Parameters:

length

Length of the DNA sequence.

proba

Frequencies for the different nucleotides, for instance probas={"A":0.2, "T":0.3, "G":0.3, "C":0.2}. If not specified, all nucleotides are equiprobable (p=0.25).

seed

The seed to feed to the random number generator. When a seed is provided the random results depend deterministically on the seed, thus enabling reproducibility