aryarm / as_analysis

A complete Snakemake pipeline for detecting allele specific expression in RNA-seq
MIT License
10 stars 9 forks source link

check samples exist #52

Closed aryarm closed 4 years ago

aryarm commented 5 years ago

double check that the user isn't asking for samples they haven't provided when using config['SAMP_NAMES'] maybe use something like this?

assert set(config['SAMP_NAMES']).issubset(SAMP.keys())
aryarm commented 5 years ago

or this

# double check that the user isn't asking for samples they haven't provided
user_samps = set(config['SAMP_NAMES'])
config['SAMP_NAMES'] = list(set(SAMP.keys()).intersection(user_samps))
if len(config['SAMP_NAMES']) != len(user_samps):
    warnings.warn("Not all of the samples requested have provided input. Proceeding with as many samples as is possible...")