Sequence modifications utils

These methods are only useful to build examples and tests for Geneblocks.

geneblocks.sequence_modification_utils.change(seq, start, end, change)[source]

Return the sequence with seq[start:end] replaced by change

geneblocks.sequence_modification_utils.copy(seq, start, end, new_start)[source]

Return the sequence with segment [start, end] also copied elsewhere, starting in new_start.

geneblocks.sequence_modification_utils.delete(seq, pos, deletions)[source]

Return the sequence with a number of deletions from position pos.

geneblocks.sequence_modification_utils.insert(seq, pos, inserted)[source]

Return the sequence with inserted inserted, starting at index ‘pos’

geneblocks.sequence_modification_utils.move(seq, start, end, diff)[source]

Move a subsequence by “diff” nucleotides the left or the right.

geneblocks.sequence_modification_utils.reverse(seq, start, end)[source]

Return the sequence with segment seq[start:end] reverse-complemented.

geneblocks.sequence_modification_utils.swap(seq, pos1, pos2)[source]

Return a new sequence with segments at position pos1 and pos2 swapped.

pos1, pos2 are both of the form (start1, end1), (start2, end2)