API Reference¶
Squiggle is built around a single function, documented fully below:
-
squiggle.
transform
(sequence, method='squiggle')¶ Transforms a DNA sequence into a series of coordinates for 2D visualization.
Parameters: Returns: A tuple containing two lists: one for the x coordinates and one for the y coodinates.
Return type: Example
>>> transform("ATGC") ([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0], [0, 0.5, 0, -0.5, -1, -0.5, 0, -0.5, 0]) >>> transform("ATGC", method="gates") ([0, 0, 0, 1, 0], [0, -1, 0, 0, 0]) >>> transform("ATGC", method="yau") ([0, 0.5, 1.0, 1.8660254037844386, 2.732050807568877], [0, -0.8660254037844386, 0.0, -0.5, 0.0]) >>> transform("ATGC", method="yau-bp") ([0, 1, 2, 3, 4], [0, -1, 0, -0.5, 0.0]) >>> transform("ATGC", method="randic") ([0, 1, 2, 3], [3, 2, 1, 0]) >>> transform("ATGC", method="qi") ([0, 1, 2], [8, 7, 11])
Warning
The entire sequence must be able to fit in memory.
Raises: ValueError
– When an invalid character is in the sequence.