RiboKit : Primerize

PCR Assembly Primer Design

primerize.util_class Module

class primerize.util_class.Assembly(sequence, primers, name, COL_SIZE=142)

Bases: object

Collection of result data essential for drawing an assembly scheme.

Parameters:
  • sequence -- str: Sequence of assembly design.
  • primers -- list(list(int): Numeric representation (end numbering and direction) of primers.
  • name -- str: Construct prefix/name.
  • COL_SIZE -- int: (Optional) Column width for assembly output. Positive number only.
sequence

str: Sequence of assembly design.

primers

list(list(int)): Numeric representation (end numbering and direction) of primers.

name

str: Construct prefix/name.

bp_lines

list(str): Strings for base-pairing lines ('|').

seq_lines

list(str): Strings for primer sequence lines.

print_lines

list(tuple(str, str)): Strings for all lines assembled, i.e. list(tuple('marker', 'print_line')).

Tm_overlaps

list(float): List of melting temperature for all overlapping regions.

__repr__()

Representation of the Assembly class.

__str__()

Results of the Assembly class. Calls echo().

echo()

Print result in rich-text.

Returns:str
save(path='./', name=None)

Save result to text file.

Parameters:
  • path -- str: (Optional) Path for file saving. Use either relative or absolute path.
  • name -- str: (Optional) Prefix/name for file name. When nonspecified, current object's name is used.
class primerize.util_class.Construct_List

Bases: object

Collection of mutant constructs. An empty isntance of primerize.Mutation is always initiated as the first element, i.e. a Wild-type well as the first of list.

_data

Data of constructs, in format of list(primerize.Mutation).

__contains__(mut_list)

Test if a list of given mutant construct is present.

Parameters:mut_list -- primerize.Mutation: A mutant represented by primerize.Mutation.
Returns:bool
__iter__()

Iterator through all constructs.

__len__()

Number of filled wells.

Returns:int
__repr__()

Representation of the Construct_List class.

__str__()

Results of the Construct_List class. Calls echo().

echo(prefix='')

Print result in rich-text.

Returns:str
list()

Return a list of all constructs.

Returns:list(list(str))
merge(other)

Merge 2 lists of constructs.

Parameters:other -- primerize.Construct_List: Another list of constructs.
Returns:primerize.Construct_List -- A list of duplicated constructs between inputs.
Raises:TypeError -- For illegal other.
pop(mut_list)

Remove a list of mutations.

Parameters:mut_list -- primerize.Mutation: A mutant represented by primerize.Mutation. Mutant that is not present will result in a premature return with False.
Returns:bool -- Whether mut_list is successfully removed.
push(mut_list)

Add a list of mutations.

Parameters:mut_list -- primerize.Mutation: Mutations. A mutant represented by primerize.Mutation. If the mutant is already present, it will return False.
Returns:bool -- Whether mut_list is successfully added.
class primerize.util_class.Mutation(mut_str=[])

Bases: object

Collection of mutations for a construct.

Parameters:mut_list -- list(str): (Optional) List of mutations. When nonspecified, an empty instance is created; when specified, it calls push(). An empty instance means no mutations, i.e. Wild-type.
_data

Data of mutations, in format of dict: { int: tuple(str, str) }, i.e. dict: {'seqpos': ('wt_char', 'mut_char') }.

__contains__(mut_str)

Test if a list of given mutation is present.

Parameters:mut_list -- list(str): Mutations in format of 'wt_char', 'seq_pos', 'mut_char', (e.g. ['G13C', 'A15T']).
Returns:bool
__eq__(other)

Comparison method for whether two Mutation objects contain the same set of mutations.

__iter__()

Iterator through all mutations.

__len__()

Number of filled wells.

Returns:int
__repr__()

Representation of the Mutation class.

__str__()

Results of the Mutation class. Calls echo().

echo()

Print result in rich-text, delimited by ';'.

Returns:str
list()

Return a list of all mutations.

Returns:list(str)
merge(other)

Merge 2 lists of mutations.

Parameters:other -- primerize.Mutation: Another list of mutations.
Raises:TypeError -- For illegal other.
pop(mut_str)

Remove a list of mutations.

Parameters:mut_list -- list(str): Mutations. Valid keywords are the same as has(). Mutations that are not present will result in a premature return with False.
Returns:bool -- Whether all mutations in mut_list are successfully removed.
push(mut_str)

Add a list of mutations.

Parameters:mut_list -- list(str): Mutations. Valid keywords are the same as has(). Each 'seq_pos' can only be mutated once. Conflicting mutations are overwritten and the most recent one is saved. 'WT' is ignored.
Raises:ValueError -- For illegal mut_str.
class primerize.util_class.Plate_96Well(tag=1)

Bases: object

Abstraction of 96-well plates.

Parameters:tag -- int: (Optional) Mutation library tag. Use which_lib number.
coords

set(str): Filled 96-Well Coordinates.

_data

Data of primers and names, in format of dict: { str: tuple(primerize.Mutation, str) }, i.e. dict: {'coord': ('tag', 'primer') }.

__contains__(coord)

Test if data of a given WellPosition is present.

Parameters:coord -- str: WellPosition (e.g. 'A01') for data.
Returns:bool
__len__()

Number of filled wells.

Returns:int
__repr__()

Representation of the Plate_96Well class.

__str__()

Results of the Plate_96Well class. Calls echo().

echo(ref_primer='')

Print result in rich-text.

Parameters:ref_primer -- list(str): (Optional) List of Wild-type primer_set for highlighting. If nonspecified, highlighting is disabled.
Returns:str
get(coord)

Get data of a particular well or number of wells filled.

Parameters:

coord -- str: Keyword of parameter. Use WellPosition for well data.

Returns:

value of specified coord.

Raises:
  • AttributeError -- For illegal WellPosition (out of range(0, 96) + 1).
  • KeyError -- For nonexisted coord.
reset()

Clear current plate data.

save(ref_primer='', file_name='./plate.svg', title='')

Save plate layout to image file (SVG).

Parameters:
  • ref_primer -- list(str): (Optional) List of Wild-type primer_set for highlighting. If nonspecified, highlighting is disabled.
  • file_name -- str: (Optional) File name. Include path into file_name when specifying. Use either relative or absolute path.
  • title -- str: (Optional) Title to display on image. LaTex NOT supported.
set(coord, tag, primer)

Record data of a particular well.

Parameters:
  • coord -- str: WellPosition for data. Use same range as get(). Existing data for the same well is overwritten.
  • tag -- primerize.Mutation: Mutant representd by primerize.Mutation. str is only supported for backward compatibility.
  • primer -- str: Primer seuqence of well. Use sense-strand.
Raises:

AttributeError -- For illegal WellPosition.

Built with Sphinx using a RiboKit Theme . Hosted on GitHub Pages.

© Copyright 2008-2017 The Board of Trustees of the Leland Stanford Junior University. All Rights Reserved.

Last updated on Jun 22, 2017.