Inferring the palaeoenvironment of ancient bacteria on the basis of resurrected proteins