"Classes for reading in and storing sequences in FASTA format." from inheritance import FastaIterator # We will use the FastaSequence class to store our sequences from inheritance import FastaSequence as Sequence class FastaFile: """Read FASTA file and store list of sequences. Attribute "sequences" is the map of names to sequences.""" def __init__(self, filename): d = {} for seq in FastaIterator(filename): d[seq.description] = seq self.sequences = d if __name__ == "__main__": seqList = FastaFile("genes.fa").sequences print seqList print seqList[0].description