deletion_scan
Slide a deletion window of fixed length across the sequence (or a named
region) and, at each position, remove those bases. By default deleted
positions are filled with - gap characters so all output sequences remain
alignment-compatible. Pass deletion_marker=None to produce shorter
sequences instead.
import poolparty as pp
pp.init()
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
The Pool to scan. Can also be a plain sequence string. |
|
|
(required) |
Width of the deletion window in bases. A sequence of length L
produces L - |
|
|
|
Character used to fill deleted positions. Pass |
|
|
|
Restrict the scan to a named region or |
|
|
|
Explicit list of window start positions. |
|
|
|
|
|
|
|
Number of output states. |
|
|
|
Named display style applied to the deletion marker. Only takes
effect when |
|
|
|
Enumeration order when combined with other pools. |
|
|
|
Prefix for auto-generated sequence names. |
Note
Only the most commonly used parameters are shown above. For the full
parameter list, see deletion_scan() in the
API Reference.
Examples
Single-base deletion with default marker
Delete one base at each of the 8 positions in an 8-mer; deleted positions
are marked with -.
wt = pp.from_seq("ACGTACGT")
dels = wt.deletion_scan(deletion_length=1, mode="sequential", style="grey")
dels.print_library()
A-GTACGT
AC-TACGT
ACG-ACGT
ACGT-CGT
ACGTA-GT
ACGTAC-T
ACGTACG-
True deletion (deletion_marker=None)
deletion_marker=None removes the bases entirely; output sequences are
shorter than the input.
wt = pp.from_seq("ACGTACGT")
dels = wt.deletion_scan(deletion_length=2, deletion_marker=None, mode="sequential")
dels.print_library()
ATACGT
ACACGT
ACGCGT
ACGTGT
ACGTAT
ACGTAC
2-base window deletion
Delete two consecutive bases at each position. An 8-mer yields 7 variants.
wt = pp.from_seq("ACGTACGT")
dels = wt.deletion_scan(deletion_length=2, mode="sequential", style="grey")
dels.print_library()
A--TACGT
AC--ACGT
ACG--CGT
ACGT--GT
ACGTA--T
ACGTAC--
Deletion scan within a named region
Restrict the scan to the cre region; the AAAA and TTTT flanks
are always returned unchanged.
wt = pp.from_seq("AAAA<cre>ATCGATCG</cre>TTTT")
dels = wt.deletion_scan(deletion_length=2, region="cre", mode="sequential",
style="grey")
dels.print_library()
AAAA<cre>A--GATCG</cre>TTTT
AAAA<cre>AT--ATCG</cre>TTTT
AAAA<cre>ATC--TCG</cre>TTTT
AAAA<cre>ATCG--CG</cre>TTTT
AAAA<cre>ATCGA--G</cre>TTTT
AAAA<cre>ATCGAT--</cre>TTTT
Scan only specific positions
Supply an explicit positions list to delete at chosen sites only.
wt = pp.from_seq("ACGTACGT")
dels = wt.deletion_scan(deletion_length=1, positions=[1, 3, 5], mode="sequential",
style="grey")
dels.print_library()
ACG-ACGT
ACGTA-GT
Random deletion positions (mode=”random”)
mode='random' draws deletion positions stochastically. Here a 3-base
deletion window samples 5 random positions along a 12-mer.
wt = pp.from_seq("ACGTACGTACGT")
dels = wt.deletion_scan(deletion_length=3, mode="random", num_states=5,
style="grey")
dels.print_library()
ACGTAC---CGT
ACGTA---ACGT
A---ACGTACGT
A---ACGTACGT
See deletion_scan().