aldehyde dehydrogenase [NAD(P)+] activity [GO_0004030] - Virtual Fly Brain