Methods are described for predicting ancestral sequences for viruses or portions thereof. Also described are predicted ancestral sequences for adeno-associated virus (AAV) capsid polypeptides. The disclosure also provides methods of gene transfer and methods of vaccinating subjects by administering a target antigen operably linked to the AAV capsid polypeptides.