Record

class moclo.record.CircularRecord(SeqRecord)[source]

A derived SeqRecord that contains a circular DNA sequence.

It handles the in operator as expected, and removes the implementation of the + operator since circular DNA sequence do not have an end to append more nucleotides to. In addition, it overloads the >> and << operators to allow rotating the sequence and its annotations, effectively changing the 0 position.

See also

Bio.SeqRecord.SeqRecord documentation on the Biopython wiki.

__add__(other)[source]

Add another sequence or string to this sequence.

Since adding an arbitrary sequence to a plasmid is ambiguous (there is no sequence end), trying to add a sequence to a CircularRecord will raise a TypeError.

__contains__(char)[source]

Implement the in keyword, searches the sequence.

__getitem__(index)[source]

Return a sub-sequence or an individual letter.

The sub-sequence is always returned as a SeqRecord, since it is probably not circular anymore.

__init__(seq, id='<unknown id>', name='<unknown name>', description='<unknown description>', dbxrefs=None, features=None, annotations=None, letter_annotations=None)[source]

Create a new CircularRecord instance.

If given a SeqRecord as the first argument, it will simply copy all attributes of the record. This allows using Bio.SeqIO.read to open records, then loading them into a CircularRecord.

__lshift__(index)[source]

Rotate the sequence counter-clockwise, preserving annotations.

__radd__(other)[source]

Add another sequence or string to this sequence (from the left).

Since adding an arbitrary sequence to a plasmid is ambiguous (there is no sequence end), trying to add a sequence to a CircularRecord will raise a TypeError.

__rshift__(index)[source]

Rotate the sequence clockwise, preserving annotations.

reverse_complement(id=False, name=False, description=False, features=True, annotations=False, letter_annotations=True, dbxrefs=False)[source]

Return a new CircularRecord with reverse complement sequence.