The GENESIS17,18 program is a Bioconductor package made available in R that was developed for large-scale genetic analyses in samples with complex structure including relatedness, population structure and ancestry admixture. The current version of GENESIS implements both linear and logistic mixed model regression for genome-wide association testing. The software can accommodate continuous and binary phenotypes. The GENESIS package includes the program PC-Relate, which uses a PCA-based method to infer genetic relatedness in samples with unspecified and unknown population structure. By using individual-specific allele frequencies estimated from the sample with PC eigenvectors, it provides robust estimates of kinship coefficients and identity-by-descent sharing probabilities in samples with population structure, admixture and Hardy-Weinberg equilibrium departures. It does not require additional reference population panels or prior specification of the number of ancestral subpopulations.