def weighted_count(instances_obj, m_weights):
    """Weight nt count by nt weights at each position"""
    weighted_counts = {}
    for letter in instances_obj.alphabet:
        weighted_counts[letter] = [0] * instances_obj.length
    for idx, instance in enumerate(instances_obj):
        for position, letter in enumerate(instance):
            weighted_counts[letter][position] += m_weights[idx]
    return weighted_counts
