def map_samples_to_indices(c):
    """Return a dict mapping samples names (key)
       to sample indices in the numpy genotype arrays (value).
    """
    c.execute("select sample_id, name from samples")
    return {row['name']: row['sample_id'] - 1 for row in c}