def _check_samples_nodups ( fnames ) : counts = defaultdict ( int ) for f in fnames : for s in get_samples ( f ) : counts [ s ] += 1 duplicates = [ s for s , c in counts . items ( ) if c > 1 ] if duplicates : raise ValueError ( "Duplicate samples found in inputs %s: %s" % ( duplicates , fnames ) )
python identify duplicate observations
Ensure a set of input VCFs do not have duplicate samples .
def _check_samples_nodups(fnames):
    """Ensure a set of input VCFs do not have duplicate samples.
    """
    counts = defaultdict(int)
    for f in fnames:
        for s in get_samples(f):
            counts[s] += 1
    duplicates = [s for s, c in counts.items() if c > 1]
    if duplicates:
        raise ValueError("Duplicate samples found in inputs %s: %s" % (duplicates, fnames))