Writing unique genes to files