annotate_orf
Register a region as an OrfRegion so that downstream operations such as
mutagenize_orf, stylize_orf, and translate can look up the reading
frame automatically. If the region does not yet exist, extent= sets its
boundaries. Optionally apply codon-based styling at the same time via
style_codons= or style_frames=.
import poolparty as pp
pp.init()
Parameters
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
|
(required) |
The Pool to annotate. |
|
|
(required) |
Name for the ORF region. |
|
|
|
|
|
|
|
Reading frame (+1..+3 or -1..-3). Positive = 5’->3’, negative = 3’->5’. Determines which codon grid is used by downstream ORF operations. |
|
|
|
A single display style applied uniformly to the ORF region. Mutually
exclusive with |
|
|
|
List of style names cycled across whole codons within the ORF.
Mutually exclusive with |
|
|
|
List of style names (length a multiple of 3) applied per base
position within each codon. Mutually exclusive with |
|
|
|
Enumeration order when combined with other pools. |
|
|
|
Prefix for the operation node name in the pool graph. |
Note
Only the most commonly used parameters are shown above. For the full
parameter list, see annotate_orf() in the
API Reference.
Examples
Annotate a pre-tagged ORF
When the region already exists as XML tags in the sequence, just pass the
region name. annotate_orf registers it as an OrfRegion (with reading
frame) without changing the sequence.
wt = pp.from_seq("<gene>ATGAAATTTGGGCCC</gene>")
orf = pp.annotate_orf(wt, "gene")
orf.print_library()
Define region boundaries with extent
Use extent=(start, stop) to tag positions 4 through 19 (half-open) as the
ORF, without needing XML tags in the original sequence.
seq = pp.from_seq("TATAATGAAATTTGGGCCCTAA")
orf = pp.annotate_orf(seq, "gene", extent=(4, 19))
orf.print_library()
Style the ORF with codon colouring (style_codons)
Pass style_codons= to apply alternating codon colours at annotation time,
making the reading frame immediately visible.
seq = pp.from_seq("TATAATGAAATTTGGGCCCTAA")
styled = pp.annotate_orf(seq, "gene", extent=(4, 19),
style_codons=["blue", "red"])
styled.print_library()
Chain with mutagenize_orf
After annotating the ORF, mutagenize_orf can look up the frame
automatically. Here every single-codon missense variant is enumerated with
the mutated codon highlighted in red.
seq = pp.from_seq("TATAATGAAATTTGGGCCCTAA")
orf = pp.annotate_orf(seq, "gene", extent=(4, 19))
muts = pp.mutagenize_orf(orf, region="gene", num_mutations=1,
style="red", mode="sequential")
muts.print_library()
TATA<gene>CTGAAATTTGGGCCC</gene>TAA
TATA<gene>ATCAAATTTGGGCCC</gene>TAA
TATA<gene>GTGAAATTTGGGCCC</gene>TAA
TATA<gene>AGCAAATTTGGGCCC</gene>TAA ... (95 total)
See annotate_orf().