-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Anastasija Gricenko edited this page Aug 14, 2026
·
15 revisions
SangerTraces is the package that allows to visualize the contents of the ab1 files. It comes with 9 pre-made color schemes. The Hydrophobicity, HelixPropensity, StrandPropensity, TurnPropensity and BurriedIndex color schemes were reused from https://github.com/moshi4/pyMSAviz. pyMSAviz package.
pip install SangerTraces# import the package
from sangertraces import SangerTrace
# use the SangerTrace class to create the trace object
trace = SangerTrace("B_reverse.ab1", start = 10, end = 100, wrap_length = 80,
translate = ["FR1", "FR2", "FR3", "FR2_rev", "FR3_rev", "FR2_rev", "FR1_rev"],
color_scheme="BuriedIndex")
# call the plot_ab1_trace function to create PIL image figure
fig2 = trace.plot_ab1_trace()
# save the figure
fig2.save("Test1.png")- filename (str, required) — Path to the AB1 file to visualize.
- start (int, optional) — Start position for visualization (nucleotide number). Must be the positive integer. If invalid value is provided defaults to 1
- end (int, optional) — End position for visualization. Must be the positive integer. Defaults to full sequence length if invalid value is provided
- wrap_length (int, optional) — Number of bases to display per row. Defaults displaying the entire sequence on one row if not provided or invalid value is provided
- color_scheme (str, optional) — Color scheme for nucleotide traces and translated protein. Available options: 'Nazgul', 'Simple', 'ColorBlind', 'Geneious-like', 'Hydrophobicity', 'HelixPropensity', 'StrandPropensity', 'TurnPropensity', 'BuriedIndex'. Default value is ColorBlind
- translate (list or str, optional) — Translation frames for the sequence. If not provided no translation is shown. Accepts a list from 'FR1', 'FR2', 'FR3', 'FR1_rev', 'FR2_rev', 'FR3_rev'. Alternatively accepts the string 'forward' (shows all forward frames) or 'reverse' (shows all reverse frames).
- show_calls (bool, optional) — Whether to display base call letters below traces. Default is True, change to False to disable
- show_quality (bool, optional) — Whether to display Phred quality scores as bars. Default is True, change to False to disable