def _validate_inputs(gff, reference, how_many, batch_sort_size): """ Raise an Error if a required file is null or non-existent :param gff: (str) path to variants.gff :param reference: (str) path to reference dir :param how_many: (int) :param batch_sort_size: (int) """ if gff is None: raise PbReportError('gff cannot be None') if not os.path.exists(gff): raise IOError('gff {g} does not exist: '.format(g=gff)) if reference is None: raise PbReportError('reference cannot be None') if not os.path.exists(reference): raise IOError('reference {g} does not exist: '.format(g=reference)) try: int(how_many) except: raise ValueError('how_many = {h}. int required.') try: int(batch_sort_size) except: raise ValueError('batch_sort_size = {h}. int required.')
def _validate_inputs(gff, reference): """ Raise an Error if a required file is null or non-existent :param gff (str) path to alignment_summary.gff :param reference (str) path to reference_dir """ if gff is None: raise PbReportError('gff cannot be None') if not os.path.exists(gff): raise IOError('gff {g} does not exist: '.format(g=gff)) if reference is None: raise PbReportError('reference cannot be None') if not os.path.exists(reference): raise IOError('reference {g} does not exist: '.format(g=reference))
def _validate_inputs(control_cmph5, filtered_subreads_csv): """ Raise an Error if a required file is null or non-existent :param control_cmph5: (str) path to control_reads.cmp.h5 :param filtered_subreads_csv: (str) path to filtered_subread_summary.csv """ if control_cmph5 is None: raise PbReportError('control_cmph5 cannot be None') if not os.path.exists(control_cmph5): raise IOError( 'control_cmph5 {g} does not exist: '.format(g=control_cmph5)) if filtered_subreads_csv is None: raise PbReportError('filtered_subreads_csv cannot be None') if not os.path.exists(filtered_subreads_csv): raise IOError('filtered_subreads_csv {g} does not exist: '.format( g=filtered_subreads_csv))
def _validate_inputs(infile, desc="input file"): """ Raise an Error if a required file is null or non-existent :param fasta_file: (str) path to fasta """ if infile is None: raise PbReportError('%s cannot be None' % desc) if not os.path.exists(infile): raise IOError('{g} does not exist {d}'.format(g=infile, d=desc))
def _validate_inputs(files): """ Raise an Error if a required file is null or non-existent :param files: list of tuples, first element of tuple is input name second is value """ for f in files: if f[1] is None: raise PbReportError('{f} cannot be None'.format(f=f[0])) if not os.path.exists(f[1]): raise IOError('{f} does not exist'.format(f=f[1]))