in reply to Create matrix and save to a file

Not sure if these are what you're looking for, but a few of the Bio:: namespace modules looked good. Link: Matrix.

meh.