Identification of polymorphic inversions from genotypes