AString.py - strings as arrays of characters¶
This module provides the AString
class to efficiently
represent long, chromosomal nucleotide sequences in memory.
Reference¶
-
class
AString.
AString
(*args)¶ Bases:
array.array
implementation of a string as an array.
This class conserves memory as it uses only 1 byte per letter, while python strings use the machine word size for a letter.
It adds a subset of the python string class such as upper() and lower() for convenience. Slicing and printing return strings.
The
AString
can be constructed by any iterable that is accepted by the constructor ofarray.array
.-
upper
()¶ return upper case version.
-
lower
()¶ return lower case version.
-