Dump both AoA's into a database (each in its own table) and do a SELECT on both tables joined by the keyfield of gene_name
. Somehow you will have to persist the AoA's or are you going to input them each time by hand again (or perhaps read them from a flat file)? What better way then than to put them in database from the start?
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law