A likelihood-based method for whole-genome association testing of case-control and trio data