Scientists have identified genes and lifestyles that make children more vulnerable to food allergies and asthma.